PDFium Delphi Component Docs

ExportXFDF yöntemi

Component: TPdf  ·  Unit: PDFium
Tüm alan ve açıklama değerlerini UTF-8 XML olarak XFDF (ISO 19444-1) belgesine serileştirir

Syntax

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

Description

ExportXFDF walks every page of the loaded document and produces an ISO 19444-1 conformant XFDF document rooted in the http://ns.adobe.com/xfdf/ namespace. The output consists of a <fields> section and an <annots> section, both emitted as UTF-8 XML.

For form fields, the method enumerates the widget annotations of every page, reads each field value, and writes a <field> element. Hierarchical (qualified) field names are split on the dot separator and emitted as nested <field> elements so that the parent/child structure round-trips. Checkboxes and radio buttons export their export value (the appearance-state name that represents the on state) as the field value. Signature fields are listed but their value is never exported.

Değer varlığı bayrakları, açıkça boş bırakılmış bir alan değerini atlanmış bir değerden ayırır; iki seviyeden daha derin yuvalanmış alanlar da buna dahildir

For annotations, every non-widget, non-popup annotation on every page is serialized. The exporter recognizes 18 /Subtype values: text, highlight, underline, strikeout, squiggly, line, circle, square, caret, polygon, polyline, stamp, ink, freetext, fileattachment, sound, link, and redact. Each is written as an element under <annots> carrying its page index, bounding rectangle, contents, title (author), name (NM), subject, modification and creation dates, flags, and color.

Encoding conventions follow ISO 19444-1: colors are written as #RRGGBB hex strings; coordinate lists (rectangle, line endpoints, polygon/polyline vertices, ink lists) are comma-separated numbers; and annotation flags are emitted as a comma-separated list of flag names rather than a raw bitmask.

Çok satırlı işaretleme açıklamaları için coords özniteliği, yalnızca ilk satır yerine belge sırasındaki tüm dörtgenleri içerir

Açıklama içeriği aynı varlık semantiğini kullanır; bu nedenle açıkça boş bir contents öğesi dışa aktarımda varlığını korur ve mevcut olmayan bir öğe boş bir öğeye dönüştürülmez

PDFium itself exposes no XFDF API. ExportXFDF is implemented entirely in Pascal by PDFium Delphi Component on top of its own annotation and form-field data model, querying PDFium only for the per-annotation attribute values.

Returns the number of UTF-8 bytes written. The Stream overload accepts a TStream to write into; the FileName overload accepts a file path and creates/truncates that file. ExportXFDFToStream is an alias for the Stream overload.

Remarks

Example

// Export all fields and annotations to an .xfdf file
BytesWritten := Pdf1.ExportXFDF('C:\Data\form.xfdf');

// Or to a stream
var
  Stream: TFileStream;
begin
  Stream := TFileStream.Create('C:\Data\form.xfdf', fmCreate);
  try
    Pdf1.ExportXFDF(Stream);
  finally
    Stream.Free;
  end;
end;

See Also

ImportXFDF, Annotation, AnnotationCount, FormFieldInfo