rvico TRichView Reference | TRichView

TCustomRichView.OnSaveRTFExtra

Top  Previous  Next

Allows saving additional information in RTF

type

  TRVRTFSaveArea = (rv_rtfs_TextStyle, rv_rtfs_ParaStyle, 

    rv_rtfs_CellProps, rv_rtfs_RowProps,

    rv_rtfs_Doc);

 TRVSaveRTFExtraEvent = procedure (Sender: TCustomRichView;

   Area: TRVRTFSaveArea; Obj: TObject;

   Index1, Index2: Integer;

   InStyleSheet: Boolean; var RTFCode: Stringof object;

 

property OnSaveRTFExtra: TRVSaveRTFExtraEvent;

This event occurs when saving RTF (SaveRTF, SaveRTFToStream).

Text assigned to RTFCode parameter will be saved in RTF.

Area defines place where RTFCode will be inserted. Meaning of Index1, Index2 and Obj depend on Area.

Area

Meaning

rv_rtfs_TextStyle

Occurs when saving text style.
Index1 is an index of the text style in TextStyles collection, Obj is a text style object

rv_rtfs_ParaStyle

Occurs when saving paragraph style.
Index1 is an index of the paragraph style in ParaStyles collection, Obj is a paragraph style object

rv_rtfs_CellProps

Occurs when saving table cell properties.
Index1 = row index, Index2 =column index, Obj is the table.

rv_rtfs_RowProps

Occurs when saving table row properties.
Index1 = row index, Obj is the table.

rv_rtfs_Doc

Allows saving additional information at the beginning of the document

Example

procedure TMyForm.MyRichViewSaveRTFExtra(

  Sender: TCustomRichView; Area: TRVRTFSaveArea;

  Obj: TObject; Index1, Index2: Integer;

  InStyleSheet: Boolean; var RTFCode: String);

begin

  if Area=rv_rtfs_Doc then

    RTFCode := '\paperw11906\paperh16838\margl567\'+

      'margr567\margt567\margb567';

end;

This example saves paper size = A4, and margins = 1 cm.

See also properties:

DocParameters.

See also events:

OnSaveHTMLExtra.

See also examples:

http://www.trichview.com/forums/viewtopic.php?t=64.


RichView © Sergey Tkachenko