I want to print a document from C# but don't want any UI for it. The document should be printed silently using C#.
I have tried ProcessStartInfo
with Verb = "Print"
but is shows UI to print the document.
Any kind of help is appreciated.
I want to print a document from C# but don't want any UI for it. The document should be printed silently using C#.
I have tried ProcessStartInfo
with Verb = "Print"
but is shows UI to print the document.
Any kind of help is appreciated.
Perhaps the PrintDocument.Print Method might help :)
Note that I don't think this will work with .net Core as the System.Drawing namespace has not been fully ported over. (Source - GitHub corefx Issue #20325
Nor will this work in a UWP app, because they use a different API for printing things.
I don't have a printer with me to test this, but here's the code example from msdn