pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Lehmkuehler <andr...@lehmi.de>
Subject Re: Problem reading PDF with Type1 font
Date Tue, 12 Jul 2016 14:15:51 GMT
Am 12.07.2016 um 15:18 schrieb Thomas Letsch:
> Hi Andreas,
> thanks for your answer.
> Am 12.07.2016 um 15:01 schrieb Andreas Lehmkuehler:
>> Hi,
>> Am 12.07.2016 um 14:18 schrieb Thomas Letsch:
>>> Hi,
>>> I am reading a PDF file with an embedded type1 font. I am getting an
>>> IOException during parsing of the PDF (I removed the name of the font
>>> for legal reasons):
>> Why not, is it a secret font?
> Actually I don't know. The whole PDF is confidential, so any part of it
> is probably, too. And its not a common font you find on the web.
But maybe some of the devs have access to that font. Saying that, what is the 
name of that specific font?

>>> PDType1Font [ERROR] Can't read the embedded Type1 font <name removed>
>>> java.io.IOException: Found Token[kind=START_ARRAY, text=[] but expected
>>> Unfortunately I cannot send you the PDF, but I can send you an extract
>>> with the (hopefully) interesting parts.
>> I doesn't help. We need the font itself as the parser throws the
>> exception when reading the font.
> This is my fault, I didn't include the whole stack trace. Sorry, here it is:
> java.io.IOException: Found Token[kind=START_ARRAY, text=[] but expected
>     at org.apache.fontbox.type1.Type1Parser.read(Type1Parser.java:754)
>     at
> org.apache.fontbox.type1.Type1Parser.readEncoding(Type1Parser.java:200)
>     at org.apache.fontbox.type1.Type1Parser.parseASCII(Type1Parser.java:128)
>     at org.apache.fontbox.type1.Type1Parser.parse(Type1Parser.java:61)
>     at
> org.apache.fontbox.type1.Type1Font.createWithSegments(Type1Font.java:85)
>     at
> org.apache.pdfbox.pdmodel.font.PDType1Font.<init>(PDType1Font.java:228)
>     at
> org.apache.pdfbox.pdmodel.font.PDFontFactory.createFont(PDFontFactory.java:62)
>     at org.apache.pdfbox.pdmodel.PDResources.getFont(PDResources.java:123)
>     at
> org.apache.pdfbox.contentstream.operator.text.SetFontAndSize.process(SetFontAndSize.java:60)
>     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)
> This looks for my non-expert eyes like a problem in reading the
> encoding. At least this is my hope, because then we perhaps can get
> along without the font file.
The parser has a problem with reading the _internal_ encoding of the font, which 
has nothing to do with the encoding within the pdf itself.
There are 2 possible issues, either the font is malformed or our parser has a 
bug and unfortunately we need the font itself to find out.

>> BTW, what PDFBox version are you using?
> 2.0.2
> Thanks,
> Thomas


To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
For additional commands, e-mail: users-help@pdfbox.apache.org

View raw message