THPDFHeadlessDocument.SetRichTextFieldXHTMLWithFamilies method

procedure SetRichTextFieldXHTMLWithFamilies(FieldIndex: Integer;
  const XHTML: UnicodeString; const Families: THPDFHeadlessRichTextFontFamilies;
  const DecodeOptions: THPDFHeadlessRichTextDecodeOptions;
  const LayoutOptions: THPDFHeadlessRichLayoutOptions;
  const AppearanceOptions: THPDFHeadlessTextAppearanceOptions);

Decodes XHTML into a native layout tree and prepares the plain field value, original rich text and Widget appearances for a loaded text field

Families must contain at least one family; the first family becomes the decoder's default and supplies the regular font for the field transaction

FieldIndex identifies a loaded field; its existing text-field validation, permission and signature-policy requirements apply

Preparation

The method caps decoder node and code-unit limits against the document's object and glyph limits, and caps decoded image bytes against the document's decoded-byte limit

Each image URI is resolved against DecodeOptions.DocumentURI; resolved URIs must be nonempty and distinct, and the sum of resource bytes must fit LayoutOptions.MaxResourceBytes

The supplied XHTML must also fit the field object-byte budget

Password, file-select and comb fields are rejected

Cancellation and ownership

All non-nil cancellation tokens in the document, decode, layout and appearance options must identify the same token; the method propagates that token through preparation

The caller retains ownership of family font bytes, image resources and tokens; the method owns and frees the temporary decoded tree

Successful preparation changes the loaded document; call SaveToFile to publish the changes

See native rich text layout, THPDFHeadlessRichLayoutOptions and THPDFHeadlessDocument