View Full Version : pop-up window to print document
maria2005
06-15-2005, 02:55 PM
Hi
I have a list of datasheets, when I click on a link for a datasheet it takes me to the page and display all info. Now I want to add a print button that brings up the datasheet in a pop up window and prints the whole page landscape. Cause at the moment when you pres ctrl +p it prints portrait and misses out 1inch from right hand side, so text missing.
Does anyone have any ideas?
Many thanks
Maria :confused:
nikkiH
06-15-2005, 06:50 PM
If this is for the web, using client-side javascript, you do not have control of my printer. You cannot specify my options. You don't even know if I HAVE a printer. :D
Only way to get this level of control is with ActiveX (http://www.meadroid.com/scriptx/docs/printdoc.htm) or something else that can talk with the OS. It won't be cross-browser or cross-platform by definition.
maria2005
06-17-2005, 09:44 AM
huh?
Maybe I didn't explain the situation well. When ppl view my site I want them to be able to print page to the correct size of the document. At the moment when you go to the selected page and click on the browser print option at the top of the page it prints portrait and misses off an inch from the right hand side.
Just want a print friendly version page, which displays image and text script.
_Aerospace_Eng_
06-17-2005, 10:12 AM
You can try using CSS to do what you want but I'm not too sure how many browsers support this method (http://www.w3.org/TR/REC-CSS2/page.html#page-size-prop).
nikkiH
06-17-2005, 02:59 PM
CSS is your friend.
The @media print sheet should help control how the page is laid out so that when it prints, it fits.
I rather like this (http://www.alistapart.com/articles/goingtoprint/) tutorial.
But you can't control how a printer prints, ultimately. You can only suggest. The user can override things.
Sorry I kinda jumped. I get a bit pissy when people seem to want to control my UI or printer.
sesshyzkidz
06-17-2005, 04:45 PM
Though you can't control the settings of a UA, you can control what is output USING those settings. If a person had printed a small picture from the Web and she/he had set the margins just big enough to print the picture and forgot to set them back, your page would be a really small page when printed from that person's computer. This is why I recommend adding a comment in your document (if possible) about using the Print Preview feature that most UA's (usually browsers) include.
nikkiH
06-17-2005, 06:30 PM
Exactly.
I discovered @media print a while back and now I love it. But you have to be aware that no matter how "nice" you try to make it for people, their settings that you can't control might be mudging things up. A simple plain text notice telling people how to make your stuff work even better is never wasted, IMO.
ArcticFox
06-20-2005, 04:02 AM
Aren't PDF documents printed exactly as shown on the browser? DMV, IRS, FCC all use it for their online documents... seem to print the same no matter what my settings are.
If this is for the web, using client-side javascript, you do not have control of my printer. You cannot specify my options. You don't even know if I HAVE a printer.
nikkiH: LOL! Take a pill.
vBulletin® v3.8.2, Copyright ©2000-2012, Jelsoft Enterprises Ltd.