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

PDObjectReference getReferencedObject() returns null if referenced obj is not a COSStream

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.9, 2.0.2, 2.0.3, 3.0.0 PDFBox
    • Fix Version/s: 2.0.9, 3.0.0 PDFBox
    • Component/s: PDModel
    • Labels:

      Description

      When creating a pdf I am setting a PDAnnotation as the referenced object of a PDObjectReference using setReferencedObject.

      When I subsequently load the same document and then call getReferencedObject on the PDObjectReference, null is returned. This is because an exception is thrown in PDXObject.createXObject (called inside getReferencedObject) as the referenced object is not a COSStream, just a COSDictionary.

        Attachments

        1. 000671.pdf
          848 kB
          Tilman Hausherr

          Activity

            People

            • Assignee:
              tilman Tilman Hausherr
              Reporter:
              mark.melling@savageminds.com Mark Melling
            • Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: