Link to home
Start Free TrialLog in
Avatar of troyd1
troyd1

asked on

I want to automatically print a webpage when it loads to the default printer.

After the page loads, I wish to automatically print the webpage. I am in a controlled environment, this is not for the general audience of my site. I want to use it to print reports and other things. Any kind of code is welcome as long as it will accomplish the task. Javascript, vb script whatever.

Thanks, Troy
Avatar of Zyloch
Zyloch
Flag of United States of America image

When you want to print something, in a webpage, it's not possible without opening the Print Dialog box. If you want that, it's simple: onload="window.print();"

However, as far as I know, you can't print without opening the Print Dialog. It might be possible with ActiveX, but for that, I don't know.

Regards,
--Zyloch
Avatar of Caiapfas
Caiapfas

I would mind seeing the activex that will do this
Avatar of troyd1

ASKER

Yes, if activex will work, bring it on. What I want to do is have a machine dedicated to do printing. I am going to create a webpage that continually polls the server for a print job webpage. If it is there, the server will send this page with the activex print command. This will allow me to in essense print from anywhere to a system printer.
Are you sure this is the right solution?  Perhaps a print server?
ASKER CERTIFIED SOLUTION
Avatar of Zyloch
Zyloch
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Remark: Your default printer would have to be set to a valid printer, of course ;)

Regards,
--Zyloch
And you have to be ready for the barrage of complaints when things print without people expecting them to. *I* would be royally annoyed if the printer started printing out stuff without my intervention. Even regular apps don't do that.
THat is against the rules actually. It is outside the security realm of a web page to print documents without the knowledge of the user. If that is really needed, the solution is a standalone application and not a web page. As long as it is based on ActiveX technology, the component can always be used ina stand alone application. It will offer much better control, will perform much better and will look much elegant.

My two pence...

~ Ranjeet Rain

Avatar of troyd1

ASKER

Thanks for the code, I will give it a try. It is just what I want. Web woman, in my question, I said it was for a controlled environment. Taking away redundent steps saves time and all I wanted to use this for is a standalone report printer anyway.
Avatar of troyd1

ASKER

I just tested it. It works great! Exactly what I need. This will save a ton of time. Thanks a lot.

Troy
I'm looking for something similar. I need a way to skip the print dialog, and send a stream of text and graphics to the client's printer. It's fine if this involves installing an activex control, but I need it to work in IE and Netscape on both PC and Mac. Has anyone seen such an activex control?

Thanks
Impossible. ActiveX is IE-only
Is there another technology that would allow me to accomplish the same thing in Netscape? Java maybe?
You can probably do it with Java applets yes, but you'd be better off posting there.