Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.0.32, 3.0.3 PDFBox
-
None
Description
Hello,
The pdf attached to this ticket fails in this following test code block I wrote:
try (PDDocument pdDocument = Loader.loadPDF(Path.of("path to test.pdf").toFile())) { PDFRenderer pdfRenderer = new PDFRenderer(pdDocument); for (int page = 1; page <= pdDocument.getNumberOfPages(); page++) { pdfRenderer.renderImageWithDPI(page - 1, 300, ImageType.RGB); } }
The error I get is:
Dec 02, 2024 11:59:23 AM org.apache.pdfbox.rendering.GlyphCache getPathForCharacterCode
SEVERE: Glyph rendering failed for code 32 in font Arial-BoldMT
java.io.EOFException: EOF at 108, b1: -1, b2: -1
The pdf appears to load fine in the browser for me.
I am using pdfbox 3.0.3:
implementation("org.apache.pdfbox:pdfbox:3.0.3")
I have many other PDFs which are failing in a similar way, but I thought to just include one for now. I can add more if it'll help.