Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with gAutoPrint 1

Status
Not open for further replies.

DKailen

Technical User
Mar 6, 2010
13
0
0
US
Hi all,

I am trying to use gAutoPrint to print a section of a web page. It works almost the way I want except that when I try to print, it centers everything on the page. The text is not centered on the web page itself though.....

Any suggestions? The page is located at
Thanks!
Jim
 
I suspect the reason it's going pear-shaped is that, for some crazy illogical and downright stupid reason, the script copies the contents of the page into a new DOM without the DOCTYPE, rather than just simply printing what's on the page you're already viewing.

My advice: ditch that crazy, archaic, and outdated script and just use a plain old print style sheet instead.

Get rid of the JS needed to print, and just let users press their own 'print' button, or Ctrl-P, or whatever it is they're used to using.

P.S. You can tell that script is really bad simply by viewing the source:

Code:
alert("The print ready feature is only available if you are using an browser. Please update your browswer.");

Well duh! How else would you be viewing the web page if not through a ("an", sic) web browser?!

For help with print style sheets, ask in forum215 or search about on Google, etc.

Hope this helps,
Dan



Coedit Limited - Delivering standards compliant, accessible web solutions

Dan's Page [blue]@[/blue] Code Couch:
Code Couch Snippets & Info:
The Out Atheism Campaign
 
Strange that the thought of doing that never crossed my mind.... Anyway, thanks for the assist!

Jim
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top