DrawTextBox

文本, 页面布局

描述

此函数与 DrawText 函数类似,但文本放置在指定的边界框内。垂直对齐可通过 Options 参数设置,水平对齐可用 SetTextAlign 函数设置,文本会自动换行以适配边界框

语法

Delphi

Function TPDFlib.DrawTextBox(Left, Top, Width, Height: Double; Const Text: WideString; Options: Integer): Integer;

ActiveX

Function PDFlib::DrawTextBox(Left As Double, Top As Double, Width As Double, Height As Double, Text As String, Options As Long) As Long

DLL

int DLDrawTextBox(int InstanceID, double Left, double Top, double Width, double Height, const wchar_t * Text, int Options);

参数

Left边界框左边缘的水平坐标
Top边界框顶边的垂直坐标
Width边界框的宽度
Height边界框的高度
Text要在页面上绘制的文本
Options0 = 居中垂直对齐 1 = 顶部垂直对齐 2 = 底部垂直对齐 3 = 居中垂直对齐,不换行 4 = 顶部垂直对齐,不换行 5 = 底部垂直对齐,不换行

返回值

0Options 参数超出范围,或 Width 参数过小而无法容纳任何文本
Non-zero实际绘制的文本行数