Solved

print with landscape orientation

Posted on 2002-04-18
10
1,904 Views
Last Modified: 2007-12-19
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.
0
Comment
Question by:laurent42
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
10 Comments
 
LVL 53

Accepted Solution

by:
COBOLdinosaur earned 50 total points
ID: 6951070
IE5.5+ only

With @page you declare sizing in units of measure size 11in 8.5in  
landscape would not work AFAIK

However that will still not solve the problem.  The page will not print correctly unless the printer is set up in landscape mode.

If you are on an intranet where you can insure that all printers are set up exactly the same you may be able to get decent printing.  Across the internet forget it, you do not have enough control of the environment of the client to insure proper printing. If print quality is critical, do not us an HTML page; use a PDF or other printer friendly format.

Cd&
0
 
LVL 18

Expert Comment

by:bruno
ID: 6952013
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.
0
 
LVL 19

Expert Comment

by:webwoman
ID: 6953899
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... ;-)
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 6953975
BTW webwoman,

Congrats on making Hall of Fame

Cd&
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7047964
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&
0
 
LVL 18

Expert Comment

by:bruno
ID: 7049462
you were the first...
0
 
LVL 2

Expert Comment

by:TenTonJim
ID: 7072001
stand your printer up on one end...
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7101900
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&
0
 
LVL 1

Expert Comment

by:Moondancer
ID: 7112309
Thanks to all, finalized.
Moondancer - EE Moderator
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 7112316
Thanks Moon. :^)

Cd&
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Creating a CSS block that only applies to printing By default, all of your CSS applies to every possible view of your page - whether on screen, printed, landscape, touch-screen, or whatever.  You can, however, add CSS that only applies under certai…
As a result of several questions about how to use Bootstrap I thought it would be a good idea to write down the development aspect of creating a Bootstrapped website in as little time as possible. Part 1 of this article will only concentrate on g…
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question