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

Regression: Images get blurry when rendering with 304 DPI (works fine with 2.0.19)

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • 2.0.20
    • None
    • Rendering
    • None

    Description

      There seems to be a regression when rendering a PDF to an high DPI image with PDFBox 2.0.20. Everything worked fine with PDFBox 2.0.19.

      See the attached FlowerBompA6.pdf file. The rendering is done using

      }}{{PDFRenderer pdfRenderer = new PDFRenderer(doc);
      BufferedImage bufferedImage = pdfRenderer.renderImageWithDPI(0, 304, ImageType.RGB);

       

      I've build a small project to reproduce this problem:

      https://github.com/rototor/pdfbox-render-blurry

      Checkout this repository and run mvn clean test. You find a blurry rendering of the PDF as result in the target/test folder.

      Then change the PDFBox Version in the pom.xml to 2.0.19 and run mvn clean test again.
      The rendering of the flowers are now sharp.

      A test driver in a project of mine compares the resulting file sizes after exporting the image as JPGs. Because of the blurring the resulting file is way smaller then it used to be...

       

      Attachments

        1. FlowerBompA6.pdf
          12.49 MB
          Emmeran Seehuber
        2. image-2020-06-15-15-29-32-611.png
          4.92 MB
          Emmeran Seehuber
        3. image-2020-06-15-15-29-33-208.png
          5.04 MB
          Emmeran Seehuber

        Issue Links

          Activity

            People

              tilman Tilman Hausherr
              rototor Emmeran Seehuber
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: