Re: Exporting HTML to PDF & RTF

  •  09-30-2011, 7:47 AM

    Re: Exporting HTML to PDF & RTF

    Hi johnbro,
     
    Dynamically create editor then sent the html content in it and save it as pdf.
     
    Please try the example below
     
    <%@ Page Language="VB" %>

    <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <script runat="server">

        Protected Sub btnSave_Click(ByVal sender As Object, ByVal e As System.EventArgs)
            Dim editor2 As CuteEditor.Editor = New CuteEditor.Editor()
            editor2.ID = "myEditor"
            editor2.Text = label1.Text
            editor2.SavePDF("~/document.pdf")

        End Sub
    </script>

    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Untitled Page</title>
    </head>
    <body>
        <form id="form1" runat="server">
            <div>
                <asp:Button ID="btnSave" runat="server" Text="Save as pdf" OnClick="btnSave_Click" />
                <asp:Label ID="label1" runat="server" Text="my test content"></asp:Label>
            </div>
        </form>
    </body>
    </html>

     
    Regards,
     
    Ken
View Complete Thread