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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

portorait printing 1

Status
Not open for further replies.

blueindian1

Programmer
Apr 24, 2001
150
US
Hello,

Can someone tell me how to set up a page such that when someone prints it it will automatically print portrait? Also, can i adjust the printing margins?

Thanks,

Rich
 
hey i dont get it...

here what i put in my style sheet:

Code:
   .page{
    	 size: landscape;
   }

and in my page
Code:
<body class=&quot;page&quot;>

but it prints portrait. what gives?
 
Do this instead:
body{
size: landscape;
}

Rick If I have helped you just click the first link below to let me know :)
 
Actually, according W3C specifications, you should set the printing properties using an @page selector. For example:

<style type=&quot;text/css&quot;>
@page { size:landscape; margin:4cm }
</style>

As you can see above, you can use the &quot;margin&quot; property on @page just as you would with any block-box. You can also set &quot;margin-top&quot;, &quot;margin-right&quot;, &quot;margin-bottom&quot; and &quot;margin-left&quot; separately if you want. Measurements can be made in centimetres, inches, points (pt), picas (12pt each), pixels... and others. Consult the w3c specs for more details ( -----------------------
*doink!*
 
I've been using ScriptX for print formatting. It's an ActiveX control that allows you to override the print settings already set in a browser. With ScriptX, you can use factory.printing.portrait = true/false to set the orientation. This is in no way a plug/advertisement - just something I found helpful.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top