rvico TRichView Reference | TRichView

TCustomRichView.SaveTextToStream, SaveTextToStreamW

Top  Previous  Next

The methods export document or selection as ANSI (SaveTextToStream) or Unicode (SaveTextToStreamW) text.

function SaveTextToStream(const Path: String; Stream: TStream;

  LineWidth: Integer; SelectionOnly, TextOnly: Boolean;

  CodePage: Cardinal=CP_ACP):Boolean;

function SaveTextToStreamW(const Path: String; Stream: TStream;

  LineWidth: Integer; SelectionOnly, TextOnly: Boolean):Boolean;

(introduced in version 1.3)

Parameters

LineWidth is used for saving breaks (they are saved as LineWidth '-' characters)

Path – path for saving images and other non-text items (they are not saved by default, but this parameter is used in OnSaveImage2, OnSaveComponentToFile, and OnSaveItemToFile events);

SelectionOnly – if True, only selected part of the document is saved.

TextOnly – if True, non-text items are ignored when saving. If False, text representation of items is saved.

 

unicode Unicode notes:.

SaveTextToStream: text of Unicode styles is converted using the CodePage parameter (or, if CodePage=CP_ACP, using TRVStyle.DefCodePage).

SaveTextToStreamW: text of ANSI styles is converted basing on its character sets (if Charset=DEFAULT_CHARSET, it is converted using TRVStyle.DefCodePage).

 

Return value: "successful saving?"

 

See also methods:

SaveText, SaveTextW;

LoadTextFromStream, LoadTextFromStreamW.

See also events:

OnSaveImage2;

OnSaveComponentToFile;

OnSaveItemToFile.

See also:

Saving and loading RichView documents.


TRichView © trichview.com