I'm able to create PDFs in my C#/WPF application and run them with the following:
Process.Start(_pathToPDFFile);
This works with Adobe Acrobat, but not with Adobe Reader. When Adobe Reader is installed, Process.Start()
does nothing unless the Reader process is already running in the Task Manager.
How can I get Adobe Reader to show the PDF when I attempt to start a PDF?
Maybe try something like this? I tried you code on Windows 8 with Adobe Reader 11 and it seems to work fine for me. Maybe something else is wrong on the machine in question?
var process = new Process();
process.StartInfo = new ProcessStartInfo(@"Path to your PDF.pdf");
process.StartInfo.CreateNoWindow = true;
process.StartInfo.UseShellExecute = true;
process.Start();
In our case, the problem was only reproducible when starting the application from Visual Studio - starting the .exe directly works as expected.
After some debugging, it turned out that Visual Studio was set to always run as administrator, which causes the issue. Turning this off (which is hard enough itself) fixes the problem.
Still not sure why this happens, though.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With