I want to print a PDF file from C# code without user interaction.
I tried this accepted answer but it is not working for me.
This is the code I tried:
Process p = new Process();
p.StartInfo = new ProcessStartInfo()
{
CreateNoWindow = true,
Verb = "print",
FileName = @"G:\Visual Studio Projects\PrintWithoutGUI\PrintWithoutGUI\Courses.pdf" //put the correct path here
};
p.Start();
I get this exception :
System.ComponentModel.Win32Exception: 'The specified executable is not a valid application for this OS platform.'`