sameer singh
sameer singh

Reputation: 169

Checking if a PDF is PDF/A 1-a format or not using PDFBOX in java

I have to check if a pdf file is in PDF/A 1-a format or not using pdfbox or any other free library in java . I have searched a lot on google in this regard but still i couldnt get any code or technique for doing this.

How can I check this in java .

Upvotes: 5

Views: 8056

Answers (1)

Mark Lybarger
Mark Lybarger

Reputation: 463

The document from pdfbox shows how to do PDF/A-1b validation:

https://pdfbox.apache.org/cookbook/pdfavalidation.html

to do pdf/a-1a validation, you simply change :

  parser.parse();

to:

 parser.parse(Format.PDF_A1A);

I was able to ascertain this from reading the parser source code located here:

http://grepcode.com/file/repo1.maven.org/maven2/org.apache.pdfbox/preflight/1.8.2/org/apache/pdfbox/preflight/parser/PreflightParser.java

Upvotes: 6

Related Questions