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

ClassCastException in PDDocumentCatalog.getDocumentOutline if 'outlines' is not a dictionary

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0.11, 3.0.0 PDFBox
    • 2.0.12, 3.0.0 PDFBox
    • Parsing
    • None

    Description

      In PDDocumentOutline.getDocumentOutline() the 'outline' is read as dictionary object and directly cast to COSDictionary. Normally this is ok as it should be a dictionary. However in a bad PDF as I have it in my collection (unfortunately I'm not allowed to disclose it) the object is an array (COSArray) which leads to the ClassCastException.

      Since the outline is an optional information the best we can do here is to ignore the 'outline' data if its not a COSDIctionary and return 'null'.

      Attachments

        Activity

          People

            tboehme Timo Boehme
            tboehme Timo Boehme
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: