Link to home
Start Free TrialLog in
Avatar of laurent42
laurent42

asked on

print with landscape orientation

Hi,

I would like to add a button to one of my HTML pages that would allow the user by pressing on it to print the content of the page with landscape orientation.

I have tried to add the following code, but it is still printing the page in portrait mode.

Am I missing something or no doing things the way they should be done?

**********************
<head>
<style type="text/css">
<!--
@page {size: landscape}

@media screen {
   BODY {
          font-size:8pt;
          color:black;
     }
}
@media print {
   BODY {
          font-size:8pt;
          color:black;
     }
     input {
          display:none;
     }
}
//-->
</style>
</head>

and later in the page:
<input type="button" value="Print" onClick="javascript:self.print()">

**********************

Thanks.
ASKER CERTIFIED SOLUTION
Avatar of COBOLdinosaur
COBOLdinosaur
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
As Cd& said, the printer has to be set up that way on the machine doing the printing, it's nothing you can control.  Sorry.
Avatar of webwoman
webwoman

And yet another one...

You can't do it. You can try and try and try, and you CANNOT control the user's printer. Nor should you.

You want to explain to the company president why her report came out printed landscape? When she didn't want it that way, and never prints ANYTHING landscape?

I thought not... ;-)
BTW webwoman,

Congrats on making Hall of Fame

Cd&
This question has been abandoned. I will make a recommendation to the
moderators on its resolution in a week or two. I appreciate any comments
that would help me to make a recommendation.

Cd&
you were the first...
stand your printer up on one end...
It is time to clean this abandoned question up.  

I am putting it on a clean up list for CS.

<recommendation>
points to COBOLdinosaur

</recommendation>

If anyone participating in the Q disagrees with the recommendation,
please leave a comment for the mods.

Cd&
Thanks to all, finalized.
Moondancer - EE Moderator
Thanks Moon. :^)

Cd&