0

I have a winforms application that allows users to input data into a form which is then used to populate a pdf. It then is intended to open the pdf in the default application, which for our users is Adobe and prompt them to confirm that everything looks correct and/or to make corrections before proceeding.

If Adobe is not running, everything behaves as expected with the file opening at the same time that the prompt occurs. However, if Adobe is already running, the prompt displays but the file never opens until after the application is closed.

Below is what I've put together from other questions on here that I've looked at:

protected DialogResult ValidatePDF(string FileName)
        {
            var OpenPdf = new Process();
            OpenPdf.StartInfo.UseShellExecute = true;
            OpenPdf.StartInfo.FileName = FileName;
            OpenPdf.StartInfo.Verb = "open";
            OpenPdf.Start();

            return MessageBox.Show("Please validate the generated PDF. Save any changes before clicking OK.", string.Empty, MessageBoxButtons.OKCancel);
        }

Is there a different way that I should be doing things when Adobe's running vs when it isn't? Any direction would be helpful.

Stefan Wuebbe
  • 2,109
  • 5
  • 17
  • 28
  • maybe helpful https://stackoverflow.com/questions/619158/adobe-reader-command-line-reference – rene Apr 20 '23 at 20:17

0 Answers0