balachander_j Posted May 17, 2007 Share Posted May 17, 2007 Hi all, I have a page which contains editorial content in it....If i try to print that page,i need the page printed without the editorial content.I am really confused how to do....can someone help me out.......... Regards.. Link to comment https://forums.phpfreaks.com/topic/51821-doubt-on-editorial-content/ Share on other sites More sharing options...
Lumio Posted May 17, 2007 Share Posted May 17, 2007 You can do that with CSS Try Google to search for css media Link to comment https://forums.phpfreaks.com/topic/51821-doubt-on-editorial-content/#findComment-255351 Share on other sites More sharing options...
AV1611 Posted May 17, 2007 Share Posted May 17, 2007 You can both do page breaks and omit sections of html with this <STYLE TYPE="text/css"> P.breakhere {page-break-before: always;} @media print { .cssclsNoPrint {display:none} } </STYLE> <br> <<<snip>>> Begin html code that is to be printed <<<snip>>> <P CLASS='breakhere'> <<<snip>>> Begin html code that is to be printed <<<snip>>> <P CLASS='breakhere'> <span class="cssclsNoPrint"> stuff you don't want printed here </span> <span class="cssclsNoPrint"> <script language="Javascript" type="text/javascript"> // This Script puts a Print Screen Button on the page function printit(){ if (window.print) { window.print() ; } else { var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"><\/OBJECT>'; document.body.insertAdjacentHTML('beforeEnd', WebBrowser); WebBrowser1.ExecWB(6, 1);//Use a 1 vs. a 2 for a prompting dialog box WebBrowser1.outerHTML = ""; } } </script> <script language="Javascript" type="text/javascript"> var NS = (navigator.appName == "Netscape"); var VERSION = parseInt(navigator.appVersion); if (VERSION > 3) { document.write('<form><input type=button value="Print Report" name="Print" onClick="printit()"><\/form>'); } </script></span> Link to comment https://forums.phpfreaks.com/topic/51821-doubt-on-editorial-content/#findComment-255421 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.