Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.8.7, 2.0.0
-
Windows 7, Eclipse Helios SR2
Description
When using PDPage.convertToImage() to export PNG files of pages with annotations on them, "ghost" outlines of the annotations sometimes appear on the generated image. The outlines do not correspond to the location of the annotations. See the attached files.
Code used:
String inputFilePath = "C:/Gilad/input/3 Pages from batch_sequences.pdf";
PDDocument doc = PDDocument.load(inputFilePath);
for (int p=0; p<doc.getNumberOfPages(); p++)
{ PDPage page = (PDPage) doc.getDocumentCatalog().getAllPages().get(p); BufferedImage bImg = page.convertToImage(); String imagePath = FilenameUtils.getFullPath(inputFilePath) + "PAGE"+ Integer.toString(p) + ".png"; File yourImageFile = new File(imagePath); ImageIO.write(bImg,"png",yourImageFile); }