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, WellTaggedPdfConformance wtpdfConformance)
      Creates a new PdfConformance instance based on PDF/A, PDF/UA and Well Tagged PDF conformance.
      Parameters:
      aConformance - the PDF/A conformance
      uaConformance - the PDF/UA conformance
      wtpdfConformance - the Well Tagged PDF conformance
    • PdfConformance

      public PdfConformance (PdfAConformance aConformance, PdfUAConformance uaConformance, List<WellTaggedPdfConformance> wtpdfConformanceList)
      Creates a new PdfConformance instance based on PDF/A, PDF/UA and Well Tagged PDF conformance.
      Parameters:
      aConformance - the PDF/A conformance
      uaConformance - the PDF/UA conformance
      wtpdfConformanceList - the Well Tagged PDF conformance
    • 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 (List<WellTaggedPdfConformance> wtpdfConformance)
      Creates a new PdfConformance instance based on only Well Tagged PDF conformance.
      Parameters:
      wtpdfConformance - the Well Tagged PDF conformance
    • PdfConformance

      public PdfConformance (WellTaggedPdfConformance wtpdfConformance)
      Creates a new PdfConformance instance based on only Well Tagged PDF conformance.
      Parameters:
      wtpdfConformance - the Well Tagged PDF conformance
    • PdfConformance

      public PdfConformance()
      Creates a new PdfConformance instance without any conformance.
  • Method Details

    • getConformance

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

      @Deprecated public static void setConformanceToXmp (XMPMeta xmpMeta, PdfConformance conformance) throws XMPException
      Deprecated.
      Use setConformanceToXmp(XMPMeta) method of PdfConformance instance instead.
      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 which fields should be set into XMP metadata.
      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
    • setConformanceToXmp

      public void setConformanceToXmp (XMPMeta xmpMeta) 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
      Throws:
      XMPException - if the file is not well-formed XML or if the parsing fails
    • 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
    • isWtpdf

      public boolean isWtpdf()
      Checks if any Well Tagged PDF conformance is specified.
      Returns:
      true if Well Tagged PDF conformance is specified, otherwise false
    • conformsToAny

      public boolean conformsToAny()
      Checks if any of PDF/A, PDF/UA or Well Tagged PDF conformance is specified
      Returns:
      true if PDF/A, PDF/UA or Well Tagged PDF 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.
    • getWtpdfConformances

      public List<WellTaggedPdfConformance> getWtpdfConformances()
      Gets the list of WellTaggedPdfConformance instances if specified.
      Returns:
      the list of specified WellTaggedPdfConformance instances or empty list.
    • conformsTo

      public boolean conformsTo (WellTaggedPdfConformance wtPdfConformance)
      Gets the WellTaggedPdfConformance instance if specified.
      Parameters:
      wtPdfConformance - the Well Tagged PDF conformance to check
      Returns:
      the specified WellTaggedPdfConformance instance or null.
    • conformsTo

      public boolean conformsTo (PdfUAConformance uaConformance)
      Checks if specified PDF/UA conformance is present in this PdfConformance instance.
      Parameters:
      uaConformance - the PDF/UA conformance to check
      Returns:
      true if specified PDF/UA conformance is present in this PdfConformance instance, otherwise
    • conformsTo

      public boolean conformsTo (PdfAConformance aConformance)
      Checks if specified PDF/A conformance is present in this PdfConformance instance.
      Parameters:
      aConformance - the PDF/A conformance to check
      Returns:
      true if specified PDF/A conformance is present in this PdfConformance instance, otherwise
    • conformsTo

      public boolean conformsTo (PdfConformance... conformanceList)
      Checks if any of specified conformance is present in this PdfConformance instance.
      Parameters:
      conformanceList - the conformances to check
      Returns:
      true if any of specified conformances is present in this PdfConformance instance, otherwise false
    • isPdfAOrUa

      @Deprecated public boolean isPdfAOrUa()
      Deprecated.
      Use conformsToAny() instead, which also checks for Well Tagged PDF conformance.
      Checks if any PDF/A or PDF/UA conformance is specified.
      Returns:
      true if PDF/A or PDF/UA conformance is specified, otherwise false
    • hashCode

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

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

      public String toString()
      Overrides:
      toString in class Object