PDFium Delphi Component Docs

ImportXFDF 메서드

컴포넌트: TPdf  ·  유닛: PDFium
XFDF(ISO 19444-1) 문서를 읽고 양식 필드 값과 주석을 로드된 PDF에 적용하며 일치하는 페이지에 주석을 만들고 widget 주석에 필드 값을 기록합니다

Syntax

function ImportXFDF(const FileName: string): Integer; overload;
function ImportXFDF(Stream: TStream): Integer; overload;

Description

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.

Remarks

Example

// Import field values and annotations from an .xfdf file
Imported := Pdf1.ImportXFDF('C:\Data\form.xfdf');
Pdf1.SaveAs('C:\Data\form_filled.pdf');

See Also

ExportXFDF, CreateAnnotation, Annotation, FormFieldInfo