TRichView Methods for Saving and Loading

<< Click to display table of contents >>

TRichView Methods for Saving and Loading

TRichView has the following methods for export:

SaveHTML, SaveHTMLToStream exporting the document to a file or a stream as HTML;

SaveText: saving plain ANSI text in file; SaveTextW: saving plain Unicode text;
SaveTextToStream, SaveTextToStreamW the same for streams (can save the whole document or only a selection);

SaveMarkdown, SaveMarkdownToStream saving the whole document or the selected part to Markdown file or stream;

SaveRTF, SaveRTFToStream exporting the whole document or the selected part to a file or a stream as RTF (Rich Text Format);

SaveDocX, SaveDocXToStream exporting the whole document or the selected part to a file or a stream as DocX (Microsoft Word format);

SaveRVF, SaveRVFToStream saving the whole document or the selected part to RVF (RichView Format) file or stream.

TRichView has the following methods for import:

LoadHTML, LoadHTMLFromStream reading HTML file or stream;

LoadText: reading plain ANSI text; LoadTextW: reading plain Unicode (UTF-16) text;

LoadTextFromStream, LoadTexFromStreamtW the same for streams instead of files;

LoadMarkdown, LoadMarkdownFromStream: reading Markdown file or stream;

LoadRTF, LoadRTFFromStream reading RTF (Rich Text Format) file or stream.

LoadDocX, LoadDocXFromStream reading DocX (Microsoft Word Document) file or stream.

LoadRVF, LoadRVFFromStream reading RVF (RichView Format) file or stream.

Universal methods:

LoadFromFile, LoadFromStream reading from a file or a stream, a format is detected by content.

See also: InsertRVFFromStream, AppendRVFFromStream.

Note: All methods for reading contents, introduced in TRichView, are viewer-style methods.

TRichViewEdit has the following additional methods for import (insertion):

InsertRVFFromFileEd, InsertRVFFromStreamEd like InsertRVFFromFile/InsertRVFFromStream, but editor-style methods.

InsertRTFFromFileEd, InsertRTFFromStreamEd inserting RTF (Rich Text Format) file or stream.

InsertDocXFromFileEd, InsertDocXFromStreamEd inserting DocX (Microsoft Word Document) file or stream.

InsertTextFromFile editor-style method;
InsertOEMTextFromFile the same method for files in DOS code page;
InsertTextFromFileW the same method for Unicode files;

InsertMarkdownFromFileEd, InsertMarkdownFromStreamEd inserting Markdown file or stream.

There are also method for pasting data from the Clipboard.

Events on export

HTML: OnHTMLSaveImage, OnSaveImage2, OnSaveComponentToFile, OnSaveHTMLExtra, OnSaveItemToFile, OnSaveParaToHTML, OnWriteHyperlink, OnWriteObjectProperties.

RTF: OnSaveComponentToFile, OnSaveRTFExtra, OnSaveItemToFile, OnWriteHyperlink, OnWriteObjectProperties.

DocX: OnSaveComponentToFile, OnSaveDocXExtra, OnSaveItemToFile, OnWriteHyperlink, OnWriteObjectProperties.

Text: OnSaveComponentToFile, OnSaveItemToFile

Markdown: OnSaveImage2, OnSaveComponentToFile, OnWriteHyperlink.

Events on import

Markdown: OnImportPicture, OnReadHyperlink, OnAddStyle.

RTF, DocXL: the events above + OnStyleTemplatesChange.

HTML: the events above + OnImportFile.

Common events

OnProgress

See also...

Saving HTML

Reading/writing RVF

Export of tables

Unicode in TRichView