I want to do printing in .net core.
To do this I am using Process
of System.Diagnostics
.
I tried following code below:
var printJob = new Process
{
StartInfo = new ProcessStartInfo
{
FileName = path,
UseShellExecute = true,
Verb = "print",
CreateNoWindow = true,
WindowStyle = ProcessWindowStyle.Hidden,
WorkingDirectory = Path.GetDirectoryName(path)
}
};
But Verb
property is missing in StartInfo
in .net core.
So then I decided to do printing as follows:
Process.Start("LPR -S ip -P 'Star TSP800L Peeler (TSP828L)' -o 'D:\testpdf.pdf'");
But it gives me
The system cannot find the file specified
whereas the file is present at given location.
Right now I am trying to test with local printer on my windows 10 machine, but what I need is to print to network printer from ubuntu machine.
Can someone tell me, why I am getting file not found error. I have found following link, but it is using StartInfo, which is not helpful to me in this case.
Process.Start in C# The system cannot find the file specified error
Error in Process.Start() -- The system cannot find the file specified