ScaleRichview Page Number

ScaleRichView support and discussion (TRichView add-on for WYSIWYG editing)
Post Reply
pgkammath
Posts: 36
Joined: Fri Nov 24, 2017 6:16 am

ScaleRichview Page Number

Post by pgkammath »

The SRichViewEdit is generating the Page number by setting the PageProperty PageNoVisible to True (Default).
I want to print the number as 1/5, 2/5,..... like that. I looked at the examples
here , Trichview\TRichView\Demos\Delphi\Assorted\Printing\Printing

The OnpagePrepaint is seen from RvPrint but not for SrvPrint.
Not able to find the right one.
Please help.
Sergey Tkachenko
Site Admin
Posts: 17602
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Re: ScaleRichview Page Number

Post by Sergey Tkachenko »

The recommended way is using header of footer to insert "page number" and "page count" fields.
If you use RichViewActions, you can use TrvActionInsertPageNumber and TrvActionInsertPageCount commands (menu "Insert | Page Number" and "Insert | Page Count").
If you want to do it in code, insert TRVPageNumberItemInfo and TRVPageCountItemInfo (if you need a code sample, let me know).



If you want to draw on a page, use OnPaintPage event. See the demo <TRichView Dir>\ScaleRichView\Demos\Delphi\CustomDraw\Header and Footer\ ).
pgkammath
Posts: 36
Joined: Fri Nov 24, 2017 6:16 am

Re: ScaleRichview Page Number

Post by pgkammath »

Dear Sergey,
Thanks for the prompt reply. A Code sample for scalerichview would be much appreciated. I am using the header now. The Scalerichview prints the page number at the bottom of the page by default. An sample code to implement this in scalerichview will be very helpful.


I tried this,
nPageNo := TRVPageNumberItemInfo.Create(FinalData.RichViewEdit.RVData);
nPageCount := TRVPageCountItemInfo.Create(FinalData.RichViewEdit.RVData);


FinalData.Subdocuments[srvhftNormalHeader].AddItem('%d',[nPageNo],0,0);

I am confused about getting the PageCount in page of / pagecount

..
..
..
nPageNo.free
nPageCount.Free;

Thanks in advance.

Regards,
Post Reply