• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Printing a browser-page in landscape mode

 
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi folks,
I have requirement for my current project, which needs user to print the page in LANDSCAPE mode. User o/s is Windows, browser is IE 6. I have tried using {WScript.Shell} but of no use, as that leads me to Printer-model specific setting. I want to get an ENUM of windows default-printer properties, and then pass a printer-property which will set the page orientation as "landscape". Please pass me suggestions.

I have tried this options:
<style type="text/css" media="print">
page {
size:landscape;
}
</style>
------------------------------------
<script>
var shell = null;
function SetPrintProperties() {
try {
shell = new ActiveXObject("WScript.Shell");
shell.sendKeys("^p");
setTimeout("shell.sendKeys('%R')",1000);
setTimeout("shell.sendKeys('%L')",1100);
//setTimeout("shell.sendKeys('{ENTER}')",1200);
//setTimeout("shell.sendKeys('{ENTER}')",1300);
}
catch (e) {
alert ("An exception occured: " + e + "\nCode is: " + e.number + "\nDescription is: " + e.description);
}
}
</script>
 
Subhadip Chatterjee
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi folks,
Does anybody have any answer to the question I posted before. I hope someone might have faced this before, and can feed me with a solution!!!
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Only way I have seen it done wih with comercial ActiveX controls. Other than that I can not give you help. When css 3 is supported, we will not have to do this stuff.

Eric
 
Subhadip Chatterjee
Ranch Hand
Posts: 93
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Eric, I appreciate that. When you said "commercial API", it certainly needs a license to run on a machine. But I have no option for buying a license at this stage of project. anyway, thanks for the response.
reply
    Bookmark Topic Watch Topic
  • New Topic