admin管理员组

文章数量:1278979

I can set the compliance values with these instructions:

PDFAIdentificationSchema id = xmp.createAndAddPDFAIdentificationSchema();
id.setPart(3);        
id.setConformance("B");

But I need to know how to get them with PDFBox.

I can set the compliance values with these instructions:

PDFAIdentificationSchema id = xmp.createAndAddPDFAIdentificationSchema();
id.setPart(3);        
id.setConformance("B");

But I need to know how to get them with PDFBox.

Share Improve this question edited Feb 24 at 4:08 Tilman Hausherr 18.9k8 gold badges65 silver badges105 bronze badges asked Feb 23 at 21:28 rampunsengrampunseng 112 bronze badges 2
  • Your question is unclear. Do you want to know how to get PDF-A-3b compliance (question title)? How to get the values (question body)? – Tilman Hausherr Commented Feb 24 at 4:11
  • I am using PDFBox 3.0.4 and I need to get the compliance level of a PDF document via PDFBox instructions. The example I have given shows how to set the compliance level but what I need is to get the compliance level of the document. – rampunseng Commented Feb 24 at 19:20
Add a comment  | 

1 Answer 1

Reset to default 1

This prints out the conformance level:

PDDocumentCatalog catalog = document.getDocumentCatalog();
PDMetadata meta = catalog.getMetadata();
DomXmpParser xmpParser = new DomXmpParser();
XMPMetadata metadata = xmpParser.parse(meta.toByteArray());
PDFAIdentificationSchema pdfaIdentificationSchema = metadata.getPDFAIdentificationSchema();
System.out.println(pdfaIdentificationSchema.getConformance() + pdfaIdentificationSchema.getPart());

Note that this doesn't mean the document is really conformant. For that, use a tool like VeraPDF.

本文标签: javaHow get PDFA compliance with PDFBoxStack Overflow