ExportToRtf in New Page

2 posts, 0 answers
  1. Hasan Can
    Hasan Can avatar
    4 posts
    Member since:
    Dec 2010

    Posted 29 Jun 2011 Link to this post

    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.
  2. Rumen
    Admin
    Rumen avatar
    14031 posts

    Posted 04 Jul 2011 Link to this post

    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.

Back to Top