Class PdfA12Validator
java.lang.Object
org.projecthusky.validation.service.pdf.PdfA12Validator
Validator of PDF documents to conformance level A-1 and A-2.
In the CH-EPR project, CDA-CH-EMED and CH-EMED, PDFs must conform to the level A-1 or A-2.
The following PDF levels are passing:
- PDF/A-1b – PDF 1.4 – Level B (basic) conformance
- PDF/A-1a – PDF 1.4 – Level A (accessible) conformance
- PDF/A-2b – PDF 1.7 – Level B (basic) conformance
- PDF/A-2a – PDF 1.7 – Level A (accessible) conformance
- PDF/A-2u – PDF 1.7 – Level U (unicode) conformance
The VeraPDF parser and validator seem to be thread safe as of version 1.12, see
is veraPDF Processor API thread safe:
this means that one can safely use the the API in multiple parallel threads assuming that each thread
processes a single PDF document at a time
.
- Author:
- Quentin Ligier
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.verapdf.pdfa.results.ValidationResult
validate
(byte[] pdf) Validates that a PDF conforms to the PDF/A-1 or PDF/A-2 levels.org.verapdf.pdfa.results.ValidationResult
validate
(InputStream pdf) Validates that a PDF conforms to the PDF/A-1 or PDF/A-2 levels.org.verapdf.pdfa.results.ValidationResult
Validates that a PDF conforms to the PDF/A-1 or PDF/A-2 levels.
-
Constructor Details
-
PdfA12Validator
public PdfA12Validator()Constructor.
-
-
Method Details
-
validate
public org.verapdf.pdfa.results.ValidationResult validate(String pdf) throws IOException, org.verapdf.core.ValidationException Validates that a PDF conforms to the PDF/A-1 or PDF/A-2 levels.- Parameters:
pdf
- The PDF content as aString
.- Returns:
- the validation result.
- Throws:
IOException
- if the parser or validator cannot be closed.org.verapdf.core.ValidationException
- if the validator encounters an issue.
-
validate
public org.verapdf.pdfa.results.ValidationResult validate(byte[] pdf) throws IOException, org.verapdf.core.ValidationException Validates that a PDF conforms to the PDF/A-1 or PDF/A-2 levels.- Parameters:
pdf
- The PDF content as a byte array. The document shall not be password protected.- Returns:
- the validation result.
- Throws:
IOException
- if the parser or validator cannot be closed.org.verapdf.core.ValidationException
- if the validator encounters an issue.
-
validate
public org.verapdf.pdfa.results.ValidationResult validate(InputStream pdf) throws IOException, org.verapdf.core.ValidationException Validates that a PDF conforms to the PDF/A-1 or PDF/A-2 levels.- Parameters:
pdf
- The PDF content as anInputStream
. The document shall not be password protected.- Returns:
- the validation result.
- Throws:
IOException
- if the parser or validator cannot be closed.org.verapdf.core.ValidationException
- if the validator encounters an issue.
-