Class FieldMapper
- java.lang.Object
-
- com.pd4ml.pdf.xfdf.internal.FieldMapper
-
public final class FieldMapper extends java.lang.ObjectMaps the/Root/AcroForm/Fieldstree to and from XFDF's flat<fields>list (ISO 19444-1 §6.3).XFDF field data is a name/value pair only -- it carries no widget geometry or appearance -- so import here only ever updates a field that already exists in the target PDF's field tree; a name with no match is simply reported back to the caller as not found (see
XfdfImporter), never used to fabricate a new field. A field's value still visibly renders correctly afterwards for a checkbox/radio button (its widget(s)'/ASis kept in sync with the new/Vhere); a text/choice field's value is not visually re-rendered until the next appearance-stream regeneration, same documented limitation asAnnotationMapper.Signature fields (
/FT /Sig) are skipped entirely in both directions -- a signature's value is a byte-range/certificate structure, not a value XFDF can represent, and touching one risks invalidating it.Both directions take a
SelectionFilter, checked against each field's/FTcode and fully-qualified name -- passSelectionFilter.NONEfor no restriction.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFieldMapper.ApplyResultapplyFields(com.pd4ml.pdf.cos.COSDocument, java.util.List<com.pd4ml.pdf.xfdf.XfdfField>, com.pd4ml.pdf.xfdf.internal.SelectionFilter)'s outcome: how many fields were actually updated, and which requested names had no match.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static FieldMapper.ApplyResultapplyFields(COSDocument document, java.util.List<XfdfField> fields, SelectionFilter filter)Applies every field infieldsthat matches an existing terminal field (by fully-qualified name) indocument's/AcroFormand passesfilter.static java.util.List<XfdfField>exportFields(COSDocument document, SelectionFilter filter)
-
-
-
Method Detail
-
exportFields
public static java.util.List<XfdfField> exportFields(COSDocument document, SelectionFilter filter)
-
applyFields
public static FieldMapper.ApplyResult applyFields(COSDocument document, java.util.List<XfdfField> fields, SelectionFilter filter)
Applies every field infieldsthat matches an existing terminal field (by fully-qualified name) indocument's/AcroFormand passesfilter. A field that matches but is excluded byfiltercounts as neither updated nor not-found -- it does exist, it just wasn't selected for this import.
-
-