Printer Friendly JavaScript

  livewire 16:31 03 Nov 05


I am trying to find something like a JavaScript that will enable me to have a "Print page" button that will remove all the unessecary pictures and flash menus from a page so that it can be printed properly when a user goes File>Print in Internet Explorer.

Currently, when I go to choose file > print the text gets cut off as it isnt formatted properly on the page.

Do you know if something like this can be achieved using JavaScript -- or perhaps, by some other method?


  Forum Editor 17:59 03 Nov 05

what you mean by "unnecessary pictures and Flash menus" - a script isn't going to know what's necessary or otherwise.

Here's the script to put a button on your page. Put it between <body> and <body> at the point on the page where you want the button to appear:-

<!-- Begin
if (window.print) {
document.write('<form>Click here to'
+ '<input type=button name=print value="Print" '
+ 'onClick="javascript:window.print()"> this page</form>');
// End -->

  livewire 18:43 03 Nov 05

If you go to click here and go file>print in Internet Exlporer you can see that the text is cut off the page. Thats the problem im trying to fix...

Oddly, it works fine in Firefox :/ ?

  livewire 19:24 08 Nov 05

I was wondering whether something like this might do the trick - but i'm not sure whether it could be implemented successfully?

click here

This thread is now locked and can not be replied to.

Nintendo Switch (Nintendo NX) release date, price, specs and preview trailer: Codename NX console…

1995-2015: How technology has changed the world in 20 years

8 things designers (and brands) need to know about the modern woman

How to speed up a slow Mac: 19 great tips to make an iMac, MacBook or Mac mini run faster | Speed…