PDFPAGE_TextOutBox
IPDFDocument3 :: PDF page methods

See Also Example
Collapse All

This method draws wrapped text bounded by a rectangle.

Syntax

LONG PDFPAGE_TextOutBox (
DOUBLE x,
DOUBLE y,
DOUBLE interval,
DOUBLE boxWidth,
DOUBLE boxHeight,
BSTR text
)
Parameters
x
X coordinate of the starting text position

y
Y coordinate of the starting text position

interval
Space between text lines when wrapped

boxWidth
Width of the bounding rectangle

boxHeight
Height of the bounding rectangle

text
Text to be displayed

Return value
The number of characters that were successfully drawn in the "box".

Remarks

This method draws an ASCII Text_Line starting from an (x, y) point using the current font inside an rectangle area, with (boxWidth, boxHeight) as the rectangle size and an interval parameter between lines when wrapped.

Equivalent in new interface: IPDFDocument4::ShowTextLines.

Example

Drawing a Wrapped Text in a Box

Delphi
[copy to clipboard]
{ PDF object is supposed to be created }
PDF.BeginDoc;
PDF.PDFPAGE_SetActiveFont('Helvetica', false, false, false, false, 12.0, 0);
PDF.PDFPAGE_Rectangle(100, 100, 230, 130);
PDF.PDFPAGE_Stroke;
cnt := PDF.PDFPAGE_TextOutBox(100, 100, 14, 130, 60, 'Here is long text in the box.');
{ cnt = 29 }
PDF.EndDoc;
C/C++
[copy to clipboard]
// PDF object is supposed to be created
PDF->BeginDoc();
PDF->PDFPAGE_SetActiveFont "Helvetica", FALSE, FALSE, FALSE, FALSE, 12.0, 0);
PDF->PDFPAGE_Rectangle(100, 100, 230, 130);
PDF->PDFPAGE_Stroke();
LONG cnt = PDF->PDFPAGE_TextOutBox(100, 100, 14, 130, 60, "Here is long text in the box.");
// cnt == 29
PDF->EndDoc();
C#
[copy to clipboard]
// PDF object is supposed to be created
PDF.BeginDoc();
PDF.PDFPAGE_SetActiveFont "Helvetica", false, false, false, false, 12.0, 0);
PDF.PDFPAGE_Rectangle(100, 100, 230, 130);
PDF.PDFPAGE_Stroke();
long cnt = PDF.PDFPAGE_TextOutBox(100, 100, 14, 130, 60, "Here is long text in the box.");
// cnt == 29
PDF.EndDoc();
Visual Basic
[copy to clipboard]
' PDF object is supposed to be created
PDF.BeginDoc
PDF.PDFPAGE_SetActiveFont "Helvetica", False, False, False, False, 12.0, 0
PDF.PDFPAGE_Rectangle 100, 100, 230, 130
PDF.PDFPAGE_Stroke
cnt = PDF.PDFPAGE_TextOutBox(100, 100, 14, 130, 60, "Here is long text in the box.")
' cnt = 29
PDF.EndDoc

See Also

Reference