Class PdfConformance


  • public final class PdfConformance
    extends java.lang.Object
    Detects a source document's own self-declared PDF/A or PDF/UA conformance (the pdfaid/pdfuaid identification schema in its XMP /Metadata, ISO 19005 / ISO 14289), and builds the equivalent XMP for a merged output whose sources all agree.

    This is a propagation of what the sources already claim about themselves, not an independent re-validation of the merged result -- com.pd4ml.pdf.merge has no general PDF/A/PDF/UA validator built in. A source's claim is trusted at face value; the merge logic's own job is simply to not silently drop or contradict it when every source agrees.

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  PdfConformance.Level
      One conformance identification: part is always present; conformance/revision may be null (PDF/UA has neither).
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static byte[] buildXmpPacket​(PdfConformance.Level pdfA, PdfConformance.Level pdfUa, java.lang.String title)
      Builds a fresh, minimal XMP packet declaring the given conformance level(s) (either may be null to omit that schema) and, if given, a dc:title, following the exact pdfaid/pdfuaid schema com.pd4ml.pdf.builder itself emits elsewhere in this project.
      static PdfConformance.Level detectPdfA​(COSDocument document)
      The document's own declared PDF/A identification, or null if it doesn't declare one (or none is parseable).
      static PdfConformance.Level detectPdfUa​(COSDocument document)
      The document's own declared PDF/UA identification, or null if it doesn't declare one (or none is parseable).
      static java.lang.String detectTitle​(COSDocument document)
      The document's own dc:title (Dublin Core, from its XMP /Metadata), falling back to the plain /Info dictionary's /Title when the XMP doesn't carry one (or there's no XMP at all) -- or null if neither does.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • detectPdfA

        public static PdfConformance.Level detectPdfA​(COSDocument document)
        The document's own declared PDF/A identification, or null if it doesn't declare one (or none is parseable).
      • detectPdfUa

        public static PdfConformance.Level detectPdfUa​(COSDocument document)
        The document's own declared PDF/UA identification, or null if it doesn't declare one (or none is parseable).
      • detectTitle

        public static java.lang.String detectTitle​(COSDocument document)
        The document's own dc:title (Dublin Core, from its XMP /Metadata), falling back to the plain /Info dictionary's /Title when the XMP doesn't carry one (or there's no XMP at all) -- or null if neither does. PDF/UA (ISO 14289-1 §7.1) requires a document's own XMP to declare a title whenever it declares PDF/UA conformance at all; a synthesized/merged document's XMP has neither unless something upstream is consulted for it.
      • buildXmpPacket

        public static byte[] buildXmpPacket​(PdfConformance.Level pdfA,
                                            PdfConformance.Level pdfUa,
                                            java.lang.String title)
        Builds a fresh, minimal XMP packet declaring the given conformance level(s) (either may be null to omit that schema) and, if given, a dc:title, following the exact pdfaid/pdfuaid schema com.pd4ml.pdf.builder itself emits elsewhere in this project.