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

Corrupted XMP causes java.lang.StringIndexOutOfBoundsException

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.11, 1.8.12, 2.0.0
    • Fix Version/s: 1.8.12, 2.0.0
    • Component/s: XmpBox
    • Labels:
      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

            People

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

              Dates

              • Created:
                Updated:
                Resolved: