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

ExportToRtf in New Page

1 Answer 52 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Hasan Can
Top achievements
Rank 1
Hasan Can asked on 29 Jun 2011, 12:20 PM
Hi,

I need a new page in rtf. 

Sample:
RadEditor1.content = " rtf document page1 <br /> page1 new line -new page- rtf document page2"

RadEditor1.ExportToRtf()



Thank you.

1 Answer, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 04 Jul 2011, 08:33 AM
Hi Hasan,

Yes, it is possible to insert page breaks in the generated RTF content using the following self closing tag:

<p style="page-break-before:always"/>

This tag however is not valid XHTML tag and the browser and ConvertToXhtml filter will correct it. For that reason my recommendation is to use some custom tag <my:pageBreak></my:pageBreak> tag that the browser will not modify and to replace this tag on the server using String.Replace with
<p style="page-break-before:always"/>, e.g.

string html = RadEditor1.Content;
html = html.Replace("<my:pageBreak></my:pageBreak>", "<p style=\"page-break-before:always\"/>");
RadEditor1.Content = html;
RadEditor1.ExportToRtf();

I hope this helps.

Best wishes,
Rumen
the Telerik team

Browse the vast support resources we have to jump start 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.

Tags
Editor
Asked by
Hasan Can
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Share this question
or