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

I need to check if there is a PDF file in PDF / A 1 or not using pdfbox or any other free library in java. I have searched a lot on Google in this regard, but still I couldn't get any code or technique to do this.

How can I check this in java.

+3


source to share


1 answer


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

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

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

  parser.parse();

      



in

 parser.parse(Format.PDF_A1A);

      

I was able to verify this by 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

+1


source







All Articles