Page 1 of 1

LoadRTF deletes the header

Posted: Wed May 07, 2014 8:50 am
by starhu
Hello,

I use this:
SRichViewEdit1.RichViewEdit.LoadRTF( 'e:\MyRtf.rtf');

SRichViewEdit1.RichViewEdit.Format;

The big problem is that this deletes the whole header (picture and text all).

How can I avoid this?

Thank you very much!

Posted: Thu May 08, 2014 4:35 am
by Sergey Tkachenko
Yes, SRichViewEdit1.RichViewEdit.LoadRTF replaces existing header to header from RTF.
Workaround:

Code: Select all

SRichViewEdit1.RichViewEdit.RTFReadProperties.SetHeader(nil);
SRichViewEdit1.RichViewEdit.RTFReadProperties.SetFooter(nil);
To restore normal settings, call

Code: Select all

SRichViewEdit1.RichViewEdit.RTFReadProperties.SetHeader(SRichViewEdit1.RVHeader.RVData);
SRichViewEdit1.RichViewEdit.RTFReadProperties.SetFooter(SRichViewEdit1.RVFooter.RVData);

Posted: Fri May 09, 2014 9:02 am
by starhu
Thank you for your help!

Posted: Fri May 09, 2014 9:14 am
by Sergey Tkachenko
Please note that we plan to change headers and footers in ScaleRichView in the next update.

Currently, there is only one header and one footer, they are stored and displayed in RVHeader and RVFooter.

In the next update, TSRichViewEdit will have 6 of them:
(header, footer) * (first page, even pages, odd pages).
Using 6 editors is not rational, so headers and footers will be stored in separate properties, and loaded to RVHeader and RVFooter only for editing (similarly, like notes are loaded to RVNote).
So the code for restoring normal settings will be different.