Solved

Printing from IE

Posted on 2004-08-03
15
355 Views
Last Modified: 2010-04-06
Is there a way to change the paper orientation in script for printing? I want to print a webpage in Landscape mode, and my users are complaining that they have to alter the orientation manually.
0
Comment
Question by:CaptainRantflaps
[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
  • 5
  • 3
  • 2
  • +2
15 Comments
 
LVL 33

Accepted Solution

by:
sajuks earned 50 total points
ID: 11702553
<html>
<head>
<title>Landscape Printing</title>
<style type="text/css" media="print">
<!--
div.page  {
writing-mode: tb-rl;
height: 80%;
margin: 10% 0%;
}
-->
</style>
</head>
<body>
<div class="page">
<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed
diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam
erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation
ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie
consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto.</p>
</div>
</body>
</html>
0
 
LVL 33

Expert Comment

by:sajuks
ID: 11702568
Another way (IE only ) would be using  class "rotator".
or check out http://www.meadroid.com/scriptx/index.asp
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Rotate Page</title>
<style>
@media print { .rotator {filter:progid:DXImageTransform.Microsoft.BasicImage(Rotation=1)} }
</style>
</head>
<body>
<table class="rotator"><tr><td>
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed
diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam
erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation
ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat.
Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie
consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto.
</td></tr></table>
</body>
</html>
0
 
LVL 5

Author Comment

by:CaptainRantflaps
ID: 11702615
Both of these seem to alter an individual div or table, not the whole page, is there anyway to to the whole page as i have multiple controls etc created in asp.net
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 33

Expert Comment

by:sajuks
ID: 11702641
Use the first example.
Enclose the whole inside the div. The second example is meant only for pages and tables.
You can also check out http://www.meadroid.com/scriptx/index.asp

<div class="page">
controls a
control b
-----
------
</div>
0
 
LVL 2

Expert Comment

by:Michael_Cicogna
ID: 11702693
Hi

Try this:

<style type="text/css">
  @page { size:landscape; }
</style>

Michael
0
 
LVL 5

Author Comment

by:CaptainRantflaps
ID: 11702750
HI Michael, Sorry i cant get that to work.
0
 
LVL 33

Expert Comment

by:sajuks
ID: 11702762
@Michael_Cicogna , did you check the style ? It was my understanding that it was not implemented.
http://www.csscreator.com/attributes/properties/size
0
 
LVL 19

Expert Comment

by:webwoman
ID: 11704543
Basically, you can't. The user has to change the orientation when they print.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 11708520
You could try the rotation this way:

<style>
@media print { body {filter:progid:DXImageTransform.Microsoft.BasicImage(Rotation=1)} }
</style>

it will be unreliable if it does work and will not be consistent accoss pages; and if it needs page breaks it will be a real mess.

The activex script already suggested is the most common solution FOR INTRANET APPS, but accross the Internet is forces the user to have activex enabled which exposes thenm to numerous security threats that Microslop has not address.  Even on intranet activex is risky because of cross zone exploits that can be delivered on web pages.

In the end whatever you use, you may find you users quit complaining about haveing to do it manually, because with manual they reliably get what they expect without any hassle.

Cd&
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 12067651
sajuks activex solution is generally the preferred answer to this.

Cd&
0
 
LVL 33

Expert Comment

by:sajuks
ID: 12071623
Thank you  Cd for your comment
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 12191626
It only requires a search of the PAQ to know that the answer to this is and always has been "you can't do that".  All the workarounds have been provided.  The points should be awarded to sajuks with an A. Anything else would be unfair to the expert who gave a good faith effort to provide the best solutions available on a low point question.

Cd&
0

Featured Post

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
WCAG audit tools 1 120
Problem to page 4 103
What language/protocol is the Angular Chat? 2 106
What does GoogleTagMgr javascripts below do 5 84
Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

738 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