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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change Print Settings?

Status
Not open for further replies.

obuspider

Programmer
Oct 31, 2002
78
US
Is it possible to programmatically check and/or change a users print settings through ASP?
 
I have not but I would guess that you couldn't do it. There is pretty tight security setup in web browsers not to allow web pages to interact with the client computer without user interaction. Without this security, web pages could (and did in the past) cause all kinds of trouble.
Thanks,

Gabe
 
Thanks Gabe. This is what I thought. I know it is possible to create an object that sits on the client computer that you can interact with. I didn't think you could do it just through ASP
 
Well, you definately can't do it with ASP as it runs server sid and would only have access to the server-side settings.
Unfortunatly it is also not possible to set these using javascript or client-side VBScript, as it was decided not to allow client scripts to have direct access to anything outside the document (obviously not including cookies).
There are ways to set the general look and view for a page using CSS so that viewing it on the screen will look differant than printing it from the file menu:
Code:
<html>
<head>
<style media=&quot;screen&quot;>
h1{
   color:red;
}
</style>
<style media=&quot;print&quot;>
h1{
   color:green;
}
</style>
</head>
<body>
<h1> This is red on screen and green in print preview</h1>
</body>
</html>

You can define any CSS attributes you want for both sets of styles and have a &quot;printer&quot; ok version that will appear when they go to print it. Unfortunatly this is only supported by IE right now. I think they also support page breaks (CSS defined) but not switching to landscape mode.

-Tarwn --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- --- ---
For my next trick I will pull a hat out of a rabbit (if you think thats bad you should see how the pigeon feels...) :p
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top