I'm developing a Windows service that has to print some labels on a network printer. Here http://msdn.microsoft.com/en-us/library/5ekk3hse.aspx it says that printing in Windows service using System.Drawing.Printing classes is not supported (or rather shouldn't be done).
This Print html document from Windows Service in C# without print dialog seems like the solution, but they say there that it requires .Net Framework 4.0, and I have to use 2.0 (or I can change it to 3.5 if I really, really have to, but then the client will have to upgrade which I want to avoid).
I also read that to print from Windows service on network printer the domain account is required for the service, which I'm using anyway, so that's not the problem.
Every setting for the printer will be set in .config file and I hope that because of this no user dialog will be appearing/needed.
My questions:
Will I be able to print directly from Windows service using BackgroundWorker? Or do I need to call another app (for example console application) from inside of my service and do the printing there (I've read on the net that some people use this solution but I didn't found any code example)
Also I'm not good with threading and working with BackgroundWorkers so can someone give me some example how can I do it (I have requests to print coming asynchronously. How can I print them without loosing any?). Is the BackgroundWorker the best solution or are there some better ways to do it?