<< Click to display table of contents >> TCustomRichView.OnSaveRTFExtra |
Allows saving additional information in RTF
type
TRVRTFSaveArea = // defined in RVStyle.pas
(rv_rtfs_TextStyle, rv_rtfs_ParaStyle, rv_rtfs_ListStyle,
rv_rtfs_StyleTemplate, rv_rtfs_StyleTemplateText,
rv_rtfs_CellProps, rv_rtfs_RowProps, rv_rtfs_Doc);
TRVSaveRTFExtraEvent = procedure (Sender: TCustomRichView;
Area: TRVRTFSaveArea; Obj: TObject;
Index1, Index2: Integer;
InStyleSheet: Boolean; var RTFCode: TRVUnicodeString) of object;
property OnSaveRTFExtra: TRVSaveRTFExtraEvent;
(changed in version 18)
This event occurs when saving RTF (SaveRTF, SaveRTFToStream).
Text assigned to RTFCode parameter will be saved in RTF (converted to ANSI)
Area defines a place where RTFCode will be inserted. Meaning of Index1, Index2 and Obj depends on Area.
Area |
Meaning |
---|---|
rv_rtfs_TextStyle |
Occurs when saving text style. If InStyleSheet=True, this style is saved as a part of style sheet (when RTF is saved with rvrtfSaveStyleSheet option) |
rv_rtfs_ParaStyle |
Occurs when saving paragraph style. If InStyleSheet=True, this style is saved as a part of style sheet (when RTF is saved with rvrtfSaveStyleSheet option) |
rv_rtfs_ListStyle |
Occurs when saving list style and list levels. |
rv_rtfs_StyleTemplate |
Occurs when saving a style template as a style sheet item. Index1 is an index of the style template in StyleTemplates. Index2 = -1 Obj is a style template. |
rv_rtfs_StyleTemplateText |
Occurs when saving a style template as an additional style sheet item (containing only character properties), linked the the main style sheet item. Such additional style sheet items are created for style templates having Kind = rvstkParaText. Index1 is an index of the style template in StyleTemplates. Index2 = -1 Obj is a style template. |
rv_rtfs_CellProps |
Occurs when saving table cell properties. |
rv_rtfs_RowProps |
Occurs when saving table row properties. |
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: TRVAnsiString);
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:
See also events:
See also examples: