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

Performance issue when rendering first page of PDF

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Not A Problem
    • Affects Version/s: 2.0.7
    • Fix Version/s: None
    • Component/s: Rendering
    • Labels:
      None

      Description

      Let say that you want to generate PNG for all pages in PDF.
      The generation of the first page is really slow, the second one is quite fast.

      For example test PDF contains two same PDF pages.
      First page renders in: ~2000ms
      Second one: ~220 ms

      It looks like for the first page (inv.0) there's 359 ms overhead just for creating the font.

      calls.png

      Tried to use other library to perform the same operation with the same pdf file and I was able to retrieve BufferedImage of the first (slower) page in ~750 ms.
      For the second page the result was almost the same like for the PDFBox.

      It looks like there's the place to improve performance when starting rendering the PDF page.
      Or do you have any advices how to improve performance in the example project?

      Test project: https://github.com/mmatecki/pdfboxperformance

        Attachments

        1. calls.png
          58 kB
          Maciej Matecki

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              mmatecki Maciej Matecki
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: