I am trying to sent a PDF document to print from C# using ProcessStartInfo but without opening adobe acrobat window. File is printed correctly but adobe acrobat popups a window even if I set it to minimized, no splash screen, no create window, etc. Below the code.
string PathAcrobat = GetAcrobatPath();
string args = string.Format("/s /h /t \"{0}\"", filename);
var startInfo = new System.Diagnostics.ProcessStartInfo
{
FileName = PathAcrobat,
Arguments = args,
CreateNoWindow = true,
ErrorDialog = false,
UseShellExecute = false,
WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden
};
var process = System.Diagnostics.Process.Start(startInfo);
I have googled and found no solutions:
ATTEMPT #1: I have found this article from microsoft that is proposed as a possible solution in this thread. Basically it consists on sending raw data to a printer but I am not sure if it will work. I will try and come back here with a feedback.
If it worked, it would have the advantage to not depend on Acrobat and therefore the need to have it installed on system. Also no need to use ProcessStartInfo.
But unlike Acrobat, this "solution" would be dependant on some OS DLLs.