[
https://issues.apache.org/jira/browse/PDFBOX-2854?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15355821#comment-15355821
]
Tilman Hausherr commented on PDFBOX-2854:
-----------------------------------------
build tests failed on the server because I had forgotten about a change I did
two months ago, due to this post on the user mailing list by Szirbik F.:
https://mail-archives.apache.org/mod_mbox/pdfbox-users/201604.mbox/%[email protected]%3e
{code}
java.lang.NullPointerException
at org.apache.fontbox.ttf.TrueTypeFont.nameToGID(TrueTypeFont.java:580)
at
org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.codeToGID(PDTrueTypeFont.java:559)
at
org.apache.pdfbox.rendering.TTFGlyph2D.getGIDForCharacterCode(TTFGlyph2D.java:105)
at
org.apache.pdfbox.rendering.TTFGlyph2D.getPathForCharacterCode(TTFGlyph2D.java:92)
at org.apache.pdfbox.rendering.PageDrawer.drawGlyph2D(PageDrawer.java:353)
at org.apache.pdfbox.rendering.PageDrawer.showFontGlyph(PageDrawer.java:334)
at
org.apache.pdfbox.contentstream.PDFStreamEngine.showGlyph(PDFStreamEngine.java:744)
at
org.apache.pdfbox.contentstream.PDFStreamEngine.showText(PDFStreamEngine.java:701)
at
org.apache.pdfbox.contentstream.PDFStreamEngine.showTextString(PDFStreamEngine.java:564)
at
org.apache.pdfbox.contentstream.operator.text.ShowText.process(ShowText.java:55)
at
org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:815)
at
org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:472)
at
org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:446)
at
org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:149)
at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:189)
at org.apache.pdfbox.rendering.PDFRenderer.renderPage(PDFRenderer.java:208)
at
org.apache.pdfbox.rendering.PDFRenderer.renderPageToGraphics(PDFRenderer.java:169)
at org.apache.pdfbox.printing.PDFPrintable.print(PDFPrintable.java:184)
at sun.print.RasterPrinterJob.printPage(RasterPrinterJob.java:2106)
at sun.print.RasterPrinterJob.print(RasterPrinterJob.java:1488)
at sun.print.RasterPrinterJob.print(RasterPrinterJob.java:1331)
at ... .printPDF(... .java:63)
I think the problem is that in the readPostScriptNames() where is a chance that
the postScriptNames remains null.
// look up in 'post' table
--> readPostScriptNames();
Integer gid = postScriptNames.get(name);
if (gid != null && gid > 0 && gid < getMaximumProfile().getNumGlyphs())
{
return gid;
}
{code}
He never answered my request for a sample file so I forgot about the change.
> TTFSubsetter NoSuchElementException
> -----------------------------------
>
> Key: PDFBOX-2854
> URL: https://issues.apache.org/jira/browse/PDFBOX-2854
> Project: PDFBox
> Issue Type: Bug
> Components: FontBox
> Affects Versions: 2.0.0
> Reporter: simon steiner
> Assignee: Tilman Hausherr
> Fix For: 2.0.3, 2.1.0
>
>
> Exception in thread "main" java.util.NoSuchElementException
> at java.util.TreeMap$PrivateEntryIterator.nextEntry(TreeMap.java:1113)
> at java.util.TreeMap$EntryIterator.next(TreeMap.java:1151)
> at java.util.TreeMap$EntryIterator.next(TreeMap.java:1146)
> at
> org.apache.fontbox.ttf.TTFSubsetter.buildOS2Table(TTFSubsetter.java:523)
> at
> org.apache.fontbox.ttf.TTFSubsetter.writeToStream(TTFSubsetter.java:1081)
> TrueTypeFont x = new TTFParser().parse("Uvb_____.TTF");
> new TTFSubsetter(x, null).writeToStream(new ByteArrayOutputStream());
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]