Server Side Printing (Asp.net Application)

Server Side Printing (Asp.net Application)

Old forum URL: forums.lhotka.net/forums/t/4692.aspx


RangerGuy posted on Monday, April 14, 2008

Hi everyone,

I'm wondering if anybody might be able to point me in the right direction. I need to print a html document pulled from a database. I need to print this server side without prompting the user.

Eventually I will need to use this code in a job.

I've scoured the net all day today looking for some kind of hint but have had no luck.

 

raz0rf1sh replied on Friday, April 18, 2008

We had to do something like this for a customer of ours.  They prepared invoices via a web application and wanted to print out a batch of invoices, instead of printing them individually.

We decided to leverage MSMQ.

When the user wanted to print a batch, they would click the Print button in the web application, which in turn would drop a message in MSMQ.

We then created a Windows application, which will eventully be converted to a Windows Service someday, to read messages from MSMQ.  The message contained the ID of the batch to print.  Once the message was read it would create the Crystal Report (yuck!) and start printing the invoices out on a network printer.

Hope this helps,

Matt

RangerGuy replied on Monday, April 21, 2008

Thanks Matt,

That was a great idea. I would have jumped on that but we need to be able to print rendered HTML.

I used browser automation to render the html and call the print funtion but you can't sent the printer. It only prints to the default one we need to be able to print to a specific printer programmically.

Thanks for the help tho :)

Copyright (c) Marimer LLC