0

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:

Link1 Link2

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.

Willy
  • 9,848
  • 22
  • 141
  • 284
  • Adobe is not the kind of company that ever passes up an opportunity to spam their company name. Which is a bit odd, they don't have that much to be proud of. As long as you don't want to use the existing solution we have here at SO you are stuck with the way it works. – Hans Passant Nov 08 '17 at 17:16
  • @HansPassant Maybe sending raw data to the printer? See my update. – Willy Nov 08 '17 at 21:03
  • @HansPassant I can confirm that sending raw data is not working. Printer prints weird characters and symbols as this is raw data. So attempt #1 posted is not working. – Willy Nov 09 '17 at 08:38

0 Answers0