Class PdfA12Validator

java.lang.Object
org.projecthusky.validation.service.pdf.PdfA12Validator

@ThreadSafe public class PdfA12Validator extends Object
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
    Constructor
    Description
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    org.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
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • 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 a String.
      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 an InputStream. 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.