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

PDAnnotationLink::getBorderStyle() don't understand external border style

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.8.8, 1.8.9, 2.0.0
    • 1.8.9, 2.0.0
    • PDModel
    • None
    • Ubuntu 14.04, JRE 1.7

    Description

      getBorderStyle() trying to get "BS" property and convert it to COSDictionary:

       COSDictionary bs = (COSDictionary) this.getDictionary().getItem(
                      COSName.getPDFName( "BS" ) );
      

      But it doesn't work when style is in external object and linked by reference (see example attached in project zip):

      Exception in thread "main" java.lang.ClassCastException: org.apache.pdfbox.cos.COSObject cannot be cast to org.apache.pdfbox.cos.COSDictionary
      at org.apache.pdfbox.pdmodel.interactive.annotation.PDAnnotationLink.getBorderStyle(PDAnnotationLink.java:131)
      at org.accusoft.example.Bug.main(Bug.java:17)

      I think it need something like conditional second getDictionary() here.

      Attachments

        1. eclipse_project.zip
          4 kB
          Alexey Kulentsov

        Activity

          People

            tilman Tilman Hausherr
            crimaniak Alexey Kulentsov
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: