HPDFDecodeHeadlessRichText
function HPDFDecodeHeadlessRichText(const XHTML: UnicodeString;
const Options: THPDFHeadlessRichTextDecodeOptions): THPDFHeadlessRichTextRuns;
Decodes an XHTML body into ordered, independently owned native rich-text runs without loading a PDF or changing any document
Mixed text before, inside and after nested spans retains its exact Unicode order; comments are skipped, CDATA and character references become text, paragraphs keep their breaks, and br becomes a carriage return
The supported style profile maps font-size, color, font-weight, font-style, font-family, text-decoration, text-align, line-height and letter/word spacing to the existing native run properties; the last valid declaration at the highest importance wins independently for each property
Relative em and percentage sizes use the enclosing element's computed font size, so repeated declarations do not compound within one element; explicit inherit brings back the enclosing property even after a semantic b, i or u tag default
Trailing !important takes priority over ordinary declarations; whitespace and CSS comments may separate its tokens, and later valid important declarations override earlier important declarations
CSS comments and quoted or parenthesised values preserve declaration boundaries; invalid values and unsupported properties do not erase an earlier valid declaration or discard text
Font sizes accept points, pixels at 96 dpi, em, percentages, inches, centimetres, millimetres and picas; colours accept hexadecimal RGB, numeric or percentage rgb components, and the sixteen standard CSS colour names
Bold and italic select the caller-provided style font programs when these runs are subsequently painted; configured font-family declarations select actual supplied named families without loading external fonts
Unknown or invalid CSS declarations preserve the text and remaining valid styles; import layers and supports conditions, additional state pseudo classes and explicit scoping roots, lists, tables, images, vertical alignment and general CSS layout remain active work
Bounded font shorthand applies independently cascaded font size, weight, italic and supplied-family components, including resets and explicit inheritance
Internal style sheets cascade type/class/ID and attribute selectors, all four combinators, structural and positional pseudo classes, complex not/is/where lists, anchored has relations, filtered nth-child lists and Unicode identifier escapes before actual text consumption
The static selector profile matches :scope at the rich-text root and accepts hover, active and focus pseudo classes with no matching interaction state. Negation, logical lists, relative selectors and support queries use those same semantics
Media queries condition internal styles using explicit print/screen host capabilities, bounded range expressions and nested Boolean conditions
An XHTML namespace is required; optional XML 1.0 declarations, qualified namespace prefixes, predefined entities and scalar character references are supported
Malformed XML or Unicode and exhausted bounds raise EHPDFHeadlessRichTextCodecError; cancellation surfaces as EHPDFOperationCancelled
Limits and default style · Real form-data import
External style sheets use explicit caller resources and take part in the same native cascade
Finite CSS numeric math adds calc, min, max and clamp, root-relative and explicit viewport lengths, with final-font computation for line and spacing metrics and actual saved appearances
Native support queries admit @supports groups and supports() imports using the supported declaration and selector profile, with shared bounds and cancellation recovery