trichview.com

trichview.support




Re: Page Numbers


Return to index


Author

Message

Sergey Tkachenko

Posted: 12/18/2004 22:37:09


Hello,


You can determine a number of pages and the index of the current page only

after the document is formatted for printing (TRVPrint.FormatPages is

called). And on any change in the document this page formatting information

becomes invalid.

I am afraid it's not possible to display a number of pages and the current

page in the status bar, because it would require updating page information

on each change. Of course, you can call RVPrint.FormatPages in

RichViewEdit.OnChange, but it would be very slow.


However, printing the current page is possible. After calling

RVPrint.FormatPages, you can use RVPrint.GetFirstItemOnPage and compare it

with RichViewEdit.CurItemNo and OffsetInCurItem.

It's more tricky if your application uses tables, but I can explain how to

get a number of the current page in this case, if you need.


> Hello All,

>

> I need to display the RichView total pages / page number on the status

> bar of my app. In addition, I want to be able to print the current page.

>   I haven't seen anything about this in the docs. The only way I've been

> able to come up with is to create a non-visible instance of the RichView

> component and use it to format and print a page once I have figured out

> which page is current. I guess it could be done by counting up the page

> break items and looking for the one nearest to the visible text. Anyway,

> it seems like a big hack. Could anyone suggest a better approach?

>

> Thanks,

> Gerry





Powered by ABC Amber Outlook Express Converter