GetHTMLTextWidth

文本、HTML 文本

描述

返回在最大宽度下换行的 HTML 文本块的实际水平尺寸

由 DrawHTMLText 函数确定的宽度。有关受支持 HTML 标签的详细信息,请参阅附录 A

语法

Delphi

Function TPDFlib.GetHTMLTextWidth(MaxWidth: Double; Const HTMLText: WideString): Double;

ActiveX

Function PDFlib::GetHTMLTextWidth(MaxWidth As Double, HTMLText As String) As Double

DLL

double DLGetHTMLTextWidth(int InstanceID, double MaxWidth, const wchar_t* HTMLText);
double DLGetHTMLTextWidthA(int InstanceID, double MaxWidth, const char* HTMLText);

参数

MaxWidth文本将被绘制到的区域宽度
HTMLText要确定宽度的 HTML 文本

返回值

返回 HTML 文本按 MaxWidth 换行后的实际水平宽度,按文档当前度量单位表示。MaxWidth 不为正数或 HTMLText 为空时返回 0。