Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 932
  • Last Modified:

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'>
0
DJPr0
Asked:
DJPr0
  • 4
  • 3
3 Solutions
 
Gurpreet Singh RandhawaWeb 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
 
Gurpreet Singh RandhawaWeb DeveloperCommented:
No, But i will check if i can see how its not behaving proper in IE 9
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
Gurpreet Singh RandhawaWeb 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
 
Gurpreet Singh RandhawaWeb 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
 
DJPr0Author Commented:
Thanks myselfrandhawa!
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now