Class PdfConformance

java.lang.Object
com.itextpdf.kernel.pdf.PdfConformance

public class PdfConformance extends Object
The class represents possible PDF document conformance.
  • Field Details

  • Constructor Details

    • PdfConformance

      public PdfConformance (PdfAConformance aConformance, PdfUAConformance uaConformance)
      Creates a new PdfConformance instance based on PDF/A and PDF/UA conformance.
      Parameters:
      aConformance - the PDF/A conformance
      uaConformance - the PDF/UA conformance
    • PdfConformance

      public PdfConformance (PdfAConformance aConformance)
      Creates a new PdfConformance instance based on only PDF/A conformance.
      Parameters:
      aConformance - the PDF/A conformance
    • PdfConformance

      public PdfConformance (PdfUAConformance uaConformance)
      Creates a new PdfConformance instance based on only PDF/UA conformance.
      Parameters:
      uaConformance - the PDF/UA conformance
    • PdfConformance

      public PdfConformance()
      Creates a new PdfConformance instance without PDF/A or PDF/UA conformance.
  • Method Details

    • isPdfA

      public boolean isPdfA()
      Checks if any PDF/A conformance is specified.
      Returns:
      true if PDF/A conformance is specified, otherwise false
    • isPdfUA

      public boolean isPdfUA()
      Checks if any PDF/UA conformance is specified.
      Returns:
      true if PDF/UA conformance is specified, otherwise false
    • isPdfAOrUa

      public boolean isPdfAOrUa()
      Checks if any PDF/A or PDF/UA conformance is specified.
      Returns:
      true if PDF/A or PDF/UA conformance is specified, otherwise false
    • getAConformance

      public PdfAConformance getAConformance()
      Gets the PdfAConformance instance if specified.
      Returns:
      the specified PdfAConformance instance or null.
    • getUAConformance

      public PdfUAConformance getUAConformance()
      Gets the PdfUAConformance instance if specified.
      Returns:
      the specified PdfUAConformance instance or null.
    • equals

      public boolean equals (Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • getConformance

      public static PdfConformance getConformance (XMPMeta meta)
      Gets PdfConformance instance from XMPMeta.
      Parameters:
      meta - the meta data to parse
      Returns:
      the PdfConformance instance
    • setConformanceToXmp

      public static void setConformanceToXmp (XMPMeta xmpMeta, PdfConformance conformance) throws XMPException
      Sets required fields into XMP metadata according to passed PDF conformance.
      Parameters:
      xmpMeta - the xmp metadata to which required PDF conformance fields will be set
      conformance - the PDF conformance according to which XMP will be updated
      Throws:
      XMPException - if the file is not well-formed XML or if the parsing fails
    • getAConformance

      public static PdfAConformance getAConformance (String part, String level)
      Gets an instance of PdfAConformance based on passed part and level.
      Parameters:
      part - the part of PDF/A conformance
      level - the level of PDF/A conformance
      Returns:
      the PdfAConformance instance or null if there is no PDF/A conformance for passed parameters