trichview.com

trichview.support




Re: Save RTF with Header/Footer


Return to index


Author

Message

Sergey Tkachenko

Posted: 09/13/2004 20:45:23


Using OnSaveRTFExtra, but you need to provide RTF code for them.

It's simple if you need to save plain text header:



procedure TForm3.RichViewEdit1SaveRTFExtra(Sender: TCustomRichView;

  Area: TRVRTFSaveArea; Obj: TObject; Index1, Index2: Integer;

  InStyleSheet: Boolean; var RTFCode: String);

begin

  if Area=rv_rtfs_Doc then

    RTFCode :=

     '{\header\pard\plain\posxc THIS IS HEADER WITH PAGENUMBER:

{\field{\*\fldinst PAGE}{\fldrslt 1}}\par}'+

     '{\footer\pard\plain\posxr THIS IS FOOTER\par}';

end;


In this example:

\posxc - keyword for aligning header/footer to center

\posxr - keyword for aligning header/footer to right

{\field{\*\fldinst PAGE}{\fldrslt 1}} - code for inserting page number







>

> Is it possible to save an RTF File with Header/Footer Informations ?





Powered by ABC Amber Outlook Express Converter