Details
Description
I use the PDFRender in my application and noticed that the renderImageWithDPI method throws an exception with certain pdf files. The bug can be reproduced with the pdfbox-app command below. The medibank.pdf file is available via my Google Drive account:
https://drive.google.com/file/d/0B7b7_UXpgIdGb2djYTNDNmVtVTA/view?usp=sharing
$ java -jar pdfbox-app-2.0.0-20150819.113526-1604.jar PDFToImage medibank.pdf
Aug 20, 2015 3:53:43 PM org.apache.pdfbox.rendering.TTFGlyph2D getPathForGID
WARNING: No glyph for 119 (CID 0077) in font GlyphLessFont
Exception in thread "main" java.io.EOFException: premature EOF
at org.apache.fontbox.ttf.TTFDataStream.readUnsignedByte(TTFDataStream.java:117)
at org.apache.fontbox.ttf.GlyfSimpleDescript.readFlags(GlyfSimpleDescript.java:196)
at org.apache.fontbox.ttf.GlyfSimpleDescript.<init>(GlyfSimpleDescript.java:77)
at org.apache.fontbox.ttf.GlyphData.initData(GlyphData.java:58)
at org.apache.fontbox.ttf.GlyphTable.getGlyph(GlyphTable.java:161)
at org.apache.pdfbox.pdmodel.font.PDCIDFontType2.getPath(PDCIDFontType2.java:418)
at org.apache.pdfbox.pdmodel.font.PDType0Font.getPath(PDType0Font.java:486)
at org.apache.pdfbox.rendering.TTFGlyph2D.getPathForGID(TTFGlyph2D.java:141)
at org.apache.pdfbox.rendering.TTFGlyph2D.getPathForCharacterCode(TTFGlyph2D.java:93)
at org.apache.pdfbox.rendering.PageDrawer.drawGlyph2D(PageDrawer.java:343)
at org.apache.pdfbox.rendering.PageDrawer.showFontGlyph(PageDrawer.java:324)
at org.apache.pdfbox.contentstream.PDFStreamEngine.showGlyph(PDFStreamEngine.java:727)
at org.apache.pdfbox.contentstream.PDFStreamEngine.showText(PDFStreamEngine.java:684)
at org.apache.pdfbox.contentstream.PDFStreamEngine.showTextStrings(PDFStreamEngine.java:592)
at org.apache.pdfbox.contentstream.operator.text.ShowTextAdjusted.process(ShowTextAdjusted.java:38)
at org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:798)
at org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:460)
at org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:437)
at org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:148)
at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:179)
at org.apache.pdfbox.rendering.PDFRenderer.renderPage(PDFRenderer.java:205)
at org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:136)
at org.apache.pdfbox.rendering.PDFRenderer.renderImageWithDPI(PDFRenderer.java:95)
at org.apache.pdfbox.tools.PDFToImage.main(PDFToImage.java:236)
at org.apache.pdfbox.tools.PDFBox.main(PDFBox.java:89)