I'm trying to check the conformance (PDF/A-1B) of an existing PDF document with iText. Unfortunately it only checks the conformance for newly created elements in document but ignores existing parts of document.
byte[] pdf = ...; // pdf document which claims to be conform but is not conform (1 font is not embedded)
final PdfADocument pdfADocument = new PdfADocument(new PdfReader(new ByteArrayInputStream(pdf)),
new PdfWriter(new ByteArrayOutputStream()));
pdfADocument.close();
If I add something not conform to pdfADocument
then the call to close()
throws a PdfAConformanceException
.
I only find example about creating documents with PDF/A conformance but no example about just validating an existing document.
Is there a way to check conformance with iText 7 for an existing document?