Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
2.0.26, 3.0.0 PDFBox
-
None
-
None
Description
hi
This may be a problem similar to PDFBOX-4470 Red areas around text when converting a pdf to png with pdfbox - ASF JIRA (apache.org)
When I convert a pdf to png files with pdfbox, I find that the backgroud White color was rendered as Red. And this is unusual, I have only one pdf rendered like this. But in this pdf, almost all pages are rendered as Red color.
Here's some of the code that I'm using:
try (PDDocument document = PDDocument.load(new File("example/" + file + ".pdf"))) { int numberOfPages = document.getNumberOfPages(); PDFRenderer renderer = new PDFRenderer(document); for (int i = 0; i < numberOfPages; i++) { System.out.println("render " + i); BufferedImage bufferedImage = renderer.renderImage(i, 2, ImageType.RGB); ImageIO.write(bufferedImage, "png", new File("example/" + file + "-" + i + ".png")); } }
I also tried pdfbox 3.0.0-RC1, but result is the same.
The red png files start at pdf page 3.
Attachments
Attachments
Issue Links
- duplicates
-
PDFBOX-5778 Grayscale JPEG rendered multicolor
- Closed