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

ClassCastException in COSArrayList.convertIntegerCOSArrayToList for font widths

    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: Parsing
    • Labels:
      None

      Description

      I get this with the attached file:

      java.lang.ClassCastException: org.apache.pdfbox.cos.COSObject cannot be cast to org.apache.pdfbox.cos.COSNumber
              at org.apache.pdfbox.pdmodel.common.COSArrayList.convertIntegerCOSArrayToList(COSArrayList.java:278)
              at org.apache.pdfbox.pdmodel.font.PDFont.getWidths(PDFont.java:739)
              at org.apache.pdfbox.pdmodel.font.PDFont.getFontWidth(PDFont.java:805)
              at org.apache.pdfbox.pdmodel.font.PDFont.getFontWidth(PDFont.java:312)
              at org.apache.pdfbox.util.PDFStreamEngine.processText(PDFStreamEngine.java

      The cause is this:

      22 0 obj
      [ 583 536 ...... 694 23 0 R 875 708 ...... ]
      endobj
      23 0 obj
      542
      endobj
      

      The indirect reference looks stupid, but isn't forbidden. The spec just mentions that there must be an array of widths.

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved: