Built-In Paragraph Setting

<< Click to Display Table of Contents >>

Navigation:  Programming Techniques > RTF - Rich Text Format > Controlling RTF from VPE – ‘Easy RTF’ >

Built-In Paragraph Setting

Previous pageReturn to chapter overviewNext page

VPE has build-in a predefined paragraph setting. Note, as in RTF text the values for paragraph settings are in twips (= 1 / 1440 inch), all values for the properties and methods are specified in metric or inch units.

 

The properties and methods that can be accessed by code are:

FirstIndent

LeftIndent

RightIndent

SpaceBefore

SpaceAfter

SpaceBetween

DefaultTabSize

SetTab()

ClearTab()

ClearAllTabs()

ResetParagraph()

 

Build-In Paragraph Setting: RTF Auto Page Break

VPE processes the three most important RTF paragraph styles, to have the best control over the behavior when automatic page breaks occur. Auto Page Breaks only occur if VFREE is used for Y2 and if the property AutoBreakMode is set to AUTO_BREAK_ON or AUTO_BREAK_FULL.

 

KeepLines

Keep paragraph intact. A page break may not occur between the lines of a paragraph. Instead, the whole paragraph is moved to the next page. Note: Page breaks may occur between the lines of paragraphs, e.g. at their exact borders (see KeepNextPar). KeepLines, KeepNextPar and ParControl may be used together.

 

KeepNextParagraph

Keep paragraph with the next paragraph. A page break may not occur between the following paragraphs. This means, one paragraph may not stand alone at the top of a new page. Instead, the paragraphs are moved to the next page. Note: Page breaks may occur between the lines of paragraphs  (see KeepLines). KeepLines, KeepNextPar and ParControl may be used together.

 

ParagraphControl

Keep paragraph intact, a single line may not remain on the current page or on the next page. A page break may not occur for a following paragraph, if only the first line of the paragraph would remain on the current page, or if only the last line of the paragraph would be placed on the next page. Instead, the whole paragraph is moved to the next page.  KeepLines, KeepNextPar and ParControl may be used together.

 

NOTE: If a set of paragraphs is locked together in a way (for example by using KeepLines and KeepNextParagraph together), so that all paragraphs together don’t fit onto the current page and may not be broken, VPE checks, if it is possible to place them all together on the next page. (Remember that VPE offers the possibility to set the margins for the current page and a default output rectangle for succeeding pages.) If the succeeding page has enough room to place all paragraphs there, VPE will move them to the next page. Otherwise VPE will start to place as much paragraphs as possible onto the current page, trying to break them at a paragraph border if possible; but maybe there is only one large paragraph, which needs to be broken in between.

 

Example:

Imagine you have two paragraphs in a single RTF text. The margins of the current page and of the default output rectangle are set to a width of 18 cm and a height of  25 cm. The two paragraphs together need a height of 8 cm and you set KeepLines = True and KeepNextParagraph = True, so that they must not be broken.

If you insert this object at x = 1 and y = 2 nothing unusual happens: the size of the output rectangle is large enough to hold both paragraphs, and they are positioned there.

But if you insert this object at x = 1 and y = 25 an Auto Break will occur. As the paragraphs may not be broken, VPE checks, if there is enough room for both paragraphs on the next page. Due to our example, there is enough space, and VPE decides not to insert an RTF object on the current page. Instead VPE moves to the next page (or adds one) and places the RTF object containing both paragraphs there.