A number of functions in PDFlibPas accept a small HTML subset for inline rich-text formatting — for example DrawHTMLText, DrawHTMLTextBox, and the various rich-text annotation and table cell setters that mark their text argument as HTML. This appendix lists every tag and attribute that those parsers recognise. Tags or attributes outside this list are stripped silently; the surrounding text is preserved.
Block-level structure
<br>
Hard line break.
<p align="left">
Left-aligned paragraph (default).
<p align="center">
Centre-aligned paragraph.
<p align="right">
Right-aligned paragraph.
<p align="justified">
Fully justified paragraph.
<ul>, <ol>, <li>
Unordered (bullet) and ordered (numbered) lists. <ul> and <ol> may be nested.
Sets text appearance for the enclosed text. size accepts either a standard HTML size (1–7) or a point size (11.5pt). outlinewidth must be a point value (1.5pt). mode selects the text rendering mode (fill, stroke, fill+stroke, invisible, etc.). background draws a coloured rectangle behind the text; roundback="yes" rounds the corners of that rectangle.
<span background="" roundback="yes/no">
Background rectangle around the enclosed text, without changing the font.
Hyperlinks
<a href="http://...">
Web hyperlink (HTTP).
<a href="https://...">
Web hyperlink (HTTPS).
<a href="file://...">
Link to a local file.
Colour notation
RGB colours are written in standard HTML hexadecimal notation prefixed with #, for example #3A498C. CMYK colours are written as eight hexadecimal digits without the leading #, for example 5C238F02. Both notations are accepted anywhere a colour value is expected (color, background, outlinecolor).
Notes
The parser is permissive: unknown tags and attributes are silently dropped, but their inner text content is kept. Mis-nested tags (for example <b><i>…</b></i>) are closed in opening order to keep output valid. Character references such as &, <, >, and numeric forms (&#xNN;) are decoded.
Example
// Drawing a paragraph with mixed formatting in a table cell
var
CellHTML: WideString;
begin
CellHTML :=
'<p align="center">' +
'<font size="14pt" color="#003366">'+
'<b>Annual Report 2026</b>' +
'</font><br>' +
'<font size="9pt" color="#777777">'+
'<i>Confidential — <a href="https://example.com/legal">legal terms</a></i>'+
'</font>' +
'</p>';
PDF.DrawHTMLTextBox(50, 750, 400, 60, CellHTML);
end;