Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0.17
-
None
Description
The following text produces a PNG that has gray smudges in it. I've attached the pdf and the PNG that is produced.
public class TestPdfPageImage { @Test public void testGetPageImage() throws IOException { try (PDDocument pdDocument = PDDocument.load(FileUtils.toFile(getClass().getResource("/bad_page_image.pdf")))) { final PDFRenderer pdfRenderer = new PDFRenderer(pdDocument); final BufferedImage bufferedImage = pdfRenderer.renderImage(0); final Path tempPath = Files.createTempFile("es-page-image", ".png"); try { final File tempFile = tempPath.toFile(); ImageIO.write(bufferedImage, "png", tempFile); Assert.assertTrue(Files.size(tempPath) > 0); } finally { Files.delete(tempPath); } } } }