Page 1 of 1
Web Printing
Posted: Sat Feb 18, 2006 2:13 pm
by icesolid
I want to print out tickets one per page, I was just wondering what is the height in pixels that prints out on a printer, I tried making my td cell height=792 but that isent working.
Posted: Sat Feb 18, 2006 2:23 pm
by John Cartwright
Each printer/browser/OS whatever can be different. The bottom line is never rely on width/height to determine pages.
There is however a CSS attribute
Code: Select all
page-break-after:always;
page-break-before:always;
e.g.
Code: Select all
Page 1
<br style="page-break-before:always;">
Page 2
<br style="page-break-after:always;">
Page 3
Note: to view the output.. go to print preview
Posted: Sat Feb 18, 2006 2:32 pm
by feyd
however, some browsers may not follow those directives. So alternates should be available, such as displaying it a page at a time for them to print, offering them a PDF of the tickets (dynamically generated), etc
Thanks
Posted: Sat Feb 18, 2006 3:19 pm
by icesolid
Well I tested this code in IE and it works great, thanks!
As far as other browsers go, I am not concerned about that because this site is for company useonly, and I know that all of their computers are running Windows XP with the latest IE.
Thanks again, a handy little bit of code!
Posted: Sun Feb 19, 2006 6:46 am
by onion2k
Seriously .. it's WAAAAAAAY too much hassle to get a browser to do this sort of thing. Generate a PDF file instead. It's considerably less effort in the long run and looks nicer too.
I Like It!
Posted: Wed Feb 22, 2006 1:43 pm
by icesolid
I don't know about that...I found that code very easy to use and works in newer browsers such as Internet Explorer and Netscape 7.0 and up.
I'm not worried about Mozilla browsers (I haven’t tested) because I am SURE that none of the users of this site are going to be using that browser. This site will be running on desktops at the location and laptops offsite all running the latest Internet Explorer.
On top of that, its time for all of those old school computer junkies to update their browsers, get with the program yawl! I think that newer browsers are plenty safe for the average computer user and offer the ability to run the latest enhancements of the web.
Posted: Wed Feb 22, 2006 2:33 pm
by MinDFreeZ
u can also use alternate stylesheet or just a small section with media="print" and change some stuff in the css for when it's printed... never heard of that page-break thing.. sounds cool though

Posted: Wed Feb 22, 2006 2:34 pm
by matthijs
I'm not worried about Mozilla browsers....
... its time for all of those old school computer junkies to update their browsers
i am deeply offended as a Mozilla 1.7.12 user!!!
