Class XfdfWriter


  • public final class XfdfWriter
    extends java.lang.Object
    Serializes an XfdfDocument to XFDF XML bytes (ISO 19444-1), hand-rolled the same way com.pd4ml.pdf.merge.internal.PdfConformance builds its XMP packets, rather than pulling in a DOM/serializer dependency for what is, structurally, a very small and fixed document shape.

    Fields are always written flat -- one <field name="fully.qualified.name"> per leaf, dot-joining every ancestor -- rather than as a nested hierarchy of <field> elements; both are valid XFDF and XfdfReader accepts either, but the flat form is simpler to generate correctly and is what the majority of real-world producers emit.

    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static byte[] write​(XfdfDocument document)
      Serializes document to a complete, well-formed XFDF file's bytes (UTF-8, with the standard <?xml?> declaration and xmlns="http://ns.adobe.com/xfdf/" root).
      • Methods inherited from class java.lang.Object

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

      • write

        public static byte[] write​(XfdfDocument document)
        Serializes document to a complete, well-formed XFDF file's bytes (UTF-8, with the standard <?xml?> declaration and xmlns="http://ns.adobe.com/xfdf/" root). An empty document (no fields, no annotations) still produces a valid, minimal <xfdf/>-rooted file, not an error.