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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.0
    • 2.0.0
    • FontBox

    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

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

            Dates

              Created:
              Updated:
              Resolved: