Components for Developers
© 2000-2012, Two Pilots

PDF Library Download Features Manual Tutorials FAQ Pricing HTML2PDF-X Pilot History In the Lab

PDF Creator Pilot documentation

Download CHM version of this manual.
PDF page methods
PDFPAGE_Arc
PDFPAGE_Arc2
PDFPAGE_ArcTo
PDFPAGE_BeginText
PDFPAGE_CanvasCurrentPointX
PDFPAGE_CanvasCurrentPointY
PDFPAGE_CanvasOver
PDFPAGE_Circle
PDFPAGE_Clip
PDFPAGE_ClosePath
PDFPAGE_Comment
PDFPAGE_Concat
PDFPAGE_CurrentTextPositionX
PDFPAGE_CurrentTextPositionY
PDFPAGE_CurveTo
PDFPAGE_DrawWatermark
PDFPAGE_Ellipse
PDFPAGE_EndText
PDFPAGE_EoClip
PDFPAGE_EoFill
PDFPAGE_EoFillAndStroke
PDFPAGE_Fill
PDFPAGE_FillAndStroke
PDFPAGE_GetColorSpace
PDFPAGE_GetColorSpaceType
PDFPAGE_GetTextHeight
PDFPAGE_GetTextWidth
PDFPAGE_GetUnicodeTextHeight
PDFPAGE_GetUnicodeTextWidth
PDFPAGE_GStateRestore
PDFPAGE_GStateSave
PDFPAGE_Height
PDFPAGE_InPath
PDFPAGE_LineTo
PDFPAGE_MoveTo
PDFPAGE_NewPath
PDFPAGE_NoDash
PDFPAGE_Orientation
PDFPAGE_PageRotate
PDFPAGE_Pie
PDFPAGE_Pie2
PDFPAGE_PlayMetaFile
PDFPAGE_PlayMetaFileEx
PDFPAGE_PlayMetaFileExFromFileName
PDFPAGE_PlayMetaFileFromFileName
PDFPAGE_Rectangle
PDFPAGE_RectRotated
PDFPAGE_Resolution
PDFPAGE_Rotate
PDFPAGE_RotateText
PDFPAGE_RoundRect
PDFPAGE_Scale
PDFPAGE_SetActiveFont
PDFPAGE_SetCharacterSpacing
PDFPAGE_SetCMYKColor
PDFPAGE_SetCMYKColorFill
PDFPAGE_SetCMYKColorStroke
PDFPAGE_SetColor
PDFPAGE_SetColorFill
PDFPAGE_SetColorSpace
PDFPAGE_SetColorStroke
PDFPAGE_SetDash
PDFPAGE_SetDefaultCMYKColorSpace
PDFPAGE_SetDefaultGrayColorSpace
PDFPAGE_SetDefaultRGBColorSpace
PDFPAGE_SetFlat
PDFPAGE_SetGray
PDFPAGE_SetGrayFill
PDFPAGE_SetGrayStroke
PDFPAGE_SetHorizontalScaling
PDFPAGE_SetLineCap
PDFPAGE_SetLineJoin
PDFPAGE_SetLineWidth
PDFPAGE_SetLinkToPage
PDFPAGE_SetMiterLimit
PDFPAGE_SetPixel
PDFPAGE_SetRGBColor
PDFPAGE_SetRGBColorFill
PDFPAGE_SetRGBColorStroke
PDFPAGE_SetTextPosition
PDFPAGE_SetTextRenderingMode
PDFPAGE_SetTextRise
PDFPAGE_SetURL
PDFPAGE_SetWordSpacing
PDFPAGE_ShowImage
PDFPAGE_Size
PDFPAGE_SkewText
PDFPAGE_Stroke
PDFPAGE_TextBox
PDFPAGE_TextInitiated
PDFPAGE_TextOut
PDFPAGE_TextOutBox
PDFPAGE_TextOutBox2
PDFPAGE_TextShow
PDFPAGE_Thumbnail
PDFPAGE_Translate
PDFPAGE_UnicodeTextBox
PDFPAGE_UnicodeTextOut
PDFPAGE_UnicodeTextOutBox
PDFPAGE_UnicodeTextOutBox2
PDFPAGE_UnicodeTextShow
PDFPAGE_Watermark
PDFPAGE_Width
Collapse All

