Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
2.0.20
-
None
-
None
-
x64 windows. several 64-bit Java 8 JREs
-
Important
Description
org.apache.pdfbox.rendering.PDFRenderer.renderImageWithDPI method no longer correctly renders pixels in a raster graphic PDF at the resolution requested.
PDFRenderer pdfRenderer = new PDFRenderer(PDDocument.load(new File("sample_bilevel_raster.pdf")));
BufferedImage bi = pdfRenderer.renderImageWithDPI(0, 300, ImageType.RGB);
javax.imageio.ImageIO.write(bim, "PNG", new File("my png filename));
I tested this with all Pdfbox 2 releases (2.0.0 - 2.0.20) and found this bug only affecting 2.0.20. 2.0.0-2.0.19 produced correct output.
it appears v20 renders onto a destination image of the correct size but the source image is set at 72 DPI causing the destination pixels to be extrapolated gray-scale.
This is reproducible with any bi-level raster PDF I used. See attached input and output files.
Attachments
Issue Links
- duplicates
-
PDFBOX-4863 Bitmapped fonts are rendered very blurry
- Closed