View Full Version : printing the webpage in landscape

04-11-2005, 06:12 AM
When we use window.print();,it prints the webpage taking the orientation as portrait.But i want it in landscape.We can do this mannually by setting the print format.But i want this to be done programmatically.Is it possible?
If yes,please help me in doing that.

thank u.

04-11-2005, 08:43 AM
Technically, it is possible for IE to utilize print template behaviors (C++).
The Windows Common Dialog Control and Windows Management Instrumentation provide interfaces for setting print properties from JScript (but are restricted to use with MSHTA, or WSH).

04-11-2005, 09:56 AM

I am not clear with your answer.Could you explain it more.If possible please make me to understand with javascript code.

Thank u

04-11-2005, 10:54 AM
Essentially, this has little or nothing do with JavaScript. As far as ActiveX goes, the issue is one of understanding a given COM class--its properties methods and events--and how the host application exposes them, or if it allows them to be... Internet Explorer generally does not. Two instances where it does are through the WebBrowser Control (Print Templates (http://msdn.microsoft.com/workshop/browser/hosting/printpreview/reference/reference.asp) & C++), and MSHTA (http://msdn.microsoft.com/workshop/author/hta/hta_node_entry.asp) (via commonDialog (http://msdn.microsoft.com/library/en-us/vbcon98/html/vbconcommondialogcontrol.asp), or WMI -- or WebBrowser via WSH, etc.). Basically all limited to non-internet use. There may be other options through .Net/Server-Side technology, however... :)

04-11-2005, 10:57 AM
if you use CSS paged media, you can set up the printer to print in landscape.

04-11-2005, 12:05 PM
hi JBot,

I even tried with css2,but i could not make it.so please help me inthis.

thank u,

04-12-2005, 05:15 AM

04-12-2005, 05:33 AM
I read somewhere that only Opera supports "size" orientation...