Nevron Open Vision Documentation
Rich Text Editor / Loading and Saving Documents / Saving Documents
In This Topic
    Saving Documents
    In This Topic

    NOV rich text view supports saving of text documents to TXT, RTF, DOCX, HTML, EPUB, PDF, NTB, and NTX formats. Note that only the latter two will fully persists all the information in the document as the control supports features not present in HTML, RTF, and DOCX. TXT format will preserve only the text content of the document, i.e. all formatting will be lost.

     Saving Text Documents to File

    To save a text document to a file you need to call the NRichTextView object SaveToFile method:

    Saving a Text Document To File
    Copy Code

    By default, the NOV rich text view analyzes the extension of the provided file name to determine the format to save to. If you want to specify the text format explicitly you can pass it as a second parameter to the SaveToFile method:

    Saving a Text Document To File Specifying the Text Format Explicitely
    Copy Code
    m_RichText.SaveToFile(@"C:\\MyDocument.docx", NTextFormat.Docx);
     Saving Text Documents to Stream

    Similarly if you want to perists the document content to a stream you can use the SaveToStream method:

    Saving a Text Document To Stream
    Copy Code
    m_RichText.SaveToStream(stream, NTextFormat.Docx);
    See Also