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

The native Grid and flex profile accepts flex-flow direction and wrapping keywords in either order, resets omitted components and applies the existing cascade independently to each expanded longhand; invalid shorthand leaves both prior valid values intact

Grid containers and items also accept the bare-keyword Grid place-* profile: align is the first component, justify is the second, and an omitted second value copies the first only after both Grid longhand values are valid; existing Flex alignment, field-state and transaction contracts are retained

Native table cells treat the supported vertical-align values top, middle and bottom as ASCII case-insensitive keywords; inline and stylesheet declarations retain their existing source-order and !important priority, and the original XHTML remains the field's rich-text value

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

Single-line comb fields with a positive inherited MaxLen and inline XHTML are supported; password, file-select, multiline comb and structured-layout 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