views:

981

answers:

3

Hey printing junkies need some pointers to send me in the right direction for this development.

I am developing an epos system for a local shop which we are later going to tie into an ecommerce site.

The front end of the epos system is going to be WinForms so we can handle USB devices easily and we are going to use a WebForms/MVC admin console.

One area we are inexperienced in is printing. We need to print barcodes, and wish to do this via the admin console (web based).

So (finally) the question. Where do we start looking for code that will allow us to print directly to a connected printer from the server (IIS) instance of .net from the webforms.

+1  A: 
System.Drawing.Printing

http://msdn.microsoft.com/en-us/library/system.drawing.printing.aspx

Creating the document is a lot like creating a dynamic image. I have not actually sent a document to the printer from a web app, but I don't see why you couldn't.

Ryan Cook
The reason why you couldn't: the app would have to run with 'Full Trust', since printing isn't normally done directly from a web app.
Joel Coehoorn
Printing should only require medium trust. Also, if permission is the only issue I think you can set your app to just allow printing and have everything else at a lower trust level.Here is a doc that explains better than I know how to:http://msdn.microsoft.com/en-us/library/87x8e4d1(VS.71).aspx
Ryan Cook
Trust isnt really an issue (as its a self contained pc), just need to know how I get a handle on the printer itself.
tigermain
+1  A: 

Your Web app will probably have to use remoting to connect to a Windows service running on the same machine (or pick your favorite IPC mechanism—perhaps a queue in a database). This service can run in an full trust context and should be able to print for you.

P Daddy
+1  A: 

You can set up a local printer, that just passed traffic through to the network printer. This is easier to set up that printing direct to a network printer. See link text