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

ClassCastException in COSArrayList.convertIntegerCOSArrayToList for font widths

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.8.6, 1.8.7, 2.0.0
    • 1.8.7, 2.0.0
    • Parsing
    • 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

        1. PDFBOX-2198-014936.pdf
          298 kB
          Tilman Hausherr

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: