Appendix A: Supported HTML tags
The HTML renderer accepts a bounded subset for rich text, structured blocks, tables, and explicitly mapped images
Structure and inline formatting
<p>, <br> | Paragraphs and hard line breaks, including legacy paragraph alignment and spacing attributes |
|---|---|
<h1> through <h6> | Bold block headings with decreasing default sizes |
<div>, <section>, <article>, <header>, <footer>, <main> | Block containers |
<blockquote> | Indented block content |
<ul>, <ol>, <li> | Nested unordered and ordered lists |
<b>, <strong>, <i>, <em> | Bold and italic text |
<sup>, <sub>, <u> | Superscript, subscript, underline, double underline, strikeout, and overline |
<font>, <span> | Legacy font, color, background, outline, text rendering mode, and rounded background attributes |
<a href="..."> | HTTP, HTTPS, and file hyperlinks |
CSS cascade
Rules may appear in <style> elements or inline style attributes
Selectors support tag, class, ID, tag.class, and whitespace descendant combinations; unsupported attribute selectors, pseudo selectors, and sibling or child combinators are ignored
Matching declarations use CSS specificity and source order, inline declarations take priority, and !important is honored within the supported subset
Supported properties include the text, background, font, decoration, alignment, line-height, margin, padding, border, width, height, display and vertical-alignment properties listed below, plus the Flexbox, Grid and footnote properties in their respective sections
Lengths accept points, pixels at 0.75 points per pixel, em units, percentages, and unitless point values; font sizes also accept the standard keyword scale from xx-small through xx-large
Flexbox
display:flex and display:inline-flex support flex-direction, flex-wrap, flex, flex-grow, flex-shrink, flex-basis, justify-content, align-items, align-self, align-content, gap, row-gap and column-gap
Row containers distribute positive and negative free space per flex line, wrapped rows are measured independently, and column containers distribute an explicit or content-derived height
CSS Grid
display:grid and display:inline-grid support grid-template-columns, grid-template-rows, fixed, percentage and fr tracks, simple repeat() and minmax(), grid-column, grid-row, start and end properties, spans, gaps, row or column auto-placement, and per-item alignment
One container accepts at most 256 direct items and 64 rows or columns; nested content uses the same HTML renderer and layout cache
Footnotes
<footnote>, <aside style="float:footnote">, and <aside role="doc-footnote"> create numbered notes
Finite text boxes reserve the note area at the bottom before laying out later body lines; a reference and note that do not fit together continue to the next frame, and the continuation state preserves numbering
Tables
<table>, <tr>, <td>, and <th> render measured rows with backgrounds, padding, borders, text styles, and colspan up to 64 columns
Columns divide the explicit table width or available width equally, header cells default to bold text with a light background, and a row continues as one atomic unit in the next HTML text box
Nested tables, rowspan, border collapsing, and automatic content-driven column sizing are not part of this subset
Images
<img src="name"> draws an image previously bound with SetHTMLImage
The renderer supports width, height, margin, padding, border, background, and left, center, or right alignment; one missing dimension preserves the natural aspect ratio, and omitted dimensions use 0.75 points per source pixel
Image sources never trigger network or file access, measurement does not register resources, and repeated use reuses the bound image XObject
Bounds and recovery
One HTML input accepts at most 2048 stylesheet rules, 256 bytes per selector, 4096 bytes per declaration block, 4096 table rows, and 4096 table cells
Unknown properties, selectors, tags, and attributes are ignored while surrounding text is preserved; character references are decoded and malformed nesting is closed conservatively
Example
var
LogoID: Integer;
begin
LogoID := PDF.AddImageFromFile('logo.png');
PDF.SetHTMLImage('brand-logo', LogoID);
PDF.DrawHTMLTextBox(50, 750, 420, 180,
'<style>.report h2 { color:#204080; } table { border:1pt solid #808080; }</style>' +
'<section class="report"><h2>Quarterly report</h2>' +
'<img src="brand-logo" width="72pt">' +
'<table><tr><th>Region</th><th>Total</th></tr>' +
'<tr><td>North</td><td>125</td></tr></table></section>');
end;