Uploaded image for project: 'PDFBox'
  1. PDFBox
  2. PDFBOX-2216

java.io.IOException: Found Token[kind=NAME, text= ] but expected LITERAL for type1 font

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0
    • Fix Version/s: 2.0.0
    • Component/s: FontBox
    • Labels:

      Description

      I get this with the attached file on page 3:

      java.io.IOException: Found Token[kind=NAME, text= ] but expected LITERAL
              at org.apache.fontbox.type1.Type1Parser.read(Type1Parser.java:727)
              at org.apache.fontbox.type1.Type1Parser.readCharStrings(Type1Parser.java:658)
              at org.apache.fontbox.type1.Type1Parser.parseBinary(Type1Parser.java:522)
              at org.apache.fontbox.type1.Type1Parser.parse(Type1Parser.java:64)
      

      The cause is that the font has a few NULL bytes (see attached font file). These are regarded as literals.

      My solution would be to skip them in Type1Lexer them like we skip spaces, but to put out a warning.

      WDYT?

        Attachments

        1. 1405627645601.txt
          0.9 kB
          Tilman Hausherr
        2. PDFBOX-2216-025977.pdf
          37 kB
          Tilman Hausherr

          Activity

            People

            • Assignee:
              tilman Tilman Hausherr
              Reporter:
              tilman Tilman Hausherr
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: