...

View Full Version : Can browser settings be changed via JavaScript?



jpfred
04-23-2007, 08:25 PM
Is it possible to change browser settings dynamically using JavaScript? I am needing to changes such things as margins, footer, header when requesting to print the page.

Philip M
04-23-2007, 10:56 PM
In a word, no. Print settings are handled at the application level, and cannot be accessed by means of a script through the browser.
All you can do is to advise the user (by means of an alert or pop-up) to change his settings to those required for your page. Or of course make your page the right size to print in normal portrait or landscape.

nikkiH
04-23-2007, 11:19 PM
CSS @media print might be worth looking into for you.
Most of these have properties there.

Keltoi
04-24-2007, 12:18 AM
Ditto, CSS is what your after as nikkiH says... using media print you can set html and body margins to whatever you like, feel a bit bad about posting detail in a javascript forum but hey...
within your print style sheet you just need:
html, body {margin:5px; padding:5px; height:100%;}adjust as needed - there are other methods of measurement but I'll let ou look those up.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum