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

Corrupted XMP causes java.lang.StringIndexOutOfBoundsException

VotersWatch issueWatchersLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.8.11, 1.8.12, 2.0.0
    • 1.8.12, 2.0.0
    • XmpBox
    • None

    Description

      Using preflight version 2.0.0-RC3, the validation of the document "bad-fmt-95-m28154.pdf" causes the exception :
      java.lang.StringIndexOutOfBoundsException: String index out of range: -1
      at java.lang.String.substring(String.java:1911)
      at org.apache.xmpbox.xml.DomXmpParser.parseInitialXpacket(DomXmpParser.java:671)
      at org.apache.xmpbox.xml.DomXmpParser.parse(DomXmpParser.java:139)
      at org.apache.pdfbox.preflight.process.MetadataValidationProcess.validate(MetadataValidationProcess.java:69)
      at org.apache.pdfbox.preflight.utils.ContextHelper.callValidation(ContextHelper.java:84)
      at org.apache.pdfbox.preflight.utils.ContextHelper.validateElement(ContextHelper.java:122)
      at org.apache.pdfbox.preflight.PreflightDocument.validate(PreflightDocument.java:163)

      For this document, http://www.pdf-tools.com/ gives the error message :
      bad-fmt-95-m28154.pdf does not conform to PDF/A.

      Validating file "bad-fmt-95-m28154.pdf" for conformance level pdfa-1a
      Invalid content of XMP packet header attribute 'begin': ' '.
      The document does not conform to the requested standard.
      The document's meta data is either missing or inconsistent or corrupt.
      Done.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            tilman Tilman Hausherr
            ari-cdc Antoine Ribes
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment