[ https://issues.apache.org/jira/browse/PDFBOX-5917?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17902390#comment-17902390 ]
Tilman Hausherr edited comment on PDFBOX-5917 at 12/2/24 6:52 PM: ------------------------------------------------------------------ Your PDF isn't "failing", it displays exceptions that seem scary. From what I see, it is the space character in Arial-BoldMT (F7). Instead of having a proper definition, it points outside of the font so we get EOF. I think we can just swallow the exception. However I'd like to do some more research because the EOF position doesn't match the length of the font stream. Update: nothing weird, the 108 is just the length of the glyf table, not the length of the font stream. !image-2024-12-02-19-52-41-092.png! was (Author: tilman): Your PDF isn't "failing", it displays exceptions that seem scary. From what I see, it is the space character in Arial-BoldMT (F7). Instead of having a proper definition, it points outside of the font so we get EOF. I think we can just swallow the exception. However I'd like to do some more research because the EOF position doesn't match the length of the font stream. > Particular PDF fails on renderImageWithDPI call > ----------------------------------------------- > > Key: PDFBOX-5917 > URL: https://issues.apache.org/jira/browse/PDFBOX-5917 > Project: PDFBox > Issue Type: Bug > Reporter: Noor Khan > Priority: Major > Attachments: image-2024-12-02-19-52-41-092.png, test.pdf > > > Hello, > > The pdf attached to this ticket fails in this following test code block I > wrote: > > {code:java} > 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); > } > } {code} > The error I get is: > {code:java} > 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 {code} > The pdf appears to load fine in the browser for me. > > I am using pdfbox 3.0.3: > {code:java} > implementation("org.apache.pdfbox:pdfbox:3.0.3") {code} > I have many other PDFs who are failing in a similar way, but I thought to > just include one for now. I can add more if it'll help. -- This message was sent by Atlassian Jira (v8.20.10#820010) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org For additional commands, e-mail: dev-h...@pdfbox.apache.org