DrawTextBox

Text, Page layout

Description

This function is similar to the DrawText function, but the text is placed within the bounding box specified. The vertical alignment can be set using the Options parameter, and the horizontal alignment can be set with the SetTextAlign function. The text will be word-wrapped to fit inside the bounding box.

Syntax

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, wchar_t * Text, int Options);

Parameters

LeftThe horizontal co-ordinate of the left edge of the bounding box
TopThe vertical co-ordinate of the top edge of the bounding box
WidthThe width of the bounding box
HeightThe height of the bounding box
TextThe text to draw on the page
Options0 = Center vertical alignment 1 = Top vertical alignment 2 = Bottom vertical alignment 3 = Center vertical alignment, no wrapping 4 = Top vertical alignment, no wrapping 5 = Bottom vertical alignment, no wrapping

Return values

0The Options parameter was out of range, or the Width parameter was too small to contain any text
Non-zeroThe number of lines of text actually drawn