int32_t __stdcall pdfDrawHTMLBoxA(PPDF IPDF, double PosX, double PosY, double Width, double Height, double Size, int32_t Align, const char* HTML);
int32_t __stdcall pdfDrawHTMLBoxW(PPDF IPDF, double PosX, double PosY, double Width, double Height, double Size, int32_t Align, const wchar_t* HTML);
The same entry points are also exported under the alias names pdfDrawHTMLTextBox / pdfDrawHTMLTextBoxA / pdfDrawHTMLTextBoxW (compatibility spelling); both names call the identical implementation.
function pdfDrawHTMLBoxA(const IPDF: PPDF; PosX, PosY, Width, Height, Size: Double; Align: Integer; HTML: PAnsiChar): Integer; stdcall;
function pdfDrawHTMLBoxW(const IPDF: PPDF; PosX, PosY, Width, Height, Size: Double; Align: Integer; HTML: PWideChar): Integer; stdcall;
Purpose. Draw HTML markup (the same limited tag subset as pdfDrawHTMLText, HTML Text, Arc Text & Callout Conversion) clipped to a fixed-height box, painting from the box's top edge downward.
Description. A source comment explicitly clarifies the coordinate convention: "paint from the TOP of the box (PosY = top edge); clip to Height" — matching pdfDrawHTMLText's box variant rather than the bottom-origin convention used by most other page-drawing primitives in this SDK. A transcodes through the system default codepage before delegating to W.
Parameters.
| Parameter | Description |
|---|---|
IPDF | Document handle. |
PosX, PosY | PosY is the box's top edge, not bottom. |
Width, Height | Box size; content is clipped to Height. |
Size | Base font size. |
Align | Horizontal alignment. |
HTML | Markup string. |
Return value. The number of lines rendered; -1 if IPDF is invalid or layout failed.
See also. pdfDrawHTMLText.
C# (P/Invoke)
public static extern int pdfDrawHTMLBoxW(IntPtr IPDF, double PosX, double PosY, double Width, double Height, double Size, int Align, IntPtr HTML);
public static extern int pdfDrawHTMLBox(IntPtr IPDF, double PosX, double PosY, double Width, double Height, double Size, int Align, IntPtr HTML);
public static extern int pdfDrawHTMLBoxA(IntPtr IPDF, double PosX, double PosY, double Width, double Height, double Size, int Align, IntPtr HTML);
public static extern int pdfDrawHTMLTextBoxW(IntPtr IPDF, double PosX, double PosY, double Width, double Height, double Size, int Align, IntPtr HTML);
public static extern int pdfDrawHTMLTextBox(IntPtr IPDF, double PosX, double PosY, double Width, double Height, double Size, int Align, IntPtr HTML);
public static extern int pdfDrawHTMLTextBoxA(IntPtr IPDF, double PosX, double PosY, double Width, double Height, double Size, int Align, IntPtr HTML);
Vector Graphics
pdfDrawHTMLBoxW
pdfDrawHTMLBox
pdfDrawHTMLBoxA
pdfDrawHTMLTextBoxW
pdfDrawHTMLTextBox
pdfDrawHTMLTextBoxA
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
Worked examples — complete programs in ten languages.