DrawHTMLText

Text, HTML text, Page layout

Description

Draws HTML and the supported CSS subset onto the page

See Appendix A for supported tags, selectors, properties, tables, and mapped images

Syntax

Delphi

Function TPDFlib.DrawHTMLText(Left, Top, Width: Double; Const HTMLText: WideString): Integer;

ActiveX

Function PDFlib::DrawHTMLText(Left As Double, Top As Double, Width As Double, HTMLText As String) As Long

DLL

int DLDrawHTMLText(int InstanceID, double Left, double Top, double Width, const wchar_t* HTMLText);
int DLDrawHTMLTextA(int InstanceID, double Left, double Top, double Width, const char* HTMLText);

Parameters

LeftThe left edge of the area to draw the text into
TopThe top edge of the area to draw the text into
WidthThe width of the area to draw the text into
HTMLTextThe HTML text to draw

Return values

Returns 1 when the text has been drawn; an empty HTMLText also returns 1. Returns 0 when Width is not positive or the import was rejected; inspect LastErrorCode for the reason.

Remarks

Supported entities are decoded once: & draws an ampersand, while < draws the literal text < Escaped angle brackets remain text through layout normalization

CSS print profile

HTML layouts support bounded attribute selectors and right-margin-aware wrapping; inspect GetLastHTMLImportDiagnostics for ignored CSS, font-source and processing-limit findings, including cached measurements

Use DrawHTMLPages to apply page size and margins; ordinary text frames diagnose @page rules without resizing the document

A font set explicitly registered by the caller can be referenced by @font-face src: url("registered-key") or local("registered-key"); registration is the only source of font bytes and these declarations do not fetch files or network resources