PDF export and list style

Last post 12-01-2011, 6:12 AM by Kenneth. 3 replies.
Sort Posts: Previous Next
  •  11-25-2011, 12:18 AM 71624

    PDF export and list style

    Hi,
     
    I saw the demo  for 'PDF creation' but I cant see it in the sample code. Can you help me if I am missing something in my sample solution.
     
    Thanks.
     
     
     
  •  11-25-2011, 6:34 AM 71630 in reply to 71624

    Re: PDF export and list style

    Hi HISOKA,
     
    You can find the pdf demo page under the "cs" folder, name  "createPDF.aspx". Below is the code of it
     
    <%@ Page Language="C#" validateRequest="false" %>
    <%@ Register TagPrefix="cutesoft" TagName="banner" Src="banner.ascx" %>
    <%@ Register TagPrefix="cutesoft" TagName="leftmenu" Src="leftmenu.ascx" %>
    <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>
    <html>
        <head>
            <title>ASP.NET WYSIWYG Editor - Create ASP.NET PDF </title>
            <link rel="stylesheet" href="../example.css" type="text/css" />
        </head>
        <body>
            <form id="Form1" runat="server">
                <cutesoft:banner id="banner1" runat="server" />    
                <table cellpadding="15">
                    <tr>
                        <td id="leftcolumn">
                            <cutesoft:leftmenu id="leftmenu1" runat="server" />                
                        </td>
                        <td>
                            <h1>Dynamic PDF Creation </h1>        
                            <p style="width:770px">This example demonstrates you can use Cute Editor to create industry standard PDF files on the fly. In the following example, when you submit the form, the html code generated by the Editor is saved into a PDF file. <a href="document.PDF"><b>Check the PDF file</b></a>
                            </p><br />
                            <CE:Editor id="Editor1" URLType="Absolute" ThemeType="Office2007" EditorWysiwygModeCss="../example.css" AutoConfigure="Simple" runat="server" ></CE:Editor><br />
                            <asp:Button id="btnUpdate" onclick="Submit" Runat="server" Text="Submit"></asp:Button><br />            
                            <asp:textbox id="textbox1" runat="server" TextMode="MultiLine" Height="250px" Width="770px"></asp:TextBox>                            
                        </td>
                    <tr>
                </table>            
            </form>
        </body>
    </html>


    <script runat="server">
        void Page_Load(object sender, System.EventArgs e)
         {
            if (IsPostBack)
            {
                Editor1.SavePDF("document.PDF");
                textbox1.Text = Editor1.Text;
            }
            else
            {
                Editor1.Text = @"<table cellspacing=""4"" cellpadding=""4"" border=""0""> <tbody> <tr> <td> <p> <img src=""http://cutesoft.net/Uploads/j0262681.jpg"" width=""80"" alt=""""/></p></td> <td> <p>When your algorithmic and programming skills have reached a level which you cannot improve any further, refining your team strategy will give you that extra edge you need to reach the top. We practiced programming contests with different team members and strategies for many years, and saw a lot of other teams do so too.  </p></td></tr> <tr> <td> <p>  <img src=""http://cutesoft.net/Uploads/PH02366J.jpg"" width=""80"" alt="""" /></p></td> <td> <p>From this we developed a theory about how an optimal team should behave during a contest. However, a refined strategy is not a must: The World Champions of 1995, Freiburg University, were a rookie team, and the winners of the 1994 Northwestern European Contest, Warsaw University, met only two weeks before that contest.  </p></td></tr></tbody></table> <br /> <br />";
            }
        }
        public void Submit(object sender, System.EventArgs e)
        {
                Editor1.SavePDF("document.PDF");
                textbox1.Text = Editor1.Text;  
        }
    </script>
     
    Regards,
     
    Ken
  •  12-01-2011, 2:10 AM 71743 in reply to 71630

    Re: PDF export and list style

    Thanks for your reply. I saw the sample and indeed the the PDF file was saved in my local directory.
    Would it be possible to have a download prompt for the user so that the PDF file will be saved in user's computer instead of our web server.
     
    Does this PDF creator support of inserting an image came from a database at runtime for both header and footer of pdf file?
     
    Thanks.
  •  12-01-2011, 6:12 AM 71745 in reply to 71743

    Re: PDF export and list style

    Hi HISOKA,
     
    1. The pdf file will save in the server not the end user computer.
     
    2. The pdf function will generate the content by the html code of CuteEditor. You can load a template into editor by default to achieve your requirement.
     
    Regards,
     
    Ken 
View as RSS news feed in XML