Package com.pd4ml.pdf.xfdf
Class XfdfImporter.Options
- java.lang.Object
-
- com.pd4ml.pdf.xfdf.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.OptionsencryptOutput(PdfEncryptor.Options options)XfdfImporter.OptionsencryptOutput(java.lang.String userPassword, java.lang.String ownerPassword)Encrypts the imported output with AES-256, the modern default.XfdfImporter.Optionsids(java.lang.String idsCsv)Restricts the import to the XFDF entries whose ID is in the given comma-separated list -- an annotation's ownnameattribute, or a field's fully-qualifiedname.XfdfImporter.OptionsoptimizeOutput(boolean optimizeOutput)Runscom.pd4ml.pdf.optimizer.PdfOptimizer(default settings: reachability cleanup plus duplicate-content merging) on the imported PDF before returning it.XfdfImporter.Optionspassword(java.lang.String password)Password to open the input PDF, if encrypted (user or owner password; empty/omitted tries an empty password).XfdfImporter.Optionstypes(java.lang.String typesCsv)Restricts the import to XFDF entries of the given type(s), a comma-separated list, e.g.XfdfImporter.OptionsupdateIfExists(boolean updateIfExists)Whentrue, an<annots>entry whosename(PDF/NM) matches an annotation already in the PDF updates that annotation in place instead of adding a duplicate.
-
-
-
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)
Whentrue, an<annots>entry whosename(PDF/NM) matches an annotation already in the PDF updates that annotation in place instead of adding a duplicate. Defaultfalse-- 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/FTcode of the existing field it would update ("Tx","Btn","Ch"-- aSigfield is never touched regardless, seeFieldMapper'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 (seeXfdfImporter.Result.getFieldsNotFound()), since the field does exist, it just wasn't selected for this import. Passnull(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 ownnameattribute, or a field's fully-qualifiedname. Matching is exact and case-sensitive. Passnull(the default) for no ID restriction. Combines withtypes(String)as an intersection (an entry must satisfy both, when both are set).
-
optimizeOutput
public XfdfImporter.Options optimizeOutput(boolean optimizeOutput)
Runscom.pd4ml.pdf.optimizer.PdfOptimizer(default settings: reachability cleanup plus duplicate-content merging) on the imported PDF before returning it. Defaultfalse. See this class's own documentation for how this interacts withencryptOutput(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 thePdfEncryptor.Optionsoverload.
-
encryptOutput
public XfdfImporter.Options encryptOutput(PdfEncryptor.Options options)
-
-