I'm trying to print in a Windows Service. The following VB.Net code is used:
Dim _pd As New System.Drawing.Printing.PrintDocument()
AddHandler _pd.PrintPage, New System.Drawing.Printing.PrintPageEventHandler(AddressOf PrintDocument_PrintPage)
AddHandler _pd.EndPrint, New System.Drawing.Printing.PrintEventHandler(AddressOf PrintDocument_EndPrint)
_pd.Print()
The EventHandlers are implemented and tested. When I run the code (with AccountType: User) I'm getting an exception saying, that "no printer is installed". In a Windows Forms Application everything works.
I'm using a Network printer.
Thank you in advance, Alexander