Print This Page Button

  • 1
  • Idea
  • Updated 9 years ago
Hey,

I just thought of a few people who wanted this before so here's a code to add a 'print this page' button to your site.

Simply copy the below into the section of your page:

<!--
<SCRIPT Language="Javascript">

/*
This script is written by Eric (Webcrawl@usa.net)
For full source code, installation instructions,
100's more DHTML scripts, and Terms Of
Use, visit dynamicdrive.com
*/

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, 2);//Use a 1 vs. a 2 for a prompting dialog box WebBrowser1.outerHTML = "";
}
}
</script>

<SCRIPT Language="Javascript">
var NS = (navigator.appName == "Netscape");
var VERSION = parseInt(navigator.appVersion);
if (VERSION > 3) {
document.write('<form><input type=button value="Print this Page" name="Print" onClick="printit()"></form>');
}
</script>
-->
Photo of Connor McCarra

Connor McCarra, Champion

  • 944 Posts
  • 47 Reply Likes
  • happy

Posted 9 years ago

  • 1
Photo of Emmy

Emmy

  • 5892 Posts
  • 299 Reply Likes
Thanks Connor!
Photo of Alex

Alex

  • 3448 Posts
  • 39 Reply Likes
THanks connor but i cant get it to wrok, it says their is an error with my code.
Photo of IrvinS.

IrvinS.

  • 26 Posts
  • 1 Reply Like
Thanks, but won't that promote copyright intruding?
And, won't that promote the usage of papers?
Bad day for the environment.
Photo of Peter

Peter

  • 2569 Posts
  • 113 Reply Likes
hello irvin,

The environment is important of course. There are things that we feel need to be printed as hard copy. This is a way to do this. I don't feel it's promoting irresponsible environmental practice.

Copyright is as easily violated onscreen as it is in hardcopy. In fact I would say easier. Once again it comes down to the users sense of respect and responsibly. I don't think web-authors are the Legal watchers but are very aware of legal traditions of intellectual property.

So I can' really agree with either of your comments.
Photo of Monique

Monique, VP of Customer Support

  • 6294 Posts
  • 446 Reply Likes
We do get requests from this in support from time to time. So if you actually WANT people to be able to print your page for some reason, here is some simple script you can paste into the HTML widget that seems to do the trick:

<!--
<a href="javascript:window.print()" rel="nofollow">Print This!</a></span>
-->
Photo of Donald

Donald

  • 2991 Posts
  • 37 Reply Likes
does this 'print this page" button print only what a normal user would want to print or does it also print the website's banner and menu?
Photo of Donald

Donald

  • 2991 Posts
  • 37 Reply Likes
most people that want to print this page does NOT want the website's banner and menu and preferably not anything but text and pictures which go along with the text.