[ https://issues.apache.org/jira/browse/PDFBOX-1844?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13873306#comment-13873306 ]
Tilman Hausherr commented on PDFBOX-1844: ----------------------------------------- I get this with the file of PDFBOX-1713 (which is unsolved, but the error message might be new): 16.01.2014 11:22:34.153 ERROR [main] org.apache.pdfbox.pdmodel.font.PDType1Font:251 - Can't read the embedded Type1 font NimbusSanL-Regu java.io.IOException: Found Token[kind=NAME, text=FontDirectory] but expected INTEGER at org.apache.fontbox.type1.Type1Parser.read(Type1Parser.java:637) at org.apache.fontbox.type1.Type1Parser.parseASCII(Type1Parser.java:88) at org.apache.fontbox.type1.Type1Parser.parse(Type1Parser.java:65) at org.apache.fontbox.type1.Type1Parser.parse(Type1Parser.java:65) at org.apache.fontbox.type1.Type1Font.createWithSegments(Type1Font.java:70) at org.apache.pdfbox.pdmodel.font.PDType1Font.<init>(PDType1Font.java:247) at org.apache.pdfbox.pdmodel.font.PDFontFactory.createFont(PDFontFactory.java:92) at org.apache.pdfbox.pdmodel.PDResources.getFonts(PDResources.java:204) at org.apache.pdfbox.util.PDFStreamEngine.getFonts(PDFStreamEngine.java:580) at org.apache.pdfbox.util.operator.SetTextFont.process(SetTextFont.java:54) at org.apache.pdfbox.util.PDFStreamEngine.processOperator(PDFStreamEngine.java:529) at pdfboxpageimageextraction.MyPDFStreamEngine.processOperator(MyPDFStreamEngine.java:167) at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:258) at org.apache.pdfbox.util.PDFStreamEngine.processSubStream(PDFStreamEngine.java:225) at org.apache.pdfbox.util.PDFStreamEngine.processStream(PDFStreamEngine.java:205) at pdfboxpageimageextraction.MyPDFStreamEngine.getMaxDpi(MyPDFStreamEngine.java:53) at pdfboxpageimageextraction.ExtractImages.doPdf(ExtractImages.java:218) at pdfboxpageimageextraction.ExtractImages.main(ExtractImages.java:77) > [PATCH] Parser for Type 1 Fonts > ------------------------------- > > Key: PDFBOX-1844 > URL: https://issues.apache.org/jira/browse/PDFBOX-1844 > Project: PDFBox > Issue Type: Improvement > Components: FontBox > Affects Versions: 2.0.0 > Reporter: John Hewson > Assignee: Andreas Lehmkühler > Labels: patch, rendering > Attachments: CustomEncoding.java, Token.java, > Type1CharStringReader.java, Type1Font.java, Type1Glyph2D.java, > Type1Lexer.java, Type1Mapping.java, Type1Parser.java, latexdemo.pdf, > redp4581.pdf, test.pdf, type1-v3.patch > > > This patch adds a parser for Type 1 fonts to FontBox and makes use of it in > PDFBox for rendering Type 1 glyphs. This should fix various issues with the > JVM crashing and rendering fonts incorrectly. > It was necessary to modify Type1CharStringParser to handle the > `callothersubr` command and correctly handle subroutines. Likewise, > Type1CharString was modified to support "flex". > This patch does not remove the AWT fallback for non-embedded and standard 14 > fonts because an entirely new fallback system is needed and suitable fonts > will need to be shipped as part of PDFBox. This needs to be discussed on the > mailing list and/or in follow-on issue. > Note: To keep this patch small I have not replaced any of the existing ad-hoc > Type 1 parsing code in PDType1Font and preflight. Those classes retain their > original code which can be replaced in subsequent patches/refactoring. I can > open follow-on issues for these. > ~~~ > As well as the patch, the these files were added: > + /pdfbox/src/main/java/org/apache/pdfbox/pdfviewer/font/Type1Glyph2D.java > + /fontbox/src/main/java/org/apache/fontbox/encoding/CustomEncoding.java > + /fontbox/src/main/java/org/apache/fontbox/type1/Token.java > + /fontbox/src/main/java/org/apache/fontbox/type1/Type1CharStringReader.java > + /fontbox/src/main/java/org/apache/fontbox/type1/Type1Font.java > + /fontbox/src/main/java/org/apache/fontbox/type1/Type1Lexer.java > + /fontbox/src/main/java/org/apache/fontbox/type1/Type1Mapping.java > + /fontbox/src/main/java/org/apache/fontbox/type1/Type1Parser.java > And this file was removed: > - /pdfbox/src/main/java/org/apache/pdfbox/pdfviewer/font/CFFGlyph2D.java -- This message was sent by Atlassian JIRA (v6.1.5#6160)