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

PDF consisting on one page with 5 MB renders until the end of time using renderImageWithDPI

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.8
    • 2.0.14, 3.0.0 PDFBox
    • Rendering
    • None

    Description

      I am using PDFBOX 2.0.8 on a Java VM 1.8.0_151

      The attached and valid pdf should be rendered by calling

      BufferedImage bim = pdfRenderer.renderImageWithDPI(i, 50);

      But the rendering never ends - the only thing I see is this line repeating very often in the console:

      [Finalizer] DEBUG org.apache.pdfbox.io.ScratchFileBuffer - ScratchFileBuffer not closed!

      Here is the code that is used to open the document and then start the rendering:

      PDDocument document = PDDocument.load(file, MemoryUsageSetting.setupTempFileOnly());
      try  {
         PDFRenderer pdfRenderer = new PDFRenderer(document);
         int numberOfPages = document.getPages().getCount();
         for (int i = 0; i < numberOfPages; i++) {
            BufferedImage bim = pdfRenderer.renderImageWithDPI(i, 50);
      [...]
      

      The line

      BufferedImage bim = pdfRenderer.renderImageWithDPI(i, 50);

      is never passed. I ran a test and have wait for 30 minutes to let it pass, but nothing happens.

      Please advise what to do and how to solve the issue.

      Attachments

        Activity

          People

            tilman Tilman Hausherr
            Pinny3 Christian
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: