tgreer
Made Her Cry
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37
I'm confused how one can set the page orientation of a website. One can simply stretch a browser window to any shape and size they want and if relative values are used for tables and such, the text will stretch along with the window.
cscgal
The Queen of DaniWeb
19,437 posts since Feb 2002
Reputation Points: 1,474
Solved Threads: 230
I'm confused how one can set the page orientation of a website. One can simply stretch a browser window to any shape and size they want and if relative values are used for tables and such, the text will stretch along with the window.
Dani,
You can apply CSS style rules to create a custom-sized print box. What you cannot do is force the Print Dialog box to default to landscape. CSS and/or JavaScript cannot reach into the system resources.
tgreer
Made Her Cry
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37
Oh I see what you're saying. Use JavaScript to load the print dialog box. Gotcha there ;)
cscgal
The Queen of DaniWeb
19,437 posts since Feb 2002
Reputation Points: 1,474
Solved Threads: 230
No, not quite. The CSS specification allows you to set styles that come into play when the user Prints. So the site may display one way, but when you print, certain elements will be excluded, etc.
tgreer
Made Her Cry
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37
There is no way to do this. Print orientation is something the USER specifies, via their print dialog box. You cannot and should not want to control this. The answer is to specify a print style sheet that formats the document in such a way that landscape orientation is not required.
This falls into the same category of developers wanting to "disable" the user's Back button. That's a no-no. That's part of the USER interface. The proper way to handle the situation is to assume they MIGHT press BACK, and write code to handle that eventuality.
You cannot FIX a problem by BREAKING user functionality.
tgreer
Made Her Cry
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37
You're posting in a thread that's over a year old... and I don't see a question in your post. Would you mind starting a new thread, and ask your question, if you have one, there?
tgreer
Made Her Cry
2,118 posts since Dec 2004
Reputation Points: 227
Solved Threads: 37
This function belongs to the user, not the webmaster. If the user wants a landscape print, he can open the file menu and select it.
Remember that some users have printers which don't do landscape orientation.
MidiMagic
Nearly a Senior Poster
3,319 posts since Jan 2007
Reputation Points: 730
Solved Threads: 182