Forum Moderators: open

Message Too Old, No Replies

Print website from browser

         

yllai

2:25 am on May 20, 2004 (gmt 0)

10+ Year Member



I have using javascript as below to create a print button, after user click on the button, the page will be print out. In the print out, at the top I can see the title of the page and the number of page, at the bottom I can see the website URL and the date. If I want the page to be print without all of these that means print out should look as we print with mircosoft word application, how can I do it? any example?

Thanks.

/*****************************************************/
//code for printing (java script)
<SCRIPT LANGUAGE=\"JavaScript\">
<!-- hide script and begin
if (window.print) {
document.write('<form><center>Click Here To '
+ '<input type=button name=print value=\"Print\" '
+ 'onClick=\"javascript:window.print()\"> This Page!</center></form>');
}
// End hide -->
</script>";
/*****************************************************/

Rambo Tribble

5:11 am on May 20, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Unfortunately, that aspect of the print formatting is at the discretion of the browser, and outside of the control of JavaScript or CSS.

brucec

2:57 pm on May 21, 2004 (gmt 0)

10+ Year Member



I tried this using PHP and ASP, but still had no luck. Even manually, I could not turn it off in Internet Explorer.

Maybe, Microsoft will wake up to this in the near future.

Sanenet

2:58 pm on May 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Can't be done. I remember reading that the reason was that anything being printed from the page should have that page information on for future reference - otherwise use a format such as PDF for document download and printing.