This method draws wrapped text bounded by a rectangle. It also allows the text to be justified.

Syntax

LONG PDFPAGE_TextOutBox2 (
DOUBLE x,
DOUBLE y,
DOUBLE boxWidth,
DOUBLE boxHeight,
TxHorJust horizontalJustification,
TxVertJust verticalJustification,
BSTR contents
)
Parameters
x
X coordinate of the top-lef corner of the bounding rectangle

y
Y coordinate of the top-lef corner of the bounding rectangle

boxWidth
Width of the bounding rectangle

boxHeight
Height of the bounding rectangle

horizontalJustification
Horizontal justification

verticalJustification
Vertical justification

contents
Text to be displayed

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

Remarks

This method draws a text line inside the bounding rectangle with left-top corner at (left, top), box size of (boxWidth, boxHeight), and with the horizontal and vertical justifications specified.

Equivalent in new interface: IPDFDocument4::ShowTextLines.

Example

Drawing Wrapped and Justified 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, 240, 140);
PDF.PDFPAGE_Stroke;
long cnt = PDF.PDFPAGE_TextOutBox2(100, 100, 140, 40, 0, 0,'Here is long text in the box.');

PDF.PDFPAGE_Rectangle(100, 150, 240, 190);
PDF.PDFPAGE_Stroke;
cnt = PDF.PDFPAGE_TextOutBox2(100, 150, 140, 40, 1, 1, 'Here is long text in the box.');

PDF.PDFPAGE_Rectangle(100, 200, 240, 240);
PDF.PDFPAGE_Stroke;
cnt = PDF.PDFPAGE_TextOutBox2(100, 200, 140, 40, 2, 2, 'Here is long text in the box.');

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, 240, 140);
PDF->PDFPAGE_Stroke();
LONG cnt = PDF->PDFPAGE_TextOutBox2(100, 100, 140, 40, 0, 0, "Here is long text in the box.");

PDF->PDFPAGE_Rectangle(100, 150, 240, 190);
PDF->PDFPAGE_Stroke();
cnt = PDF->PDFPAGE_TextOutBox2(100, 150, 140, 40, 1, 1, "Here is long text in the box.");

PDF->PDFPAGE_Rectangle(100, 200, 240, 240);
PDF->PDFPAGE_Stroke();
cnt = PDF->PDFPAGE_TextOutBox2(100, 200, 140, 40, 2, 2, "Here is long text in the box.");

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, 240, 140);
PDF.PDFPAGE_Stroke();
long cnt = PDF.PDFPAGE_TextOutBox2(100, 100, 140, 40, 0, 0, "Here is long text in the box.");

PDF.PDFPAGE_Rectangle(100, 150, 240, 190);
PDF.PDFPAGE_Stroke();
cnt = PDF.PDFPAGE_TextOutBox2(100, 150, 140, 40, 1, 1, "Here is long text in the box.");

PDF.PDFPAGE_Rectangle(100, 200, 240, 240);
PDF.PDFPAGE_Stroke();
cnt = PDF.PDFPAGE_TextOutBox2(100, 200, 140, 40, 2, 2, "Here is long text in the box.");

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, 240, 140
PDF.PDFPAGE_Stroke
cnt = PDF.PDFPAGE_TextOutBox2(100, 100, 140, 40, 0, 0, "Here is long text in the box.")

PDF.PDFPAGE_Rectangle 100, 150, 240, 190
PDF.PDFPAGE_Stroke
cnt = PDF.PDFPAGE_TextOutBox2(100, 150, 140, 40, 1, 1, "Here is long text in the box.")

PDF.PDFPAGE_Rectangle 100, 200, 240, 240
PDF.PDFPAGE_Stroke
cnt = PDF.PDFPAGE_TextOutBox2(100, 200, 140, 40, 2, 2, "Here is long text in the box.")

PDF.EndDoc

See Also

PDF Library Download Features Manual Tutorials FAQ Pricing HTML2PDF-X Pilot History In the Lab

 

 

PDF Library | Virtual Printer | Converters to PDF

Support | Blog | Forum | Contacts

© 2000-2012, Two Pilots