0

We are running ironpdf as part of springboot and it works awesome in windows locally (5-6secs) However when deployed on linux docker container, it takes 60 secs to generate a single page pdf. The logs look wierd, I see "Browser 26", "Browser 27" in log files, why so many browser instances created?

The application is running on spring boot, openjdk8.

It's also downloading debian packages and installing 1st time.

  1. Anyone faced similar issues in linux java container?
  2. Any way to disable apt package installation.

I have attached the log files, which has logs for 2 runs. 1st run installing apt packages and 2nd run just generating pdfs which is taking 60secs.

Link to logs file. https://www23.zippyshare.com/v/RPqKYdDh/file.html

License.setLicenseKey("IRONPDF.JAVA.2199-*****");
Settings.setLogPath(Paths.get("/IronPdfEngine.log"));
ChromePdfRenderOptions renderOptions = new ChromePdfRenderOptions();\ 
// Set custom options for the generated PDF document (paper size, title, etc.)
renderOptions.setPaperSize(PaperSize.A4);
renderOptions.setPrintHtmlBackgrounds(true);
renderOptions.setPaperOrientation(PaperOrientation.PORTRAIT);
renderOptions.setTitle("Vehicle Comparison Report");
renderOptions.setCssMediaType(CssMediaType.PRINT);
renderOptions.setZoom(90); // percentage
renderOptions.setViewPortWidth(1536);
renderOptions.setMarginTop(30);
renderOptions.setMarginBottom(10);
renderOptions.setMarginLeft(8);
renderOptions.setMarginRight(8);
PdfDocument myPdf = PdfDocument.renderHtmlAsPdf(htmlString, renderOptions);

HtmlHeaderFooter footer = new HtmlHeaderFooter();
footer.setMaxHeight(20); // millimeters
footer.setHtmlFragment("<center style=\"font-size: 9pt;\">{page} of {total-pages}</center>");
footer.setDrawDividerLine(true);
myPdf.addHtmlFooter(footer);

HtmlHeaderFooter header = new HtmlHeaderFooter();
header.setMaxHeight(30); // millimeters
header.setHtmlFragment("<img width=\"50\" height=\"50\" style=\"margin-top: 10px;\" src=\"https://static.smoss.apac.bmw.cloud/bmwlogo-shared/bmw_logo/bmw-logo-gray.svg\">");
header.setDrawDividerLine(true);
myPdf.addHtmlHeader(header);

// Save the PdfDocument to a file
//myPdf.saveAs(Paths.get("C:/ironpdf/compare_v1.pdf"));
return myPdf.getBinaryData();
Balaji
  • 201
  • 2
  • 12
  • How large is the content of the HTML string you are trying to render? Does it include several high pixel density images? – michael_b Apr 05 '23 at 02:13
  • Also, did you add ironpdf-engine-linux-x64 dependencies? It may not have found the bin and downloaded it on the first run. – michael_b Apr 05 '23 at 03:17
  • Pls check the log files. The input html should be less than 25KB. It has images not high resolution. It creates PDFs in windows quickly. – Balaji Apr 05 '23 at 13:14
  • @Balaji what setting are using for Single Page pdf, entire html contents in one page ? – PAR Apr 18 '23 at 18:04

0 Answers0