Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-4448

"Weasyprint" PDF's causing large memory spike

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Bug
    • Affects Version/s: 2.0.13
    • Fix Version/s: None
    • Component/s: Rendering
    • Labels:
    • Environment:
      Windows 10 (x64)

      Description

      PDF's created with "weasyprint" appear to cause a massive spike in memory usage when printing. This can be seen in their "invoice sample" provided on their page (causes a ~2.5gb average spike for a 47kb file) or the attached test pdf (causes a ~1.8gb average spike for a 6kb file).

      Trying to source the cause in the java print libraries seems to indicate it's a problem with "nonsolid colors" being used in the drawing of the page (which we are passing off to a PDFPrintable). On my windows machine, normally a (sun) WPrinterJob gets created for printing, but for some reason these pdf's end up using a Paint flagged as incompatible which fails the job creation.

      Trying to print with just pdfbox from the command line gives similar results in memory usage spiking to what we are seeing in our application: java -jar pdfbox-app-2.0.13.jar PrintPDF -printerName PDFCreator test.pdf

        Attachments

        1. test.pdf
          6 kB
          Brett

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              bberenz Brett
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: