Page 1 of 1

Create index of document

Posted: Mon Oct 20, 2008 6:11 am
by prosoft
Is any chance to create index of RVF document witch page number marks where is inserted on top of RVF document? (like as MS WORD). I am using list styles with levels and i would like to use them for creating index of document.

Thaks. Josef.

Posted: Tue Oct 21, 2008 1:25 pm
by Sergey Tkachenko
This functionality is not supported.
I can explain how it's possible to implement it.
You need to build a table of contents/index yourself. To do it, you need to know page number where the specified item located.
If you want to insert TOC/index at the beginning, you must take into account that they will occupy one or more pages too, so you need to add this number of pages to get the resulting values.

So, you have some item and know its ItemNo (index in the document, from 0 to SRichViewEdit.RichViewEdit.ItemCount-1). How to get its page? Unfortunately, ScaleRichView does not have methods returing a page number by an ItemNo. But it has methods working with DrawItemNo (index of "drawing item"):

Code: Select all

// DrawItemNo --> page number
getRVPageNoEx(DrawItemNo : Integer): Integer
// Page number --> the first DrawItemNo on page
getPageStartDrawItemNo(PageNo : Integer) : Integer
You can convert ItemNo to DrawItemNo using
SRichViewEdit.RichViewEdit.RVData.Item2FirstDrawItem(ItemNo, DrawItemNo). Document must be formatted, otherwise this method fails.