Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Open pdf file in Adobe reader created in code-behind

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

like image 716
Susan Avatar asked Dec 12 '12 20:12

Susan


People also ask

How do I change the default program for opening PDF files?

Right-click the PDF, choose Open With > Choose default program or another app in. 2. Choose Adobe Acrobat Reader DC or Adobe Acrobat DC in the list of programs, and then do one of the following: (Windows 10) Select Always use this app to open .

Why are my PDFs opening in Adobe Reader?

Click Internet in the left panel of the Preferences menu and then select Internet Settings. Select the Programs tab. Click Manage Add-Ons and choose Acrobat Reader in the list of add-ons. Click Disable to ensure PDFs won't be opened in a browser.

How can I convert a PDF that has hidden information?

Select all the text from your PDF by pressing "Ctrl-A," including the hidden words, and use "Ctrl-C" to copy the text. Paste the text into an open Word document by pressing "Ctrl-V." This will transfer all of the text in your PDF document, including hidden text that has been revealed, to a new document in Word.


1 Answers

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.

like image 124
Derek Tomes Avatar answered Oct 27 '22 01:10

Derek Tomes