473,396 Members | 1,693 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

How to set landscape orientation while printing through javascript

Hi all,
Actually my requirement is that i need to print a page in landscape orientation , but i am unable to find solution for this through google.

So I tried to print the page by rotating the div by using the css
mydiv.style.filter='progid:DXImageTransform.Micros oft.BasicImage(rotation=3)'
It is working in IE but it's not working in Firefox

In firefox, images can be rotated by using <canvas> tag , so i can get if my div can be converted into an image on client side

Please help me in solving this ...

Thanks in advance
May 28 '08 #1
5 3715
gits
5,390 Expert Mod 4TB
i'm not aware of any possibility to convert html-content to an image on clientside ...

kind regards
May 28 '08 #2
acoder
16,027 Expert Mod 8TB
Yes, your best bet would be to use some server-side code to produce the image and return the src of the image via Ajax.
May 28 '08 #3
Thanks for your replies ,

Using server side code for converting a div into a image makes my page slow ,
Is there any other way for achieving this on client side.

Do u have any ideas for using this
mydiv.style.filter='progid:DXImageTransform.Micros oft.BasicImage(rotation=3)'
in firefox.

Or any way for printing my page in landscape orientation

Thanks in advance
May 29 '08 #4
gits
5,390 Expert Mod 4TB
since this is not standard there is currently no chance to get that working in FF. the best way would be to follow acoders advice or let the user decide the orientation in his/her print dialog ...

kind regards
May 29 '08 #5
acoder
16,027 Expert Mod 8TB
Using server side code for converting a div into a image makes my page slow ,
Which language are you using? Perhaps there are more efficient packages in the same or another language. Also, have you tried using Ajax?
Do u have any ideas for using this
mydiv.style.filter='progid:DXImageTransform.Micros oft.BasicImage(rotation=3)'
in firefox.
As gits said, this is non-standard - it's only supported in IE.

Or any way for printing my page in landscape orientation
There's no cross-browser way. You can get solutions for a specific browser in privileged/lower security settings. Perhaps it would be a better idea just to alert a message to the user to make sure that the landscape orientation option is selected.
May 29 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: gilga123 | last post by:
Trying & trying ad infinitum to print page in landscape mode from Java program - orientation is correct landscape but printing width will NOT go to landscape - always prints in portrait mode width...
0
by: gilga123 | last post by:
Trying & trying ad infinitum to print page in landscape mode from Java program - orientation is correct landscape but printing width will NOT go to landscape - always prints in portrait mode width...
6
by: Biguana | last post by:
Hi, Just wondering if anyone can help here. We have a site where most of the site opens in a window with no toolbars or menubar: window.open('mypage.aspx','self','toolbar=0, menubar=0, etc,...
5
by: cpopham | last post by:
I tried posting earlier and it never showed up.. I have a simple program to print a text file. I need to know how to change the page settings to landscape if it is not already in ladnscape mode. ...
12
by: Connor T | last post by:
Hi, I have a crystal report embedded in a viewer. How / Where can I set a property to make it default to landscape orientation? Rgds, Dan
4
by: Deano | last post by:
I'm in the situation of having to print a form - not a report. This will fit nicely in a landscape format but by default it prints portrait. Is there any code to make it play nice?
2
by: satnamsarai | last post by:
it is possible to change page orientation to landscape from asp.net page? I am using window.print() dialog to print a page and I would like that page to print automatically in landscape view.
5
by: gotonagle | last post by:
hi all i have one page that generates a report (basically a table ) in ASP.i have a button that prints that page using window.print(). now i want to print that page in landscape mode (by default its...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.