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

NoSuchElementException when reading cmap format 4 subtable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.6, 1.8.7, 2.0.0
    • Fix Version/s: 1.8.7, 2.0.0
    • Component/s: FontBox
    • Labels:
      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

          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: