5

How can I open a PDF document that I've created in code-behind in Adobe Reader?

madth3
  • 7,275
  • 12
  • 50
  • 74
Susan
  • 1,822
  • 8
  • 47
  • 69

1 Answers1

7

If you want to open a pdf with the application that has a file association with it, do the following:

Process.Start("C:\foo\bar\mybook.pdf")

If you want to open a specific application instead (like Adobe Reader when you don't have a file association) do the same thing by passing the pdf file path as a command line parameter. You'll need to get the path to AcroRd32.exe from the registry because people may have different versions installed, or installed it to a different location.

Process.Start("C:\Program Files (x86)\Adobe\Reader 11.0\Reader\AcroRd32.exe", _
              "C:\foo\bar\mybook.pdf")

The first option is generally better, because your software will respect whatever pdf reader your end-users have selected on their computer, or they may not have it installed at all.

Derek Tomes
  • 3,989
  • 3
  • 27
  • 41
  • That was so easy ... I've googled around for an hour and didn't find this! Many thanks. – Susan Dec 12 '12 at 21:35