creating pdf from javascript

Last post 10-05-2007, 3:48 PM by Adam. 1 replies.
Sort Posts: Previous Next
  •  10-05-2007, 1:48 PM 34053

    creating pdf from javascript

    Can someone please tell me what is wrong with this code.  I keep getting an error object expected from the script debugger in IE and nothing happens.
     

    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="2PDF.aspx.vb" Inherits="_2PDF" %>

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    <%@ Register TagPrefix="CE" Namespace="CuteEditor" Assembly="CuteEditor" %>

    <html xmlns="http://www.w3.org/1999/xhtml" >

    <head runat="server">

    <title>Untitled Page</title>

    </head>

    <script language="javascript">

    function createpdf(){

    var editor1 = document.getElementById('<% = Editor9.ClientID%>');

    var t = editor1.getHTML();

    CuteEditor.Convertor.PDF.HTML2PDF html2pdf = new CuteEditor.Convertor.PDF.HTML2PDF(t);

    html2pdf.Render();

    html2pdf.Save("~/doc/mydoc.pdf");

    }

    </script>

    <body>

    <form id="form1" runat="server">

    <div style="text-align: center">

    <CE:Editor ID="Editor9" runat="server" AutoConfigure="Simple" BreakElement="P" CodeViewTemplateItemList="Save,Print,Cut,Copy,Paste,Find,ToFullPage,FromFullPage,SelectAll,InsertNumberedList,SelectNone"

    EditorWysiwygModeCss="example.css" Height="176px" ShowBottomBar="False" ShowGroupMenuImage="False"

    Width="100%" MaxHTMLLength="10000" MaxTextLength="10000" PrintFullWebPage="True">

    <FrameStyle BackColor="White" BorderColor="#DDDDDD" BorderStyle="Solid" BorderWidth="1px"

    CssClass="CuteEditorFrame" Height="100%" Width="100%" />

    </CE:Editor>

    <asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="createpdf()" UseSubmitBehavior="False" /></div>

    </form>

    </body>

    </html>

  •  10-05-2007, 3:48 PM 34056 in reply to 34053

    Re: creating pdf from javascript

    miltonsnider,
     
    It's impossible to create PDF using the client side code.
     
     

    asp.net Chat http://cutesoft.net/ASP.NET+Chat/default.aspx
    Web Messenger: http://cutesoft.net/Web-Messenger/default.aspx
    asp.net wysiwyg editor: http://cutesoft.net/ASP.NET+WYSIWYG+Editor/default.aspx
    asp wysiwyg html editor: http://cutesoft.net/ASP
    asp.net Image Gallery: http://cutesoft.net/ASP.NET+Image+Gallery/default.aspx
    Live Support: http://cutesoft.net/live-support/default.aspx

View as RSS news feed in XML