You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pdfbox.apache.org by "Tilman Hausherr (JIRA)" <ji...@apache.org> on 2014/06/12 18:46:03 UTC

[jira] [Commented] (PDFBOX-2133) Parsing of a Type1 font fails with a NumberFormatException

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

Tilman Hausherr commented on PDFBOX-2133:
-----------------------------------------

This is the beginning of the private dict:
{code}
dup /Private 23 dict dup begin
/-| {string currentfile exch readstring pop} executeonly def
/|- {noaccess def} executeonly def
/| {noaccess put} executeonly def
/BlueScale 0.061 def
/BlueShift 7.1 def
{code}
According to the [spec|http://partners.adobe.com/public/developer/en/font/T1Format.pdf] BlueShift should be an integer and the default is 7.

{code}
        else if (key.equals("BlueScale"))
        {
            font.blueScale = value.get(0).floatValue();
        }
        else if (key.equals("BlueShift"))
        {
            font.blueShift = value.get(0).intValue();
        }
        else if (key.equals("BlueFuzz"))
        {
            font.blueScale = value.get(0).intValue();
        }
{code}

Btw, the BlueFuzz value is assigned to bluescale.

> Parsing of a Type1 font fails with a NumberFormatException
> ----------------------------------------------------------
>
>                 Key: PDFBOX-2133
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2133
>             Project: PDFBox
>          Issue Type: Bug
>          Components: FontBox
>    Affects Versions: 2.0.0
>            Reporter: Petr Slaby
>            Assignee: John Hewson
>            Priority: Minor
>         Attachments: 000116.pdf, 000304.pdf, testrun.log
>
>
> When rendering the attached PDF, parsing of a font fails with a NumberFormatException. Many NullPointerExceptions and "missing fonts" are being reported then. The PDF rendered fine in our modified 1.7.x where fonts were read using AWT. I did not try with current 1.8.x. Stack traces are attached.
> Note: This is just a file from my test suite, not a production problem. I am not sure whether the parser or the PDF is wrong, but the fact that it renders fine in Acrobat and in 1.7.x indicates that the former is true. The offending font is F2, if I catch and ignore the runtime exception in PDResources#getFonts() then it is reported as missing in the PageDrawer.



--
This message was sent by Atlassian JIRA
(v6.2#6252)