| Category | HTML text measurement |
|---|
Purpose — Predict the total height pdfDrawHTMLText would occupy for HTML at Width/Size, without drawing.
Description — TotalHeight = lineCount × (Size × 1.2) — same fixed 1.2 line-height factor used throughout this SDK's text-flow code (compare pdfGetFTextHeight).
Declarations
C
double __stdcall pdfGetHTMLTextHeight(PPDF IPDF, double Width, double Size, const char* HTML);
double __stdcall pdfGetHTMLTextHeightA(PPDF IPDF, double Width, double Size, const char* HTML);
double __stdcall pdfGetHTMLTextHeightW(PPDF IPDF, double Width, double Size, const wchar_t* HTML);
Delphi
function pdfGetHTMLTextHeightA(const IPDF: PPDF; Width, Size: Double; HTML: PAnsiChar): Double; stdcall; external 'LumasPdf.dll';
function pdfGetHTMLTextHeightW(const IPDF: PPDF; Width, Size: Double; HTML: PWideChar): Double; stdcall; external 'LumasPdf.dll';
Parameters
| Parameter | Type | Description |
|---|---|---|
IPDF | PPDF | Instance handle. |
Width | Double | Wrap width to simulate; <= 0 disables wrapping. |
Size | Double | Font size; <= 0 defaults to 12. |
HTML | string | HTML-subset fragment. |
Return value — Predicted height in points; 0.0 on an invalid handle.
See also — pdfGetHTMLTextLineCount
C# (P/Invoke)
wrappers/dotnet/LumasPdf.cs
public static extern double pdfGetHTMLTextHeightW(IntPtr IPDF, double Width, double Size, IntPtr HTML);
public static extern double pdfGetHTMLTextHeight(IntPtr IPDF, double Width, double Size, IntPtr HTML);
public static extern double pdfGetHTMLTextHeightA(IntPtr IPDF, double Width, double Size, IntPtr HTML);
Area
Text
Category
Getters
Exported names
pdfGetHTMLTextHeightW
pdfGetHTMLTextHeight
pdfGetHTMLTextHeightA
String variants
The …A form takes UTF-8, …W
takes UTF-16; a bare name aliases the ANSI form.
See working code
Worked examples — complete programs in ten languages.