trichview.com

trichview.support




Re: Save to RTF - not saving magins!


Return to index


Author

Message

Sergey Tkachenko

Posted: 03/20/2005 18:06:13


Yes, margins are not saved.

There are two types of margins - margins in TRichView (LeftMargin,

TopMargin, etc.), and margins in TRVPrint (LeftMarginMM, TopMarginMM, etc.).

The difference between them is shown in the help topic about TRVPrint.


RTF does not have analogs for the first type of margins.

As for the second type of margins, you can save them using OnSaveRTFExtra

event:


procedure TForm3.RichViewEdit1SaveRTFExtra(Sender: TCustomRichView;

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

  InStyleSheet: Boolean; var RTFCode: String);


  function MMToTwips(mm: Integer): Integer;

  begin

    Result := Round(mm*1440*5/127);

  end;


begin

  if Area=rv_rtfs_Doc then

    RTFCode := Format('\margl%d\margt%d\margr%d\margb%d',

      [MMToTwips(RVPrint1.LeftMarginMM),

       MMToTwips(RVPrint1.TopMarginMM),

       MMToTwips(RVPrint1.RightMarginMM),

       MMToTwips(RVPrint1.BottomMarginMM)]);

end;



>

> I think than you skipped saving margins when converting data to RTF

format.

> How it may be done better?

> Thanks.

> (Sorry for my english.)





Powered by ABC Amber Outlook Express Converter