Convert to pdf without saving to database

4 posts, 0 answers
  1. Zura Chikhladze
    Zura Chikhladze avatar
    32 posts
    Member since:
    Jul 2009

    Posted 08 Aug 2013 Link to this post

    Hello Telerik,

    I have a small issue and maybe you can help me. I have a form where user enters the info. What i want is to convert the html document into pdf on button click without saving the entered info by the user into the database. Can you tell which telerik tool should i use in this case? Thank you. 

    here is a simplified version of the form:

            <asp:Label ID="Label1" runat="server" Text="Label">Please enter your name:</asp:Label><br />
            <br />
            <asp:Label ID="Label4" runat="server" Text="Label">name: </asp:Label>
            <asp:TextBox ID="txtName" runat="server"></asp:TextBox>
            <br />
            <br />
            <asp:Label ID="Label2" runat="server" Text="Label"> Please enter your last name:</asp:Label><br />
            <br />
            <asp:Label ID="Label3" runat="server" Text="Label">lastname:</asp:Label>
            <asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
            <br />
            <br />
            <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" />

  2. Vessy
    Vessy avatar
    2189 posts

    Posted 09 Aug 2013 Link to this post

    Hi Zura,

    The desired functionality is not supported out-of-the-box, but you can use the RadEditor's API in order to achieve a similar behavior:
    • traverse all html elements in your form on the page and get their content, concatenating it into one string. You can use either the RadEditor's get_text() or get_html() method
    • load the gathered content as a content of a hidden RadEditor
    Once you do the steps above you can use the approach used here which demonstrates how to export silently the editor's content into a PDF file on the server using the OnExportContent event and without loading the PDF file in the browser. The demo is based on the following blog post: How To: Export grid to PDF file and show the result using the window.

    I hope you will find this information helpful.

    Veselina Raykova
    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 the blog feed now.
  3. Saktheeswaran
    Saktheeswaran avatar
    7 posts
    Member since:
    Feb 2014

    Posted 27 May 2014 Link to this post

    Hi Telerik,

    I have one issue in my aspx page. My requirement is very simple. I need to export my aspx page to PDF, Word, Excel and HTML format.

    In this page have some radgrid and radhtmlchart.

    Please find the attach.

  4. Ianko
    Ianko avatar
    1932 posts

    Posted 28 May 2014 Link to this post

    Hello Saktheeswaran,

    The required actions is more related to a how-to export rendered ASP.NET AJAX control to different document format.

    Each of these controls can export the content separately, but exporting the rendered HTML content is not related to any of the Telerik controls.

    Such functionality would be complex and time-consuming matter, which should be built entirely by the developer of the application. Due to the reason that this is not related to the Telerik UI for ASP.NET AJAX suite I am unable to provide a proper approach to achieve that.

    I can only suggest you searching for proper information through ASP.NET forums and communities for approach to export the rendered data to a desired format. 


    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

Back to Top