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

Can't draw PDFs while ANNOTS is COSStream instead of COSArray

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.8
    • 2.0.9, 3.0.0 PDFBox
    • PDModel
    • None

    Description

      PDFBox would failed to draw the attached document , error logs are below:

      java.lang.ClassCastException: org.apache.pdfbox.cos.COSStream cannot be cast to org.apache.pdfbox.cos.COSArray
      at org.apache.pdfbox.pdmodel.PDPage.getAnnotations(PDPage.java:661) ~[classes/:?]
      at org.apache.pdfbox.rendering.PageDrawer.drawPage(PageDrawer.java:202) ~[classes/:?]

      This PDF put COSStream as the page's ANNOTS object, and caused the failure.

      Simply do type checks in PDPage.getAnnotations might avoid this issue, but the annotations would lost.

       

      This PDF show correctly (I mean annotation works) in:

      • Chrome 63.0.3239.132
      • Adobe Reader 11.0.23

      This PDF doesn't work perfectly in:

      • Microsoft Edge

       

       

       

      Attachments

        1. Benelux Equity Daily-20110321.pdf
          1.10 MB
          Cheng Zhong
        2. TELECOM EQUIPMENT DAILY - 12 AUG 2009.pdf
          150 kB
          Cheng Zhong

        Activity

          People

            lehmi Andreas Lehmkühler
            hust.zcheng Cheng Zhong
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: