Solved

ColdFusion Print button to default to landscape

Posted on 2013-01-12
7
907 Views
Last Modified: 2013-02-04
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
Comment
Question by:DJPr0
  • 4
  • 3
7 Comments
 
LVL 16

Assisted Solution

by:Gurpreet Singh Randhawa
Gurpreet Singh Randhawa earned 500 total points
ID: 38771400
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
 

Author Comment

by:DJPr0
ID: 38772480
It works with I.E. 8 but not 9.

Do you have any info on this?
0
 
LVL 16

Expert Comment

by:Gurpreet Singh Randhawa
ID: 38777180
No, But i will check if i can see how its not behaving proper in IE 9
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 16

Assisted Solution

by:Gurpreet Singh Randhawa
Gurpreet Singh Randhawa earned 500 total points
ID: 38777185
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
 

Author Comment

by:DJPr0
ID: 38778995
you can make a check in html file itself

Do you have the code to check the version of the browser?
0
 
LVL 16

Accepted Solution

by:
Gurpreet Singh Randhawa earned 500 total points
ID: 38779770
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
 

Author Closing Comment

by:DJPr0
ID: 38851027
Thanks myselfrandhawa!
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
COLD FUSION 6 27
cfchart display 12 100
Comparing 2 Lists Coldfusion 8 53
coldfusion, javascript onclick url update 4 56
Hi, Even though I have created this Tutorial on My personal Blog, Some people might not able to find my website, So here i am posting it again Today, from the topic it is very clear that i will be showing you here the very basic usage of how we …
This is an updated version of a post made on my blog over 3 years ago. It is unfortunately, still very relevant as we continue to see both SQLi (SQL injection) and XSS (cross site scripting) attacks hitting some of the most recognizable website and …
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

825 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