Need help for save and restore the page properties

General TRichView support forum. Please post your questions here
Post Reply
Andy
Posts: 24
Joined: Wed Oct 15, 2008 6:06 am
Location: Switzerland

Need help for save and restore the page properties

Post by Andy »

Please tell me,


What is the correct way to save and restore the document.
So that the document will be loaded as they would at least saving or leaved.


Andy
Andy
Posts: 24
Joined: Wed Oct 15, 2008 6:06 am
Location: Switzerland

Post by Andy »

I see a 3 different structures for layout but I don't know which is the right one.
When I set some property the whole layout is destroyed.


Attention: it's for ScaleRichView !

Andy
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

SRichViewEdit1.RichViewEdit.SaveRVFToStream/SaveRVF and
SRichViewEdit1.RichViewEdit.LoadRVFFromStream/LoadRVF.

As for the layout question, I do not understand. Please give more details.
Andy
Posts: 24
Joined: Wed Oct 15, 2008 6:06 am
Location: Switzerland

Post by Andy »

For saving I use your suggested method. -> SaveRVF

For loading I have troubles:

With "SRVE.RichViewEdit.LoadRVF(FNAme)"
I get an exception out of maximun (-1)
class TCustomRVData; unit-> CRVData.pas
always on the second try , it works.

But with "rvActionsResource.rvActionOpen1.LoadFile" it worky always.

What is the difference ?

Andy
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Do you call SRVE.RichViewEdit.Format after LoadRVF?
Andy
Posts: 24
Joined: Wed Oct 15, 2008 6:06 am
Location: Switzerland

Post by Andy »

:oops: Shame over me,

yes,I have forget format-method.
Sorry.

But now back to my problem.
In the layout - sructure all is ok (by loading), but it will not restore by loading document. (Missing update PageProperty)

What have forget now ?
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Do you save in RVF format?
What's you version of ScaleRichView?
Are rvfoSaveDocProperties and rvfoLoadDocProperties included in SRVE.RichViewEdit.RVFOptions? (must be by default)
Andy
Posts: 24
Joined: Wed Oct 15, 2008 6:06 am
Location: Switzerland

Post by Andy »

Yes,I save in RVF Format.

Version ScaleRichViw is 1.5.1

Load/Save Docproperties are TRUE

In debugger I see that the Margins will correct save and correct loaded.
But this parameter will not activatet to the pageproperty.
Andy
Posts: 24
Joined: Wed Oct 15, 2008 6:06 am
Location: Switzerland

Post by Andy »

When direct after: SRVE.RichViewEdit.LoadRVF(FileName);

I wrote this code

SRVE.SetMargin(SRVE.RichViewEdit.LeftMargin ,
SRVE.RichViewEdit.TopMargin ,
SRVE.RichViewEdit.RightMargin,
SRVE.RichViewEdit.BottomMargin);

Then all is fine.
But I have think my ScaleRichView-component make this automatically !
Or really not ?
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Try updating to 1.5.2 and check if the problem persists.
Sergey Tkachenko
Site Admin
Posts: 17559
Joined: Sat Aug 27, 2005 10:28 am
Contact:

Post by Sergey Tkachenko »

Unfortunately, SRVE cannot update margins automatically after calling SRVE.RichViewEdit.LoadRVF.
You need to call

Code: Select all

SRVE.RichViewEdit.LoadRVF(...); // or LoadRTF
SRVE.SetRVMargin;
SRVE.Format;
Or you can call

Code: Select all

SRVE.LoadRVF(...);
SRVE.Format;
Post Reply