I am using PDFBOX Preflight to validate pdf document to check whether it is in PDF/A-1b format or not . It works perfectly on java 1.7 but when I run the code in java 1.8 i get following errors
2.4.3 : Invalid Color space, DestOutputProfile is missing
2.4.3 : Invalid Color space, DestOutputProfile is missing
2.4.3 : Invalid Color space, DestOutputProfile is missing
7.11 : Error on MetaData
I am using pdfbox 1.8.8 and preflight 1.8.3
Following is the code that I am using for validating the PDFs doing this.
ValidationResult result = null;
FileDataSource fd = new FileDataSource(InputFolder
+ listOfFiles[i].getName());
PreflightParser parser = new PreflightParser(fd);
try {
parser.parse(Format.PDF_A1A);
PreflightDocument documentt = parser
.getPreflightDocument();
documentt.validate();
result = documentt.getResult();
documentt.close();
} catch (SyntaxValidationException e) {
result = e.getResult();
}
if (result.isValid()) {
System.out
.println("The file is a valid PDF/A-1a file");
} else {
System.out.println("The file is not valid, error(s) :");
for (ValidationError error : result
.getErrorsList()) {
message = error.getErrorCode() + " : "
+ error.getDetails();
fos.write(message.getBytes());
fos.write(System.getProperty(
"line.separator").getBytes());
// System.out.println(error.getErrorCode() +
// " : " + error.getDetails());
}
}
Is PDFBOX not compatible with java 1.8 or am I doing something wrong ?