New to Telerik UI for ASP.NET AJAXStart a free 30-day trial

Prevent the rtf, pdf and docx file download and convert the exported content to a string

Environment

ProductRadEditor for ASP.NET AJAX

Description

By design, the RadEditor ExportToPdf, ExportToRtf and ExportToDocx methods automatically convert and download the exported HTML content on the client as a file. See the solution below to learn how to obtain the converted content as a string on the server-side so that you can, for example, save it in another location as a physical file or in your database.

Solution

Here is an example of how to save the ExportOutput to a file on the server and prevent it from being sent to the client:

ASP.NET
<telerik:RadEditor RenderMode="Lightweight" runat="server" ID="RadEditor1" OnExportContent="RadEditor1_ExportContent" ContentFilters="DefaultFilters, PdfExportFilter">
</telerik:RadEditor>
<asp:Button runat="server" ID="Button1" Text="Export to PDF" OnClick="Button1_Click" />

See Also