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

NoSuchElementException when reading cmap format 4 subtable

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.8.6, 1.8.7, 2.0.0
    • 1.8.7, 2.0.0
    • FontBox
    • None

    Description

      I get this with the attached file:

      Exception in thread "main" java.util.NoSuchElementException
              at java.util.HashMap$HashIterator.nextEntry(Unknown Source)
              at java.util.HashMap$KeyIterator.next(Unknown Source)
              at java.util.Collections.max(Unknown Source)
              at org.apache.fontbox.ttf.CMAPEncodingEntry.processSubtype4(CMAPEncodingEntry.java:404)
              at org.apache.fontbox.ttf.CMAPEncodingEntry.initSubtable(CMAPEncodingEntry.java:92)
              at org.apache.fontbox.ttf.CMAPTable.read(CMAPTable.java:72)
              at org.apache.fontbox.ttf.TrueTypeFont.readTable(TrueTypeFont.java:277)
              at org.apache.fontbox.ttf.TTFParser.parseTables(TTFParser.java:143)
              at org.apache.fontbox.ttf.TTFParser.parseTTF(TTFParser.java:124)
              at org.apache.fontbox.ttf.TTFParser.parseTTF(TTFParser.java:98)
      

      While the 1.8 version recovers, the 2.0 version doesn't. My fix prevents the exception and puts out a warning. Adobe Reader can render the file, although there is a weird glyph between "program" and "administration", and between "claimants" and "eligibility".

      Attachments

        1. PDFBOX-2251-070040p321.pdf
          2.70 MB
          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: