Class PdfADocument

java.lang.Object
com.itextpdf.kernel.pdf.PdfDocument
com.itextpdf.pdfa.PdfADocument
All Implemented Interfaces:
Closeable, AutoCloseable

public class PdfADocument extends PdfDocument
This class extends PdfDocument and is in charge of creating files that comply with the PDF/A standard.

Client code is still responsible for making sure the file is actually PDF/A compliant: multiple steps must be undertaken (depending on the PdfConformance) to ensure that the PDF/A standard is followed.

This class will throw exceptions, mostly PdfAConformanceException, and thus refuse to output a PDF/A file if at any point the document does not adhere to the PDF/A guidelines specified by the PdfConformance.

  • Constructor Details

    • PdfADocument

      public PdfADocument (PdfWriter writer, PdfAConformance aConformance, PdfOutputIntent outputIntent)
      Constructs a new PdfADocument for writing purposes, i.e. from scratch. A PDF/A file has a conformance, and must have an explicit output intent.
      Parameters:
      writer - the PdfWriter object to write to
      aConformance - the generation and strictness level of the PDF/A that must be followed.
      outputIntent - a PdfOutputIntent
    • PdfADocument

      public PdfADocument (PdfWriter writer, PdfAConformance aConformance, PdfOutputIntent outputIntent, DocumentProperties properties)
      Constructs a new PdfADocument for writing purposes, i.e. from scratch. A PDF/A file has a conformance, and must have an explicit output intent.
      Parameters:
      writer - the PdfWriter object to write to
      aConformance - the generation and strictness level of the PDF/A that must be followed.
      outputIntent - a PdfOutputIntent
      properties - a DocumentProperties
    • PdfADocument

      public PdfADocument (PdfReader reader, PdfWriter writer)
      Opens a PDF/A document in the stamping mode.
      Parameters:
      reader - PDF reader.
      writer - PDF writer.
    • PdfADocument

      public PdfADocument (PdfReader reader, PdfWriter writer, StampingProperties properties)
      Opens a PDF/A document in stamping mode.
      Parameters:
      reader - PDF reader.
      writer - PDF writer.
      properties - properties of the stamping process
  • Method Details

    • getCorrectCheckerFromConformance

      public static PdfAChecker getCorrectCheckerFromConformance (PdfAConformance aConformance)
      Gets correct PdfAChecker for specified PDF/A conformance.
      Parameters:
      aConformance - the conformance for which checker is needed
      Returns:
      the correct PDF/A checker