Reputation: 1887
I have content loaded into a FlowDocument, which has been loaded into a FlowDocumentReader control, acting as a Print Preview style window. I invoke the FlowDocumentReader.Print() method. This opens the print dialog box, listing all printers connected to my PC.
When printing to .xps (i.e., to file) everything prints as normal. When I attempt to print to a different device (a networked printer), I get the following exception:
System.Printing.Printjob Exception
"An exception occurred while calling XpsDocumentEvent."
The printer in question is properly connected. I can send other documents to it just fine. I have even set the networked printer to be the primary printer, but it had no effect.
I'm largely at a loss here. What should I be checking to diagnose and fix this issue?
Edit: Additionally, if I resume debugging after the exception is hit, Windows will say that the document was sent to printer successfully, yet no document was printed.
Edit 2: I was able to successfully print to a different network printer without changing any code. Removing then re-adding the original troublesome printer fixed the errors I was experiencing. The moral of the story? When in doubt, it's probably the printer's fault.
Upvotes: 1
Views: 1432
Reputation: 1887
I was able to successfully print to a different network printer without changing any code. Removing then re-adding the original troublesome printer fixed the errors I was experiencing. The moral of the story? When in doubt, it's probably the printer's fault. Perhaps this is more of a SuperUser question at this point.
Upvotes: 1