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

RTFFormatProvider Import causing Stack Overflow

1 Answer 161 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
john
Top achievements
Rank 1
john asked on 25 Mar 2015, 02:08 AM
Hello,  First I apologize if this is the wrong place for this question.  I'm new to using Telerik stuff and this is my first post.

I am retrieving a RTF string from a legacy database and using RTFFormatProvider.Import loading it to a RadDocument.
Occassionally I get an RTF string that causes the Import to Stack Overflow and I have no way to recover.  Ultimately the data needs to be converted to HTML for later viewing.

I'm using Visual Studio 2013, The .net40 Telerik version I have is 2012.2.0725.40 (which I understand is not the most current).
I can provide an rtf file that contains the data that causes the crash.  Hopefully someone can help me out.
Just wondering if this is a known potential issue or it's a version issue for me?

The conversion works the majority of the time.

My code looks something like this:

using Telerik.Windows.Documents.FormatProviders.Html;
using Telerik.Windows.Documents.FormatProviders.Rtf;
using Telerik.Windows.Documents.Model;

namespace Conversion
{
    public class RTFConversion
    {
        public string ConvertRTF(string rtfText)
        {
            RtfFormatProvider rftFormatProvider = new RtfFormatProvider();
            HtmlFormatProvider htmlFormatProvider = new HtmlFormatProvider();

            RadDocument radDocument = rftFormatProvider.Import(rtfText);
            return htmlFormatProvider.Export(radDocument);
        }
    }
}

Thanks in advance for any help.

John

1 Answer, 1 is accepted

Sort by
0
Petya
Telerik team
answered on 25 Mar 2015, 12:36 PM
Hi John,

Could you provide us with one of the files that causes this, please? It's hard to say what might be causing this based on the information you've shared so far. You could also try showing the file with the latest version of the control to see if this is resolved. Try the WPF demos or the Silverlight ones, since the code base of RadRichTextBox is shared between the suites.

Looking forward to your reply.

Regards,
Petya
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
General Discussions
Asked by
john
Top achievements
Rank 1
Answers by
Petya
Telerik team
Share this question
or