[ 
https://issues.apache.org/jira/browse/PDFBOX-3654?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15828507#comment-15828507
 ] 

Tilman Hausherr edited comment on PDFBOX-3654 at 1/18/17 9:08 PM:
------------------------------------------------------------------

In this type1 font the "binary" part is hex encoded, in other type1 fonts I've 
seen it is pure binary.

>From the specification:
{code}
Although the encrypted portion of a standard Type 1 font may be in binary or 
ASCII hexadecimal format, PDF supports only the binary format.
{code}
So the font is incorrectly stored. But obviously, Adobe supports both, so we 
should too.


was (Author: tilman):
In this type1 font the "binary" part is hex encoded, in other type1 fonts I've 
seen it is pure binary.

>From the specification:
{code}
Although the encrypted portion of a standard Type 1 font may be in binary or 
ASCII hexadecimal format, PDF supports only the binary format.
{code}
So the font is incorrectly stored. But obviously, Adobe supports both.

> Parse error reading embedded Type1 font
> ---------------------------------------
>
>                 Key: PDFBOX-3654
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-3654
>             Project: PDFBox
>          Issue Type: Bug
>          Components: FontBox
>    Affects Versions: 2.0.4
>         Environment: FreeBSD, Openjdk 1.8.0_112, Scala 2.12.0
>            Reporter: Dennis Noordsij
>              Labels: type1, type1font
>         Attachments: KIX-Barcode-Regular.pfb, testcase2.pdf
>
>
> Attached file works with Acrobat Reader, mupdf, pdftk, and so on.
> When using pdfbox to render first page to an image:
> 16:01:13.042 [run-main-0] WARN  o.a.pdfbox.pdmodel.font.PDType1Font - Using 
> fallback font ArialMT for Frutiger
> 16:01:13.047 [run-main-0] WARN  o.a.pdfbox.pdmodel.font.PDType1Font - Using 
> fallback font Arial-BoldMT for Frutiger45,Bold
> 16:01:13.168 [run-main-0] ERROR o.a.pdfbox.pdmodel.font.PDType1Font - Can't 
> read the embedded Type1 font KIX-Barcode-Regular
> java.io.IOException: unexpected closing parenthesis
>       at org.apache.fontbox.type1.Type1Lexer.readToken(Type1Lexer.java:123)
>       at org.apache.fontbox.type1.Type1Lexer.nextToken(Type1Lexer.java:75)
>       at 
> org.apache.fontbox.type1.Type1Parser.parseBinary(Type1Parser.java:468)
>       at org.apache.fontbox.type1.Type1Parser.parse(Type1Parser.java:64)
>       at 
> org.apache.fontbox.type1.Type1Font.createWithSegments(Type1Font.java:85)
>       at 
> org.apache.pdfbox.pdmodel.font.PDType1Font.<init>(PDType1Font.java:262)
>       at 
> org.apache.pdfbox.pdmodel.font.PDFontFactory.createFont(PDFontFactory.java:62)
>       at org.apache.pdfbox.pdmodel.PDResources.getFont(PDResources.java:143)
>       at 
> org.apache.pdfbox.contentstream.operator.text.SetFontAndSize.process(SetFontAndSize.java:60)
>       at 
> org.apache.pdfbox.contentstream.PDFStreamEngine.processOperator(PDFStreamEngine.java:829)
>       at 
> org.apache.pdfbox.contentstream.PDFStreamEngine.processStreamOperators(PDFStreamEngine.java:486)
>       at 
> org.apache.pdfbox.contentstream.PDFStreamEngine.processStream(PDFStreamEngine.java:460)
>       at 
> org.apache.pdfbox.contentstream.PDFStreamEngine.processPage(PDFStreamEngine.java:150)
>       at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:189)
>       at 
> org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:145)
>       at 
> org.apache.pdfbox.rendering.PDFRenderer.renderImage(PDFRenderer.java:68)
> To reproduce (Scala, sorry, but straightforward to reproduce):
>   val doc = new PDDocument.load(...)
>   val renderer = new PDFRenderer(doc)
>   val img = renderer.renderImage(0, 1.0f)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org

Reply via email to