Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automatically print Landscape orientation

Status
Not open for further replies.

StuckInTheMiddle

Programmer
Mar 3, 2002
269
US
I have a simple problem, which i thought had a simple solution. Use CSS to set the page output when printed to be landscape as below.

BODY {
Size: 8.5in 11in landscape;
Margin: 0.25in; }

But this doesnt appear to work for me, ive tried it in both IE6 or Netscape 7. Several online sources say it should so i was wondering does anysee anything i am doing wrong. Ive dried saying 11in 8.5in and with landscape and also the @PAGE directive too, with no joy.

Any help appreciated, i cant be this hard to print something in Landscape!

(The more ASP.NET I do, the more Javascript I find myself using)
 
this is new waters for me.

try adding media="print" in your style tag.

<style media=&quot;print&quot;>
/* css here */
</style>

It might not work at all. Check to see if any browsers support this CSS. It might be too recent of a standard that is not yet implemented too. Try the media=&quot;print&quot; thing and if that doesn't work I wouldn't know what to tell you.

Someone probably knows better than I do here. Gary Haran
 
Hi Gary,

I had previously tried media print, thanks for your advice tho, and yes it does indeed look like its too new a CSS standard to be supported.

I must admit I thought the need to print a page LANDSCAPE would have been a core requirement, oh well, c'est la vie, as the french canadian's say.


(The more ASP.NET I do, the more Javascript I find myself using)
 
I've previously used external style sheets with success however cannot confirm cross browser compatibility

The links I used are

<link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=css/styles.css&quot; media=&quot;screen&quot; />

<link rel=&quot;stylesheet&quot; type=&quot;text/css&quot; href=&quot;css/printpage.css&quot; media=&quot;print&quot; />

And the style within the printpage.css should be

size : landscape;

This I have not tried, but merely gleaned from a web search and via Homesite / TopStyleLite

Hope it helps / works

:)
 
The use of external style sheets is not the issue here. Browser support of the CSS standard for printing in landscape is.

The above doesn't work, i had previsouly seen and tried the example you mention.

Thanks, close but no cigar ;)


(The more ASP.NET I do, the more Javascript I find myself using)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top