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

FDFAnnotationStamp fails to parse some appearance streams

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 2.0.15
    • 2.0.16, 3.0.0 PDFBox
    • PDModel
    • OpenJDK 1.8.0_201-2-redhat, Microsoft Windows 10

    Description

      Some stamps still cause issues in 2.0.15 when their appearance streams are parsed.

      I attached two XFDF files which produces this error when I merge it :

      Apr 12, 2019 7:46:34 AM org.apache.pdfbox.util.Hex decodeHex
      SCHWERWIEGEND: Can't parse
      0, aborting decode
      java.lang.NumberFormatException: For input string: "
      0"
      at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
      at java.lang.Integer.parseInt(Integer.java:569)
      at org.apache.pdfbox.util.Hex.decodeHex(Hex.java:279)
      at org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp.parseStreamElement(FDFAnnotationStamp.java:253)
      at org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp.parseStampAnnotationAppearanceXML(FDFAnnotationStamp.java:175)
      at org.apache.pdfbox.pdmodel.fdf.FDFAnnotationStamp.<init>(FDFAnnotationStamp.java:134)
      at org.apache.pdfbox.pdmodel.fdf.FDFDictionary.<init>(FDFDictionary.java:211)
      at org.apache.pdfbox.pdmodel.fdf.FDFCatalog.<init>(FDFCatalog.java:63)
      at org.apache.pdfbox.pdmodel.fdf.FDFDocument.<init>(FDFDocument.java:90)

       

      it looks like the attribute value contains a LF/CR. When this error occurs, the appearance is missing and only the outline of the stamp is shown when the user selects the element.

      I found two of the default stamps in Adobe Reader (german version) to cause this

      - SBNotForPublicRelease ("Nicht zur Veröffentlichung", bad-stamp-2.0.15.xfdf)

      - SBPreliminaryResults ("Vorläufige Ergebnisse", bad-stamp2-2.0.15.xfdf)

       

      Attachments

        1. bad_stamp2-2.0.15.xfdf
          16 kB
          Kai Keggenhoff
        2. bad_stamp-2.0.15.xfdf
          16 kB
          Kai Keggenhoff

        Activity

          People

            tilman Tilman Hausherr
            k.keggenhoff Kai Keggenhoff
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: