Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Set Landscape for print?

Status
Not open for further replies.

markdmac

MIS
Dec 20, 2003
12,340
US
I have a very simple function I am using to print the current web page.

Here is my code
Code:
    <script language="JavaScript">
    function prt(){
    	window.print()
    }
    </script>

I would like to be able to configure the print properties to use landscape mode. Is this possible? and if so can anyone point me to any sample code for this?

Thanks,

Mark
 
It's rather unpossible I'm afraid. Javascript has very limited control of the browser itself. It's for scripting content within the browser, not manipulating the print settings of applications users have on their own machines... Common enough request though, along with "how do I strip out the annoying footer that the browser prints using javascript", but the security concerns it would raise outweigh any benefits to including that sort of thing in javascript's scope.

[sub]Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.
[/sub]

Webflo
 
Thanks for confirming. Any body else have any other suggestions? The site is running on an Apache Web Server.

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Other suggestions for setting the print aspect to landscape? Your best bet is an explanatory note to your users stating that this is for whatever reason desirable.

An alternate - and entirely more elegant - solution might be to implement a print-media stylsheet that reformats the page suitable for printing out in (the default) portrait mode.

[sub]Never be afraid to share your dreams with the world.
There's nothing the world loves more than the taste of really sweet dreams.
[/sub]

Webflo
 
Thanks again Webflo. I'll look at that option.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top