DrawHTMLTextBox

Text, HTML text, Page layout

Description

Similar to the DrawHTMLText function, but the text drawn is limited to a specific area. The remaining HTML text is returned, which can be passed to this function again (perhaps on a different page or location) until the function returns an empty string. See Appendix A for details of the supported HTML tags

Syntax

Delphi

Function TPDFlib.DrawHTMLTextBox(Left, Top, Width, Height: Double; Const HTMLText: WideString): WideString;

ActiveX

Function PDFlib::DrawHTMLTextBox(Left As Double, Top As Double, Width As Double, Height As Double, HTMLText As String) As String

DLL

const wchar_t* DLDrawHTMLTextBox(int InstanceID, double Left, double Top, double Width, double Height, const wchar_t* HTMLText);
const char* DLDrawHTMLTextBoxA(int InstanceID, double Left, double Top, double Width, double Height, const char* HTMLText);

Parameters

LeftHorizontal co-ordinate of the left edge of the drawing area
TopVertical co-ordinate of the top edge of the drawing area
WidthThe width of the drawing area
HeightThe height of the drawing area
HTMLTextThe HTML text to draw

Return values

LeftOverTextHTML containing the text that did not fit into the text box; pass it to another text box, often on the next page

Layout support

Flexbox and CSS Grid containers are measured within the box and participate in cached layout replay

Footnotes declared with <footnote> or <aside style="float:footnote"> reserve a separated area at the frame bottom; a note that cannot fit with its reference is returned in LeftOverText

Remarks

Returned HTML preserves literal entity spellings and escaped angle brackets when passed to another text box

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

Continuation strings retain box geometry, styles and portable resource-keyed font references so flows can resume across separate library instances registering the same keys; corrupt stacks or missing named font families are rejected explicitly