Printing the active web page to default printer

(imported topic written by Macideus91)

My objective is to have a webpage pop up on the end user machine and print that page out to a local default printer. I have managed to make the desired page pop up on the local machines, but have not figured out how to make that page print out to the default printer. All input welcome.

Thanks all

-Mike

(imported comment written by Lee Wei)

Hello Mike,

If you were to put BigFix aside for a second, how would you automate this on the endpoint?

How are you pop-up the Web page?

I think about the use case you describe as being divided into 2 steps:

  1. How do I do this on one computer

  2. How do I automate this with BigFix

Lee Wei

(imported comment written by Macideus91)

Thanks for the reply

run “C:\Program Files\Internet Explorer\iexplore.exe” http://www.blah blah.com/nameof page.htm

this script works to bring up the page…I just have no idea on how I will make the default printer print it when it comes up.

I am currently looking through other sites to find out how to print to a USB port from cmd line. There really isnt alot that applies to my situation out there, but I am still looking.

-Mike

(imported comment written by Macideus91)

Well, I still haven’t found anything reliable to go by for the printing issue. Do you have any small tidbits to offer or was that your final answer. I have to admit I had already formulated my thoughts before I posted. I don’t post unless I truely cannot figure my problem out.

-Mike

(imported comment written by jessewk)

For our WebReports print to PDF solution we do something similar… web reports renders the page in IE in the background and then sends the output to the default printer which is a GhostScript PDF printer.

You may be able to use a similar technique. I’ll ask the developer who implemented the solution if he has any comments.

(imported comment written by MikeOttum)

Hi Mike,

I think you want to use the Internet Explorer COM interface to do the printing. Specifically, the function ExecWB( 6, 2 ) will do what you want. 6 is the magic number OLECMDID_PRINT and 2 is OLECMDEXECOPT_DONTPROMPTUSER.

Does that help?

(imported comment written by Macideus91)

I will try some of this… really appreciate the input. Some of these tricks aren’t easy to find in general threads across the web. I will take these ideas and run with them and try not to hit my face in the wall. Thank you both!

-Mike

(imported comment written by MikeOttum)

Yeah, I had a tough time tracking down documentation for this stuff, too. MSDN is pretty helpful, though. For instance: http://msdn.microsoft.com/en-us/library/aa752087(VS.85).aspx

(imported comment written by Macideus91)

holy cat sh t batman

i think thats going to work

Mike your a genius!!!

thank you so much!

-Mike

(imported comment written by MikeOttum)

Awesome! I’m glad it worked.