We are using SpirePDF to print using a .NET service and when we try to print on "Sharp MX-2300" printer we get the following exception and printing fails giving the exception.
System.ComponentModel.Win32Exception (0x80004005): The operation completed successfully
at System.Drawing.Printing.StandardPrintController.OnEndPrint(PrintDocument document, PrintEventArgs e)
at System.Windows.Forms.PrintControllerWithStatusDialog.OnEndPrint(PrintDocument document, PrintEventArgs e)
at System.Drawing.Printing.PrintController.Print(PrintDocument document)
at System.Drawing.Printing.PrintDocument.Print()
But the main issue is that after this it also fails to print to other printers as well giving the same exception and the following exception.
System.ComponentModel.Win32Exception (0x80004005): The handle is invalid
at System.Drawing.Printing.StandardPrintController.OnStartPrint(PrintDocument document, PrintEventArgs e)
at System.Windows.Forms.PrintControllerWithStatusDialog.OnStartPrint(PrintDocument document, PrintEventArgs e)
at System.Drawing.Printing.PrintController.Print(PrintDocument document)
at System.Drawing.Printing.PrintDocument.Print()
at PrintConnector.Library.PdfHelper.PrintPdfSpire(String fileName, PrintEvent printEvent)
I also found this post from the forum (can-spire-pdf-be-used-in-a-window-service-t5494.html) which says about MSDN warning on using System.Drawing.Printing namespace in a windows service. If that is the problem is there anyway to stop failing the other printers as well after it fails on that particular printer?