This is a migrated thread and some comments may be shown as answers.

Returning the rtf string

1 Answer 69 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Nick
Top achievements
Rank 1
Nick asked on 15 Oct 2013, 03:53 PM
Hello,

Is it possible to return the Rtf code instead of saving a document when "exporting" the document from the RichTextBoxEditor?  In other words I need to return the Rtf code instead of saving the file.

For example.  I want to open/edit a .Rtf document, when save is clicked I want to show the "Rtf code" in a text area.  My example of Rtf code is below.

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fcharset0 Arial;}{\f1\fnil Arial;}}
{\*\generator Msftedit 5.41.21.2510;}\viewkind4\uc1\pard\sl240\slmult1\fs20 RE:\tab Patient: <#A:PATIENTNAME>\f1\par
\tab\f0 Account Number: <#A:ACCOUNTCODE>\f1\par
\par
\par
\f0 <#A:LETTERDATE>\f1\par
\par
\i\f0 Re: HIPAA Disclosure Authorization Form\f1\par
\par
\i0\f0 Dear <#A:PATIENTNAME>:\f1\par
\par
\f0 Document body goes here.\f1\par
\b\tab\b0\par
\par
\f0 More document info here\f1\par
\par
\f0 regards,\f1\par
\par
\b\par
\b0\f0 Patient Accounts\f1\par
\f0 555-555-5555\f1\par
}

1 Answer, 1 is accepted

Sort by
0
Svetoslav
Telerik team
answered on 17 Oct 2013, 05:05 PM
Hi Nick,

Thank you for your question.

You could achieve this goal using RtfFormatProvider to export your document to string as described here and import it back to RadRichTextBox. Another way to implement it is through RtfDataProvider as explained in this help article.

Please, find attached a sample demo project showing both of the options above.

I hope this information is helpful. Let us know if you need any further assistance.

Regards,
Svetoslav
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
RichTextBox
Asked by
Nick
Top achievements
Rank 1
Answers by
Svetoslav
Telerik team
Share this question
or