Details
Description
Run this:
@Test public void testRendering() throws IOException { File pdfFile = new File("a.pdf"); Assert.assertTrue(pdfFile.canRead()); PDDocument document = PDDocument.load(pdfFile); Assert.assertEquals(2, document.getNumberOfPages()); PDFRenderer pdfRenderer = new PDFRenderer(document); BufferedImage firstPageImage = pdfRenderer.renderImage(0, 1, ImageType.RGB); File pngFile = new File("a.png"); ImageIO.write(firstPageImage, "png", pngFile); }
The generated image is blank.