WriteRTF

<< Click to Display Table of Contents >>

Navigation:  RTF Functions >

WriteRTF

Previous pageReturn to chapter overviewNext page

Outputs RTF text within a rectangle at position Left, Top with the right border at Right and the bottom border at Bottom.

The pen is invisible.

method VpeCoord VPE.WriteRTF(

VpeCoord Left,

VpeCoord Top,

VpeCoord Right,

VpeCoord Bottom,

string Text

)

VpeCoord Left, Top, Right, Bottom

position and dimensions

string Text

the string to output

Returns:

the bottom y-coordinate generated by the output

Remarks:

VFREE: only the Bottom coordinate may be set to VFREE, not the Right coordinate.

In case of an error, LastError is set.

 

VPE offers several methods to attach an object's position to margins and relative to the position of previously inserted objects. In addition Text, Rich Text and Picture objects are able to compute their dimensions automatically depending on their visual content.
For details please see "Dynamic Positioning" in the Programmer's Manual.

Example:

ActiveX / VCL:

Doc.SetFont("Arial", 12)

Doc.WriteRTF(1, 1, -5, VFREE, "Hello \b World!")

Doc.SetFont("Times New Roman", 16)

Doc.TextUnderline = True

Doc.WriteRTF(VLEFT, VBOTTOM, VRIGHT, VFREE, "Hello \b World!")

 

.NET:

Doc.SetFont("Arial", 12)

Doc.WriteRTF(1, 1, -5, Doc.nFree, "Hello \b World!")

Doc.SetFont("Times New Roman", 16)

Doc.TextUnderline = True

Doc.WriteRTF(Doc.nLeft, Doc.nBottom, Doc.nRight, Doc.nFree, "Hello \b World!")

Produces the following output:

Hello World!

Hello World!

 

See also:

"RTF - Rich Text Format" in the Programmer's Manual