Hi,
I have the C# code below to open a PDF file and launch the Print window when the Adobe reader opens the file. This code is running fine in older version of Adobe (Adobe Reader 11.0.2) but it is not working fine in Adobe Reader DC. Can you please help?
publicvoid Printing(string _filename, string Printername)
{
using (Process process = newProcess())
{
int count = Convert.ToInt32(System.Configuration.ConfigurationManager.AppSettings["WaitTime"]);
process.StartInfo.Verb = "print";
var adobeRegistry = Registry.LocalMachine.OpenSubKey("Software").OpenSubKey("Classes").OpenSubKey("acrobat").OpenSubKey("shell").OpenSubKey("open").OpenSubKey("command");
string pathAdobe = adobeRegistry.GetValue("").ToString().Substring(1, adobeRegistry.GetValue("").ToString().Length - 10);
process.StartInfo.FileName = pathAdobe;
process.StartInfo.Arguments = String.Format("/h /t \"{0}\" \"{1}\"", @_filename, Printername);
process.StartInfo.UseShellExecute = false;
process.StartInfo.CreateNoWindow = true;
process.Start();
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
if (process.HasExited == false)
{
process.WaitForExit(count);
}
process.EnableRaisingEvents = true;
process.Close();
Process[] procs = Process.GetProcessesByName("AcroRd32");
foreach (Process p in procs) { p.Kill(); }
}
}
!