Silently export RadEditor to RTF

9 posts, 0 answers
  1. Mihai Dinculescu
    Mihai Dinculescu avatar
    33 posts
    Member since:
    Nov 2009

    Posted 17 Nov 2010 Link to this post

    Hello

    I need to export a RadEditor to a RTF, but I need to do it silently on the server and not popup a saveas window to the user. How can I achieve this please ?

    Regards
    Mihai
  2. Rumen
    Admin
    Rumen avatar
    14351 posts

    Posted 17 Nov 2010 Link to this post

    Hello Mihai,

    There is a OpenInNewWindow attribute in the ExportSettings inner tag, which value should be set to false, e.g.

    <telerik:RadEditor ID="RadEditor1" runat="server" >
        <ExportSettings OpenInNewWindow="false" ></ExportSettings>
    </telerik:RadEditor>

    This setting will not open the Save dialog.
    You can export the content as RTF on the server via the new OnExportContent event property of RadEditor.

    Please, see this forum thread for more information: get RTF string or stream.


    Best wishes,
    Rumen
    the Telerik team
    Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  3. Mihai Dinculescu
    Mihai Dinculescu avatar
    33 posts
    Member since:
    Nov 2009

    Posted 17 Nov 2010 Link to this post

    I have already tried that with no luck. The window still opens.

    But my problems are a lot bigger now. It seems that after I LoadRtfContent() a RTF file that was previously saved using ExportToRtf() the whole file is messed up when loading it again in RadEditor.

    If I open it in wordpad it looks ok but if I save it (using WordPad) I get the "a text cannot appear on root level, must be child of a group: '' error next time I try to load it inside RadEditor.

    I file that guarantees this behavior can be found at: http://dev.good-intentions.eu/test_file.rtf

    I feel really bad about this because I just convinced my client to spend the full price for Telerik controls and they really need to be able to load/save RTF files freely.

    So any help would be greatly appreciated.

    Regards
    Mihai
  4. Rumen
    Admin
    Rumen avatar
    14351 posts

    Posted 22 Nov 2010 Link to this post

    Hi Mihai,

    I was able to reproduce the problem and logged it for research. I noticed that if I save the non working RTF file after that in MS Word 2007 the problem disappears. It seems related to WordPad, but our developers should research it in more details and hopefully fix it. If possible, instruct your users to edit the RTF files in MS Word instead of WordPad.

    As to the silent update: Attach an eventhandler to the OnExportContent event and interrupt the ExportContent event by calling Response.Redirect(url). Therefore the browser will not ask whether to open or save the content.

    You can find attached here an example demonstrating how to export the editor's content as PDF on the server using the new OnExportContent event property of RadEditor. The solution for RTF export should be similar.

    Here is additional information about the RTF import and export features of RadEditor:

    RadEditor uses two different free libraries to provide Import to RTF and Export to RTF features.

    The first one used to provide RFT to HTML importation is available in this CodeProject's article: http://www.codeproject.com/KB/recipes/RtfConverter.aspx.
    The library used for HTML to RTF exportation is available here http://www.codeproject.com/KB/recipes/RtfConverter.aspx.
    As you can see both libraries are written by different developers and they are not fully compatible with each other.

    For your convenience I prepared a list of know limitations of the Import and Export features of both libraries:

    RFT to HTML (Import)

    bold
    - supported. I was able to export bold formatting from the provided by you Bold.rtf file.
    italic - supported
    underline - supported
    foreground and background colors - supported
    table elements - unsupported
    images- unsupported
    indentations - unsupported


    HTML to RTF (export)


    bold - supported.
    italic - supported
    underline - unsupported
    foreground and background colors - unsupported
    table elements - partially supported
    images- unsupported
    indentations - supported

    You can see the following video which demonstrates how the RTF import and export features work:
    http://screencast.com/t/7ag9iDfqpZ.

    You should also note that good RTF import and export tools are very expensive and if we integrate such tools in RadEditor, the price of the Telerik suite will be increased a lot. That is why if you are currently not satisfied with the offered by RadEditor RTF functionality, you can search in Internet for another free or paid RTF to HTML importation and HTML to RTF exportation tools and we will help you to integrate them with RadEditor.

    Sincerely yours,
    Rumen
    the Telerik team
    Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  5. Rumen
    Admin
    Rumen avatar
    14351 posts

    Posted 22 Nov 2010 Link to this post

    Hi Mihai,

    Here you can find the PITS Issue that I created for the problem: Public URL.

    Kind regards,
    Rumen
    the Telerik team
    Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  6. Vina
    Vina avatar
    5 posts
    Member since:
    May 2011

    Posted 16 Nov 2011 Link to this post

    Hi,

    I am using the RadEditor for ASP.NET version 2011 ones (Q2 2011).
    And notice that the export to RTF still does not support images.. but on the other hand, I am using your RichTextBox Control in Silverlight and this one has no problem in exporting images to RTF format.
    Is there anyway I can get the same export functionality to RTF in ASP.NET as in the Silverlight ones?

    Thank you.

    Vina.
  7. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 16 Nov 2011 Link to this post

    Hello Vina,

    Take a look into the following forum thread which discussed the same.
    unable to export .jpg image from radEditor to MSWord

    Thanks,
    Princy.
  8. Goldie
    Goldie avatar
    2 posts
    Member since:
    Mar 2012

    Posted 29 Mar 2012 Link to this post

    I am using RadEdior version 2012.1.301.35. 
    I want to know if the underline formatting functionality has been fixed in this version for ExportToRtf() function.
  9. Rumen
    Admin
    Rumen avatar
    14351 posts

    Posted 30 Mar 2012 Link to this post

    Hello,

    The issue is not yet fixed. Our ToDo list for Q2 2012 is pretty set and the improvement of the RTF import and export features was postponed.

    Kind regards,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top