Pergunta

I have a WCF Service Operation that receives an image as a Byte stream, and should print that image locally on the server silently. No dialogs or popups, when the service is called it should send the image to the printer straight away.

I am trying with a local image stored on the server using PrintDocument.Print().

The weird thing is that it works on Visual Studio's integrated development server, but not on IIS 7.5. I have given the app pool admin rights (I'm actually using the identity of the logged on user, which is an admin) but no luck.

From both Visual Studio's server and from IIS I can see the available printers, but when I call the service from IIS nothing happens, and I mean nothing. No error, no exception, no sign of what's going on at all.

I have tried using ProcessStartInfo with Verb = "print" and Verb = "PrintTo" but the same thing happens. Works on Visual Studio but not on IIS.

I have also tried creating a PrintTicket and a LocalPrintServer with PrintSystemDesiredAccess.AdministratePrinter rights but I don't know what to actually do with it, I don't know how to tell it to print an image file.

I know printing can be a tricky task on any language/platform, but is it really that hard to print an image from a WCF Data Service?

Foi útil?

Solução

OK. Wanna bang my head against the wall now. It was obviously a permissions issue, so setting the Owner of the printer to the Admin users group (it was set to System) did the trick.

I'm really missing Linux right now :P

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top