Page Margins
-
- Posts: 54
- Joined: Mon Jul 31, 2006 2:10 am
Page Margins
Is there a reason Page Margins aren't automatically stored in RVF file format for each document?
If not, is there an easy way to store the page margins for each document inside the document itself? Again, I am using the RVF format for storing documents into a database table.
Best Regards,
Shane
If not, is there an easy way to store the page margins for each document inside the document itself? Again, I am using the RVF format for storing documents into a database table.
Best Regards,
Shane
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
Currently, page margins are assumed to be a property of application, not a property of document.
LeftMarginMM, etc. are properties of TRVPrint component, so TRichView cannot store them (TRichView does not have a link to TRVPrint).
In future, I plan to add new properties in TRichView. For now, you should save them yourself.
Below is an example how to do it using RichViewActions, but the main idea is simple and can be used without RichViewActions.
How to save RVPrint's margins in RVF files (not RTF):
1) Include rvfoSaveDocProperties and rvfoLoadDocProperties in
RichViewEdit1.RVFOptions
2) Write two procedures for saving and loading margins in
RichViewEdit1.DocProperties:
3) Process rvActionPageSetup.OnChange.
4) Process rvActionSave.OnDocumentFileChange
(this event is already processed in the ActionTest demo)
Add the code reading margins to RVPrint from DocProperties.
LeftMarginMM, etc. are properties of TRVPrint component, so TRichView cannot store them (TRichView does not have a link to TRVPrint).
In future, I plan to add new properties in TRichView. For now, you should save them yourself.
Below is an example how to do it using RichViewActions, but the main idea is simple and can be used without RichViewActions.
How to save RVPrint's margins in RVF files (not RTF):
1) Include rvfoSaveDocProperties and rvfoLoadDocProperties in
RichViewEdit1.RVFOptions
2) Write two procedures for saving and loading margins in
RichViewEdit1.DocProperties:
Code: Select all
procedure TForm3.DocPropToRVPrint;
var s: String;
begin
s := RichViewEdit1.DocProperties.Values['LeftMarginMM'];
RVPrint1.LeftMarginMM := StrToIntDef(s, 20);
s := RichViewEdit1.DocProperties.Values['TopMarginMM'];
RVPrint1.TopMarginMM := StrToIntDef(s, 20);
s := RichViewEdit1.DocProperties.Values['RightMarginMM'];
RVPrint1.RightMarginMM := StrToIntDef(s, 20);
s := RichViewEdit1.DocProperties.Values['BottomMarginMM'];
RVPrint1.BottomMarginMM := StrToIntDef(s, 20);
end;
procedure TForm3.RVPrintToDocProp;
begin
RichViewEdit1.DocProperties.Clear;
RichViewEdit1.DocProperties.Add('LeftMarginMM='+IntToStr(RVPrint1.LeftMargi
nMM));
RichViewEdit1.DocProperties.Add('TopMarginMM='+IntToStr(RVPrint1.TopMarginM
M));
RichViewEdit1.DocProperties.Add('RightMarginMM='+IntToStr(RVPrint1.RightMarg
inMM));
RichViewEdit1.DocProperties.Add('BottomMarginMM='+IntToStr(RVPrint1.BottomMa
rginMM))
;
end;
Code: Select all
procedure TForm3.rvActionPageSetupChange(Sender: TObject);
begin
RichViewEdit1.Change;
RVPrintToDocProp;
end;
(this event is already processed in the ActionTest demo)
Add the code reading margins to RVPrint from DocProperties.
Code: Select all
procedure TForm3.rvActionSave1DocumentFileChange(Sender: TObject;
Editor: TCustomRichViewEdit; const FileName: String;
FileFormat: TrvFileSaveFilter; IsNew: Boolean);
begin
....
DocPropToRVPrint;
end;
-
- Posts: 54
- Joined: Mon Jul 31, 2006 2:10 am
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Posts: 54
- Joined: Mon Jul 31, 2006 2:10 am
I will have a look at the help.
I forwarded your response to a couple of my clients. The nice one wrote back that your response is "FULL OF C__P". Her second paragraph was
"But he is not correct. The text in MS Word adjusts accordingly when you adjust the margins. In our system (TRichView), it does not. You can not move the text when you expand the margins. What is the point of the margins if we can't adjust the text to them?????"
I personally don't use Word, but Open Office. Open Office Writer does as she describes when I change the Page Margins.
What I am trying to accomplish in my application is a Mini-Word. Is there any way to implement the page margins in the view the way people expect it to work?
Best Regards,
Shane
I forwarded your response to a couple of my clients. The nice one wrote back that your response is "FULL OF C__P". Her second paragraph was
"But he is not correct. The text in MS Word adjusts accordingly when you adjust the margins. In our system (TRichView), it does not. You can not move the text when you expand the margins. What is the point of the margins if we can't adjust the text to them?????"
I personally don't use Word, but Open Office. Open Office Writer does as she describes when I change the Page Margins.
What I am trying to accomplish in my application is a Mini-Word. Is there any way to implement the page margins in the view the way people expect it to work?
Best Regards,
Shane
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
TRichViewEdit was not designed as WYSIWYG editor. This means that, even if you set the proper page width and margins, text on screen may be wrapped in different places. But if you think that approximate solution is better than nothing, look here: http://www.trichview.com/forums/viewtopic.php?t=1282
TRichViewEdit-based WYSIWYG editor will be released very soon, may be before the Summer. But it is created by another developer, and this will not be a free update.
TRichViewEdit-based WYSIWYG editor will be released very soon, may be before the Summer. But it is created by another developer, and this will not be a free update.
-
- Posts: 54
- Joined: Mon Jul 31, 2006 2:10 am
Sergey.
I am not worry about having to BUY and update or NEW component - I just want my customers happy and the two beta testing my product do NOT think what I currently have should be released as it is too confusing.
Will the new component be compatible with the existing TRichView component ?
The reason I am asking is that I just downloaded WPTools 5 and it works EXACTLY like my clients want. I would rather upgrade TRichView if possible.
Best Regards,
Shane
I am not worry about having to BUY and update or NEW component - I just want my customers happy and the two beta testing my product do NOT think what I currently have should be released as it is too confusing.
Will the new component be compatible with the existing TRichView component ?
The reason I am asking is that I just downloaded WPTools 5 and it works EXACTLY like my clients want. I would rather upgrade TRichView if possible.
Best Regards,
Shane
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact:
-
- Posts: 54
- Joined: Mon Jul 31, 2006 2:10 am
-
- Site Admin
- Posts: 17569
- Joined: Sat Aug 27, 2005 10:28 am
- Contact: