Class XfdfImporter.Options

  • Enclosing class:
    XfdfImporter

    public static final class XfdfImporter.Options
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      Options()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      XfdfImporter.Options encryptOutput​(PdfEncryptor.Options options)  
      XfdfImporter.Options encryptOutput​(java.lang.String userPassword, java.lang.String ownerPassword)
      Encrypts the imported output with AES-256, the modern default.
      XfdfImporter.Options ids​(java.lang.String idsCsv)
      Restricts the import to the XFDF entries whose ID is in the given comma-separated list -- an annotation's own name attribute, or a field's fully-qualified name.
      XfdfImporter.Options optimizeOutput​(boolean optimizeOutput)
      Runs com.pd4ml.pdf.optimizer.PdfOptimizer (default settings: reachability cleanup plus duplicate-content merging) on the imported PDF before returning it.
      XfdfImporter.Options password​(java.lang.String password)
      Password to open the input PDF, if encrypted (user or owner password; empty/omitted tries an empty password).
      XfdfImporter.Options types​(java.lang.String typesCsv)
      Restricts the import to XFDF entries of the given type(s), a comma-separated list, e.g.
      XfdfImporter.Options updateIfExists​(boolean updateIfExists)
      When true, an <annots> entry whose name (PDF /NM) matches an annotation already in the PDF updates that annotation in place instead of adding a duplicate.
      • Methods inherited from class java.lang.Object

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

      • Options

        public Options()
    • Method Detail

      • password

        public XfdfImporter.Options password​(java.lang.String password)
        Password to open the input PDF, if encrypted (user or owner password; empty/omitted tries an empty password).
      • updateIfExists

        public XfdfImporter.Options updateIfExists​(boolean updateIfExists)
        When true, an <annots> entry whose name (PDF /NM) matches an annotation already in the PDF updates that annotation in place instead of adding a duplicate. Default false -- see this class's own documentation for the exact behavior either way.
      • types

        public XfdfImporter.Options types​(java.lang.String typesCsv)
        Restricts the import to XFDF entries of the given type(s), a comma-separated list, e.g. "square,circle,highlight" or "tx,btn". An <annots> entry matches by its XFDF element name (e.g. "freetext", "stamp"); a <field> entry matches by the PDF /FT code of the existing field it would update ("Tx", "Btn", "Ch" -- a Sig field is never touched regardless, see FieldMapper's class docs). Matching is case-insensitive. The two vocabularies don't overlap, so a single list naturally picks from both categories at once. An entry excluded this way is simply skipped -- for a field, that's not the same as a not-found name (see XfdfImporter.Result.getFieldsNotFound()), since the field does exist, it just wasn't selected for this import. Pass null (the default) for no type restriction.
      • ids

        public XfdfImporter.Options ids​(java.lang.String idsCsv)
        Restricts the import to the XFDF entries whose ID is in the given comma-separated list -- an annotation's own name attribute, or a field's fully-qualified name. Matching is exact and case-sensitive. Pass null (the default) for no ID restriction. Combines with types(String) as an intersection (an entry must satisfy both, when both are set).
      • optimizeOutput

        public XfdfImporter.Options optimizeOutput​(boolean optimizeOutput)
        Runs com.pd4ml.pdf.optimizer.PdfOptimizer (default settings: reachability cleanup plus duplicate-content merging) on the imported PDF before returning it. Default false. See this class's own documentation for how this interacts with encryptOutput(java.lang.String, java.lang.String).
      • encryptOutput

        public XfdfImporter.Options encryptOutput​(java.lang.String userPassword,
                                                  java.lang.String ownerPassword)
        Encrypts the imported output with AES-256, the modern default. For finer control use the PdfEncryptor.Options overload.