trichview.com

trichview.support




Re: RTF Import and Margins?


Return to index


Author

Message

Sergey Tkachenko

Posted: 08/20/2004 14:06:06


Sorry for delay,


Yes and no.


It does not support it, but workaround is added.


If you compile your application with the compiler define

RICHVIEW_DPMARGINS, margins will be loaded in RichView.DocProperties as

strings like 'LeftMarginMM=###'.

You can call:

RVPrint.LeftMarginMM :=

StrToIntDef(RichView.DocProperties.Values['LeftMarginMM'], 20);

Changing compiler define affect only source code, so you need to have

registered version to enable this feature.


You can also save margins in RTF


Process OnSaveRTFExtra


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;





Powered by ABC Amber Outlook Express Converter