RTF Demo Source Code

<< Click to Display Table of Contents >>

Navigation:  Programming Techniques > RTF - Rich Text Format >

RTF Demo Source Code

Previous pageReturn to chapter overviewNext page

The following short program reads the file dmodocXx.rtf and generates a multi-page output.

OpenDoc

Rem Set the page borders for the current and all following pages

Rem to exactly the same values, the original document has

nLeftMargin = 2.54

nTopMargin = 2.50

nRightMargin = 19.10

nBottomMargin = 27.20

Rem Specify the setting of the current page also for all

Rem succeeding pages, which are generated by Auto Break

SetDefOutRectSP(2.54, 2.50, 19.10, 27.20)

WriteRTFFile(VLEFTMARGIN, VTOPMARGIN, VRIGHTMARGIN, VFREE, "dmodoc32.rtf")

Preview

 

Note, how fast and accurate VPE works:

While the hourglass is shown, VPE parses the RTF file and compiles its internal data structures. The next short pause - until the preview is shown - is the time, VPE needs to render the whole document onto its virtual ultra-high resolution device and to compute the page breaks. In this short time, the demo generates a 72 page document!