function ImportXFDF(const FileName: string): Integer; overload;
function ImportXFDF(Stream: TStream): Integer; overload;
ImportXFDF parses the XFDF XML document and applies its
<fields> and <annots> sections to the
currently loaded PDF.
For each <field> element, the qualified (dotted)
name is matched against the widget annotations in the document and the
value is written into the field's /V entry. For checkbox and
radio-button fields, the supplied export value is used to select the
matching on-state appearance, so the field is rendered as checked.
명시적으로 비어 있는 <value>는 해당 field를 지우고, 생략된 값은 field를 그대로 둡니다. 깊이 중첩된 점 표기 field 이름은 전체 계층 구조를 유지합니다
For each annotation element, a new annotation is created on the page
indicated by the page attribute (0-based). After creation,
the importer fills in Contents, Author (title), Name (NM),
Subject, ModificationDate, CreationDate, Icon, and the annotation flags
from the corresponding XFDF attributes.
Returns the total number of fields and annotations processed.
Annotation 가져오기는 RGB 및 내부 색상을 적용하고, 명시적으로 비어 있는 텍스트 필드를 보존하며, 프로세스 locale과 무관하게 10진수 좌표를 해석하고, coords 속성에서 모든 markup 사변형을 복원합니다
스캐너는 namespace 접두사가 붙은 요소와 속성, 텍스트와 CDATA 노드가 혼합된 내용, XML entity 참조, 공백이 의미 있는 field 또는 annotation 내용을 처리합니다. 잘못된 숫자 Unicode scalar 참조는 XFDF 입력을 거부합니다
생략된 annotation contents 요소는 새 annotation의 내용을 부재 상태로 두고, 명시적으로 비어 있는 요소는 빈 값을 기록합니다
The rect attribute is mandatory for every annotation: if
it is missing, the annotation is skipped rather than created with a
zero-size rectangle.
Parsing is performed by a hand-written XML scanner rather than a full XML DOM, so ImportXFDF introduces no XML DOM dependency.
SaveAs afterwards.coords에서 복원되며, line 끝점, polygon/polyline 정점, ink list는 PDFium이 해당 number 배열에 대한 setter를 제공하지 않기 때문에 읽기 전용으로 유지됩니다
// Import field values and annotations from an .xfdf file
Imported := Pdf1.ImportXFDF('C:\Data\form.xfdf');
Pdf1.SaveAs('C:\Data\form_filled.pdf');