Class XfdfReader


  • public final class XfdfReader
    extends java.lang.Object
    Parses an XFDF document (ISO 19444-1) into an XfdfDocument. The XML itself may come from an arbitrary, untrusted source (an XFDF file handed to an import pipeline is no more trustworthy than the PDF it targets), so parsing is namespace-aware and hardened against XXE/entity-expansion the same way com.pd4ml.pdf.merge.internal.PdfConformance hardens its own XMP parsing.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static XfdfDocument read​(byte[] xfdfBytes)
      Parses a complete XFDF document's bytes into an XfdfDocument.
      • Methods inherited from class java.lang.Object

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

      • read

        public static XfdfDocument read​(byte[] xfdfBytes)
                                 throws XfdfException
        Parses a complete XFDF document's bytes into an XfdfDocument. Unrecognized top-level elements (some producers add their own, e.g. PDFTron's <pages>/<pdf-info>) and unrecognized annotation attributes/child elements are silently ignored rather than rejected -- only a root element other than <xfdf> fails outright.
        Throws:
        XfdfException - if xfdfBytes isn't well-formed XML, or its root element isn't <xfdf>