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.