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

PDAnnotationMarkup.getInReplyTo throws exception when no element

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.0
    • Fix Version/s: 2.0.0
    • Component/s: PDModel
    • Labels:
      None

      Description

      From David L. from the user the mailing list:

      I'm trying to read annotations from PDFs and am having trouble matching up
      replies with the annotations they're in reply to.

      PDPage.getAnnotations() returns a list of PDAnnotation. When I have
      a PDAnnotationMarkup, I try to call getInReplyTo to get the previous
      annotation in the thread. But I have two problems:

      1) getInReplyTo() crashes if the annotation isn't a reply. It'd be nice if
      it just returned null. I can work around this by getting the COSDictionary
      and checking for an IRT entry first.

      (... other problem already solved...)

      it is an IOException, this isn't as bad as a nullpointerexception. But it is kindof weird indeed, usually we just return null when something doesn't exist.

        Attachments

          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: