FitTextBox

Text, Page layout

Description

Similar to the DrawText function, but the text size is adjusted to ensure that all the text fits into the available space.

Syntax

Delphi

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

ActiveX

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

DLL

int DLFitTextBox(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 The text to display in the box
Text
OptionsVertical alignment: 0 = Centered 1 = Top 2 = Bottom If 100 is added to these values long words will not be split up, the font size will be reduced until the longest word fits into the available width. If 1000 is addd to these values the font size will be allowed to increase until the text fills the available area.

Return values

0The Options specified were out of range
1The text was drawn successfully