trichview.com Forum Index trichview.com
TRichView support forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to insert automatic page number code into saved RTF

 
Post new topic   Reply to topic    trichview.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
allanj42



Joined: 02 Mar 2009
Posts: 7
Location: Canada

PostPosted: Wed Mar 10, 2010 5:59 pm    Post subject: How to insert automatic page number code into saved RTF Reply with quote

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
View user's profile Send private message
Sergey Tkachenko
Site Admin


Joined: 27 Aug 2005
Posts: 6599

PostPosted: Wed Mar 10, 2010 6:30 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
allanj42



Joined: 02 Mar 2009
Posts: 7
Location: Canada

PostPosted: Mon Mar 15, 2010 7:08 pm    Post subject: Thanks Reply with quote

Thank you Sergey for your prompt and thorough answer. Very Happy
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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    trichview.com Forum Index -> Support All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group