Two Laptop Bag*
The moose likes HTML, CSS and JavaScript and the fly likes Using CSS to default print style to landscape Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Using CSS to default print style to landscape" Watch "Using CSS to default print style to landscape" New topic
Author

Using CSS to default print style to landscape

Corey McGlone
Ranch Hand

Joined: Dec 20, 2001
Posts: 3271
I'm trying to print a page of a web application and, because this page includes some rather wide tables, I'd like to use CSS to default the page to print in a landscape format, rather than requiring the users to change it every time they want to print.

I found some documentation online and, as best I can tell, adding this to my CSS file:



should do the trick. Unfortunately, it doesn't. When I bring up the Print Preview window, I still get the portrait view. What am I doing wrong? Anyone know how to accomplish this?

Thanks,
Corey


SCJP Tipline, etc.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
I think the only browser that supports that is Opera.

Eric
Corey McGlone
Ranch Hand

Joined: Dec 20, 2001
Posts: 3271
Originally posted by Eric Pascarello:
I think the only browser that supports that is Opera.


Hmmm...bummer. So any solution this this problem in IE? Or does the user simply have to select Landscape any time he/she wants to print?
Garann Means
Ranch Hand

Joined: Jan 28, 2002
Posts: 214
There are ActiveX objects you can get that fiddle with the default print settings. So if IE's your only concern, those work.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Using CSS to default print style to landscape
 
Similar Threads
printing page in landscape without changing preferences.
Help about PageFormat (Print)
How to Print Web page Landscape using JAVAScript
i've tried this but it won't works please help...
Printing from a jsp page- java attributes...?