Debenu Quick PDF logo

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 TDebenuPDFLibrary1811.FitTextBox(Left, Top, Width, Height: Double; 
  Text: WideString; Options: Integer): Integer;

ActiveX

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

DLL

int DPLFitTextBox(int InstanceID, double Left, double Top, double Width,
  double Height, wchar_t * Text, int Options)

Parameters

Left The horizontal co-ordinate of the left edge of the bounding box
Top The vertical co-ordinate of the top edge of the bounding box
Width The width of the bounding box
Height The height of the bounding box
Text The text to display in the box
Options Vertical 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 added to these values the font size will be allowed to increase until the text fills the available area, respecting the font boundaries
If 2000 is added to these values the font size will be allowed to increase until the text fills the available area, respecting the font ascend
If 3000 is added to these values the font size will be allowed to increase until the text fills the available area, respecting the font descend
If 4000 is added to these values the font size will be allowed to increase until the text fills the available area, respecting the font intepunction symbols

Return values

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

Copyright © 2020 Debenu. All rights reserved. AboutContactBlogNewsletterSupport