j4ymf Posted May 21, 2005 Share Posted May 21, 2005 hello all i was wondering if anyone new of any code that could help me force a page to print in landscape format, what i mean is i have some tables on my webpage and when i press print, it prints in portrait. is there any code that i can put in to tell the printer to print landscape? many thanks jason Quote Link to comment https://forums.phpfreaks.com/topic/2318-force-a-web-page-to-print-in-landscape/ Share on other sites More sharing options...
Volte Posted May 22, 2005 Share Posted May 22, 2005 http://www.experts-exchange.com/Web/Web_La...Q_20972638.html Hope that helps, seems pretty impossible. Quote Link to comment https://forums.phpfreaks.com/topic/2318-force-a-web-page-to-print-in-landscape/#findComment-7601 Share on other sites More sharing options...
ober Posted May 23, 2005 Share Posted May 23, 2005 Short answer, no. Long answer is that it is possible, but only in IE and they have to use a button you put on the page.... and it relies on ActiveX. http://www.meadroid.com/scriptx/intro62.asp I rely on the free version where I work and I can force everyone to use IE to print reports. It works great. I wouldn't push this off to the general public however, since it requires them to accept a software install and use your print buttons. I'd suggest either using PDF or trashing the idea altogether. Quote Link to comment https://forums.phpfreaks.com/topic/2318-force-a-web-page-to-print-in-landscape/#findComment-7606 Share on other sites More sharing options...
czambran Posted May 23, 2005 Share Posted May 23, 2005 ALWAYS visit the www.w3schools.org before saying something is not possible on CSS. There are a subset of CSS that applies to printing documents, and yes u can through css print a document on landscape. w3schools Short answer, no. Long answer is that it is possible, but only in IE and they have to use a button you put on the page.... and it relies on ActiveX. http://www.meadroid.com/scriptx/intro62.asp I rely on the free version where I work and I can force everyone to use IE to print reports. It works great. I wouldn't push this off to the general public however, since it requires them to accept a software install and use your print buttons. I'd suggest either using PDF or trashing the idea altogether. 236422[/snapback] Quote Link to comment https://forums.phpfreaks.com/topic/2318-force-a-web-page-to-print-in-landscape/#findComment-7608 Share on other sites More sharing options...
ober Posted May 23, 2005 Share Posted May 23, 2005 Ooohh... lookie, a CSS2 attribute. How about we talk about something that works well AND degrades well, huh? ALWAYS consider the user when pointing someone to a relatively recent addition to the standard. EDIT: Might I also add that it will not force your printer to print in a landscape mode. You cannot control the user's printer settings through CSS. ALWAYS double check the desires of the OP and the functionality of your supposed answers before posting your arrogant [removed]. edited by czambran: Removed crude language Quote Link to comment https://forums.phpfreaks.com/topic/2318-force-a-web-page-to-print-in-landscape/#findComment-7609 Share on other sites More sharing options...
czambran Posted May 23, 2005 Share Posted May 23, 2005 First of all the CSS Print Properties are supported by most browsers except IE(like so many other properties). You should try it, it will actually print a page on either landscape or portrait. I think the user can override this by going to page setup, and please stop using crude language. We are suppose to be intelligent people, who can have an argument without insulting each other. The previous post is the second post of the DAY I had to edit. Quote Link to comment https://forums.phpfreaks.com/topic/2318-force-a-web-page-to-print-in-landscape/#findComment-7610 Share on other sites More sharing options...
ober Posted May 23, 2005 Share Posted May 23, 2005 I did try it. I tried it on 2 major browsers (IE and Opera, both the latest releases), and guess what? It didn't do anything. And if you're seriously going to sit there and say that someone should use code that doesn't work in IE, I'm going to sit here and laugh at you. You and I might know better, but half the world still uses IE. Quote Link to comment https://forums.phpfreaks.com/topic/2318-force-a-web-page-to-print-in-landscape/#findComment-7611 Share on other sites More sharing options...
Barand Posted May 24, 2005 Share Posted May 24, 2005 <body> <DIV> Hello world </DIV> <DIV style="width: 800px; border: 1pt solid red; size: landscape; page-break-before: always"> Should be landscape </DIV> <DIV style="size: portrait; page-break-before: always"> Hello again, world </DIV> </body> I agree with Ober. I tried the above with IE6 and it doesn't work. It just truncates the wide div and doesn't even print the missing bit on a new page. It's a fact of life that there is a lot of IE out there. IF you are working on a corporate intranet and can impose a more compliant browser on the user population then fine, use the CSS. Otherwise take careful note of which bits of CSS are usable with IE (eg page breaks work ok) Quote Link to comment https://forums.phpfreaks.com/topic/2318-force-a-web-page-to-print-in-landscape/#findComment-7612 Share on other sites More sharing options...
clartsonly Posted April 24, 2006 Share Posted April 24, 2006 hello I felt compelled to answer this even though it is really quite old, as I was looking for the same thing, and also did a few years ago. check this link [a href=\"http://web.tampabay.rr.com/bmerkey/examples/landscape-test.html\" target=\"_blank\"]http://web.tampabay.rr.com/bmerkey/example...scape-test.html[/a] just in case people are still looking for the answers Quote Link to comment https://forums.phpfreaks.com/topic/2318-force-a-web-page-to-print-in-landscape/#findComment-30143 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.