| View previous topic :: View next topic |
| Author |
Message |
allanj42
Joined: 02 Mar 2009 Posts: 7 Location: Canada
|
Posted: Wed Mar 10, 2010 5:59 pm Post subject: How to insert automatic page number code into saved RTF |
|
|
When saving my document to RTF (using SaveRTF) how do I insert an RTF code to produce automatic page numbering? E.g. is there a code like {\pagenum} that I can insert into my RichTextEdit document before calling SaveRTF ? What other options or conditions need to be set for this to work?
Thanks,
Jeff Allan |
|
| Back to top |
|
 |
Sergey Tkachenko Site Admin
Joined: 27 Aug 2005 Posts: 6599
|
Posted: Wed Mar 10, 2010 6:30 pm Post subject: |
|
|
A page numbering field is not implemented yet, planned for future.
If you need to save page numbers in a header or footer of RTF file, you have 2 options:
1) If you want to insert a simple page number, you can use OnSaveRTFExtra event to save header and footer. The code for page number is {\field{\*\fldinst PAGE}{\fldrslt 1}}, the example is here:
http://www.trichview.com/forums/viewtopic.php?t=64 (the first post)
2) If you want to create a complex header or footer in separate editors (or if you use ScaleRichView where header and footer can be edited directly), you need to insert RTF code {\field{\*\fldinst PAGE}{\fldrslt 1}} in the editor. This topic shows two ways how to do it: http://www.trichview.com/forums/viewtopic.php?t=2742
In TSRichViewEdit, header and footer are saved automatically.
In TRichViewEdit, assign header and footer using rve.RTFReadProperties.SetHeader and .SetFooter, and include rvrtfSaveHeaderFooter in rve.RTFOptions. |
|
| Back to top |
|
 |
allanj42
Joined: 02 Mar 2009 Posts: 7 Location: Canada
|
Posted: Mon Mar 15, 2010 7:08 pm Post subject: Thanks |
|
|
Thank you Sergey for your prompt and thorough answer.
I used the rvteoRTFCode solution.
I have now purchased a developer license for RT, largely because of the support you offer through this forum.
Jeff Allan
WellSight Systems |
|
| Back to top |
|
 |
|