rekha Posted July 29, 2008 Share Posted July 29, 2008 Hi, I have a php page.In that page i have lots of information.I have the print button in the page to print.Now i want to preview the page before printing.Is there any functions in php for previewing.If anyone knows pls help..... Regards Rekha http://hiox.org Quote Link to comment Share on other sites More sharing options...
zenag Posted July 29, 2008 Share Posted July 29, 2008 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Untitled Document</title><script LANGUAGE="JavaScript"> function displayHTML(printContent) { var inf = printContent; win = window.open("print.html", 'popup', 'toolbar = no, status = no'); win.document.write(inf); win.document.close(); // new line } </script> </head> <body> <div id="printarea">Hello how r u? ...</div><a href="javascript:void(0);" onclick="displayHTML(document.getElementById('printarea').innerHTML)">Print Preview</a> </body> </html> Quote Link to comment Share on other sites More sharing options...
rekha Posted July 29, 2008 Author Share Posted July 29, 2008 Hi Thanks.It works.. Regards Rekha http://hiox.org Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.