Page Number Items in TRichView Documents

<< Click to display table of contents >>

Page Number Items in TRichView Documents

When inserted in TRichView or TRichViewEdit, this item is displayed as '{p}'.

When printing with TRVPrint, this item displays a page number where this item is located. Page numbers are counted from TRVPrint.PageNoFromNumber.

When drawing with TRVReportHelper, the default behavior is like in TRVPrint, but you can provide a value for the page number in OnGetPageNumber event.

srv_icon ScaleRichView: When inserted in TSRichViewEdit, this item displays a page number where this item is located. Page numbers are counted from TSRichViewEdit.PageProperty.PageNoFromNumber.

You can insert this item in the main document, a note, a text box, a header or a footer.

Class for this item type is TRVPageNumberItemInfo  (see for detailed information).

Style of this item type: rvsPageNumber (-208)

Methods of TCustomRichView

The following viewer-style method adds item of this type to the end of the document:

AddItem (create TRVPageNumberItemInfo object, add it using AddItem)

The following method returns TRVPageNumberItemInfo object

GetItem

Methods of TCustomRichViewEdit

The following editor-style method inserts item of this type at the position of caret:

InsertItem (create TRVPageNumberItemInfo object, insert it using InsertItem)

The following method returns TRVPageNumberItemInfo object at the position of caret:

GetCurrentItem.

The following methods change properties of items as editing operations:

SetCurrentItemExtraIntPropertyEx;

SetItemExtraIntPropertyExEd;

SetCurrentItemExtraStrPropertyEx;

SetItemExtraStrPropertyExEd.

Properties

Fields have all properties of label items.

By default, Text='{p}'. You can change this value to display another code in TRichView and TRichViewEdit.

Additionally, it has property:

NumberType – numbering type;

This property is also accessible as rveipcPageNumberType property. Accessing it in this way allows changing it in editing operations.

Saving and Loading

Export to HTML

Fields are saved as a plain text.

RTF and DocX

Fields can saved to RTF/DocX and loaded from RTF/DocX. You can disallow loading from RTF/DocX by assigning TRichView.RTFReadProperties.IgnoreFields=True.