?
Solved

How can I print a rotated image?

Posted on 2011-05-02
7
Medium Priority
?
356 Views
Last Modified: 2012-05-11
I have an image that I can rotate using the code I've attached.  The image is usually upside down and with the code attached, I can rotate it so it's right side up, but when I print the image using the javascript window.print() code, the image prints like it originally was, upside down, it won't print rotated.  Can anyone help me to print the image after I rotate it?  Thank you!!
<script type="text/javascript">
            function Rotate(obj)
            {                        
              obj.style.filter = 'progid:DXImageTransform.Microsoft.BasicImage(rotation=2)';
            }
</script>

<a href="Javascript:window.print()">Print Report</a>

Open in new window

0
Comment
Question by:Cashmgmt
  • 4
  • 3
7 Comments
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 35510178
Your users cannot rotate the paper after it comes out of the printer?
I think you will need to change the classname and have the filter in css instead.
0
 

Author Comment

by:Cashmgmt
ID: 35513696
would you have an example of how I would do the css filter?
0
 
LVL 75

Accepted Solution

by:
Michel Plungjan earned 2000 total points
ID: 35514469
Something like

<style>
.rotated {filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2) }
</style>

<img src="report.jpg" id="reportImage" />
<a href="#" onclick="document.getElementById('reportImage').className='rotated'; return false">Rotate Report</a>
<a href="#" onclick="window.print(); return false">Print Report</a>
0
Industry Leaders: 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!

 

Author Comment

by:Cashmgmt
ID: 35515146
I tried the sample above, but when printing it prints the image as it was before I rotated it.
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 35515246
Does the link I gave, rotate it?
0
 

Author Comment

by:Cashmgmt
ID: 35515271
yes it does.  but when i print it, it's not rotated anymore.
0
 
LVL 75

Expert Comment

by:Michel Plungjan
ID: 35515276
Alternative is to send the request to the server and return a rotated image
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

Question has a verified solution.

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

Is your Office 365 signature not working the way you want it to? Are signature updates taking up too much of your time? Let's run through the most common problems that an IT administrator can encounter when dealing with Office 365 email signatures.
Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.
The viewer will the learn the benefit of plain text editors and code an HTML5 based template for use in further tutorials.
Suggested Courses

830 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