ColdFusion Print button to default to landscape

Please view my print button code below. I'm trying to default to landscape without success.

Is there another method via ColdFusion instead of windows.print to accomplish landscape?


<style type="text/css">
    @media print {
      .noprint {
        display: none;
        size:landscape
         }
    }
  </style>


<input type='button' value='Print'   class='noprint' onClick='window.print()' style='width: 50'>
DJPr0Asked:
Who is Participating?
 
Gurpreet Singh RandhawaConnect With a Mentor Web DeveloperCommented:
check this post of mine:


http://randhawaworld.com/?p=33

You can use this custom Tag to detect Browser and using a cffif condition you can add different styles for the code

just add dump to see what values you are getting,
0
 
Gurpreet Singh RandhawaConnect With a Mentor Web DeveloperCommented:
try this:

Using landscape will ONLY work in Internet Explorer.

<style type="text/css" media="print">
.landScape
{
 width: 100%;
 height: 100%;
 margin: 0% 0% 0% 0%;
 filter: progid:DXImageTransform.Microsoft.BasicImage(Rotation=3);
}
.noPrint
{
     display: none;
}
</style>

<body class="landScape">
 <form id="Form1" method="post" runat="server">
  <!--  Markup -->

  <input type="button" class="noPrint" value="Print" onclick="JavaScript:window.print();" >
 </form>
</body>
0
 
DJPr0Author Commented:
It works with I.E. 8 but not 9.

Do you have any info on this?
0
Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

 
Gurpreet Singh RandhawaWeb DeveloperCommented:
No, But i will check if i can see how its not behaving proper in IE 9
0
 
Gurpreet Singh RandhawaConnect With a Mentor Web DeveloperCommented:
try with different rotations using a check if LT 9

filter: progid:DXImageTransform.Microsoft.BasicImage(rotation=1);
rotation=1 Content is rotated 90 degrees.

rotation=2 Content is rotated 180 degrees.

rotation=3 Content is rotated 270 degrees.

Might work?

you ca make a check in html file itself
0
 
DJPr0Author Commented:
you can make a check in html file itself

Do you have the code to check the version of the browser?
0
 
DJPr0Author Commented:
Thanks myselfrandhawa!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.