Topbar
Topbar
Sign in
|
Join
|
Client Center
Home
Products
Client Center
Contact
Purchase
Support forums
»
Products
»
Cute Editor for .NET
»
Re: How can users print a long and formatted text together with the complete web page?
Re: How can users print a long and formatted text together with the complete web page?
11-23-2010, 10:07 PM
cutechat
Joined on 07-22-2004
Posts 2,332
Re: How can users print a long and formatted text together with the complete web page?
Reply
Quote
Hi,
Here is a sample:
<%@ Page language="c#" %> <%@ Register TagPrefix="CE" Assembly="CuteEditor" Namespace="CuteEditor" %> <html> <head> <title>Print Sample</title> </head> <body> <form id="Form1" method="post" runat="server"> <div id="toparea"> Hello </div> <div id="editarea"> <ce:editor id="Editor1" runat="server"></ce:editor> <br /> <button onclick="do_print();return false">Print Now</button> </div> <div id="printarea" style="display:none"> </div> <div id="toparea"> World </div> </form> <script> function do_print() { var editor=document.getElementById("<%=Editor1.ClientID%>"); var editarea=document.getElementById("editarea"); var printarea=document.getElementById("printarea"); printarea.innerHTML=editor.GetHTML(); editarea.style.display="none"; printarea.style.display=""; window.print(); editarea.style.display=""; printarea.style.display="none"; } </script> </body> </head>
If you want to control more area , please check the CSS @media print { ... }
Regards,
Terry
View Complete Thread