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

ClassCastException in BaseParser.parseCOSDictionaryValue

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.7, 1.8.8, 2.0.0
    • Fix Version/s: 1.8.8, 2.0.0
    • Component/s: Parsing
    • Labels:
      None

      Description

      java.lang.ClassCastException: org.apache.pdfbox.cos.COSArray cannot be cast to org.apache.pdfbox.cos.COSInteger
      	at org.apache.pdfbox.pdfparser.BaseParser.parseCOSDictionaryValue(BaseParser.java:265)
      	at org.apache.pdfbox.pdfparser.BaseParser.parseCOSDictionary(BaseParser.java:351)
      	at org.apache.pdfbox.pdfparser.BaseParser.parseDirObject(BaseParser.java:1258)
      	at org.apache.pdfbox.preflight.parser.PreflightParser.parseDirObject(PreflightParser.java:612)
      	at org.apache.pdfbox.preflight.parser.PreflightParser.parseObjectDynamically(PreflightParser.java:730)
      	at org.apache.pdfbox.pdfparser.NonSequentialPDFParser.parseObjectDynamically(NonSequentialPDFParser.java:1441)
      	at org.apache.pdfbox.pdfparser.NonSequentialPDFParser.parseDictObjects(NonSequentialPDFParser.java:1417)
      	at org.apache.pdfbox.pdfparser.NonSequentialPDFParser.initialParse(NonSequentialPDFParser.java:544)
      	at org.apache.pdfbox.preflight.parser.PreflightParser.initialParse(PreflightParser.java:244)
      	at org.apache.pdfbox.pdfparser.NonSequentialPDFParser.parse(NonSequentialPDFParser.java:1013)
      	at org.apache.pdfbox.preflight.parser.PreflightParser.parse(PreflightParser.java:192)
      	at org.apache.pdfbox.preflight.parser.PreflightParser.parse(PreflightParser.java:174)
      	at org.apache.pdfbox.preflight.parser.PreflightParser.parse(PreflightParser.java:162)
      	at pdfboxpageimageextraction.PreflightTest.main(PreflightTest.java:57)
      

      The cause is this:

      /Dest [ 7 0 R /XYZ null null null ] 0 R

      My fix doesn't allow to view the file, but at least it doesn't throw a lang exception.

        Attachments

        1. 494788.pdf
          177 kB
          Tilman Hausherr

          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: