Exporting HTML to PDF & RTF

Last post 10-04-2011, 1:37 AM by ketty00. 3 replies.
Sort Posts: Previous Next
  •  09-29-2011, 10:31 PM 70238

    Exporting HTML to PDF & RTF

    I wish to create PDf & RTF documents in background process Through a  business layer. How can I imports "CuteEditor"   
     
    (VB)
    eg: BLL.vb file

    Imports System.IO

    Imports System

    Imports System.Data

    Imports System.Data.SqlClient
    Imports RM.Data.Adapters.OptInTableAdapters
    Imports System.Web.Security

    Imports System.Data.OleDb

    Imports CuteEditor     [does  not contain any public members or cannot be found]

     
    <System.ComponentModel.DataObject()> _
    Public Class DocIntegrateBLL
    Public Sub CreateExamplePDF(ByVal content As String)
    Dim html2pdf As New CuteEditor.Convertor.PDF.HTML2PDF(content)  [Not defined]
    html2pdf.Render()
    html2pdf.Save("C:\SampleDir\testdoc.pdf")
    End Sub
    End Class
     
  •  09-30-2011, 7:47 AM 70244 in reply to 70238

    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
  •  09-30-2011, 6:47 PM 70246 in reply to 70244

    Re: Exporting HTML to PDF & RTF

    Thanks Ken,
     
    I use this to create PDF from a form and this is fine.
     
    What I am after is creating multiple PDF's as a background process in the Business layer by reading conetnt from SQL database , creating and storing PDF and then emailing as an after hours sceduled task, not instigated by the user.
     
    Any examples?
     
    Regards,
    JohnBra
     
     
     
     
  •  10-04-2011, 1:37 AM 70272 in reply to 70244

    Re: Exporting HTML to PDF & RTF

    Thanks dear i search it on many sites but i can't get accurate result...
View as RSS news feed in XML