ShowTextLines
IPDFDocument4 :: Page Operations :: Text

See Also Example
Collapse All

This method draws wrapped text bounded by a rectangle.

Syntax

LONG ShowTextLines (
FLOAT left,
FLOAT top,
FLOAT right,
FLOAT bottom,
FLOAT interval,
TextAlign align,
VerticalAlign verticalAlign,
BSTR text
)
Parameters
left
X coordinate of the top-left corner of the bounding rectangle

top
Y coordinate of the top-left corner of the bounding rectangle

right
X coordinate of the bottom-right corner of the bounding rectangle

bottom
Y coordinate of the bottom-right corner of the bounding rectangle

interval
Space between text lines when wrapped. If it is negative ( < 0 ), then the default interval will be used.

align
Horizontal alignment

verticalAlign
Vertical alignment

text
Text string to be displayed

Return value
The number of characters shown.

Remarks

This method draws an ASCII text line inside the bounding rectangle with left-top and right-bottom corners, with the specified horizontal and vertical justifications, and with the interval value.

Example

Drawing Wrapped Text in a Box

Delphi
[copy to clipboard]
{ PDF object is supposed to be created }
PDF.DrawRectangle(100, 100, 60, 30, 0);
PDF.Stroke;
lines := PDF.ShowTextLines(100, 100, 160, 130, 10, taCenter, vaCenter, 'Here is long text in the box.');
PDF.SaveToFile('test.pdf', true);
C/C++
[copy to clipboard]
// PDF object is supposed to be created
PDF->DrawRectangle(100, 100, 60, 30, 0);
PDF->Stroke();
long lines = PDF->ShowTextLines(100, 100, 160, 130, 10, taCenter, vaCenter, "Here is long text in the box.");
PDF->SaveToFile("test.pdf", true);
C#
[copy to clipboard]
// PDF object is supposed to be created
PDF.DrawRectangle(100, 100, 60, 30, 0);
PDF.Stroke();
long lines = PDF.ShowTextLines(100, 100, 160, 130, 10, TextAlign.taCenter, VerticalAlign.vaCenter, "Here is long text in the box.");
PDF.SaveToFile("test.pdf", true);
Visual Basic
[copy to clipboard]
' PDF object is supposed to be created
PDF.DrawRectangle 100, 100, 60, 30, 0
PDF.Stroke
lines = PDF.ShowTextLines(100, 100, 160, 130, 10, 1, 1, "Here is long text in the box.") 'TextAlign.taCenter VerticalAlign.vaCenter
PDF.SaveToFile "test.pdf", true

See Also

Reference