API referenceText

pdfGetHTMLTextLineCount

Predict the number of lines pdfDrawHTMLText would produce.

CategoryHTML text measurement

Purpose — Predict the number of lines pdfDrawHTMLText would produce.

Declarations

C
int32_t __stdcall pdfGetHTMLTextLineCount(PPDF IPDF, double Width, double Size, const char* HTML);
int32_t __stdcall pdfGetHTMLTextLineCountA(PPDF IPDF, double Width, double Size, const char* HTML);
int32_t __stdcall pdfGetHTMLTextLineCountW(PPDF IPDF, double Width, double Size, const wchar_t* HTML);
Delphi
function pdfGetHTMLTextLineCountA(const IPDF: PPDF; Width, Size: Double; HTML: PAnsiChar): Integer; stdcall; external 'LumasPdf.dll';
function pdfGetHTMLTextLineCountW(const IPDF: PPDF; Width, Size: Double; HTML: PWideChar): Integer; stdcall; external 'LumasPdf.dll';

Parameters

ParameterTypeDescription
IPDFPPDFInstance handle.
WidthDoubleWrap width to simulate.
SizeDoubleFont size.
HTMLstringHTML-subset fragment.

Return value — Line count; 0 on an invalid handle.

See alsopdfGetHTMLTextHeight

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern int pdfGetHTMLTextLineCountW(IntPtr IPDF, double Width, double Size, IntPtr HTML);
public static extern int pdfGetHTMLTextLineCount(IntPtr IPDF, double Width, double Size, IntPtr HTML);
public static extern int pdfGetHTMLTextLineCountA(IntPtr IPDF, double Width, double Size, IntPtr HTML);
Area
Text
Category

Getters

Exported names

pdfGetHTMLTextLineCountW pdfGetHTMLTextLineCount pdfGetHTMLTextLineCountA

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.