Search code examples
c#visual-studio-2010adobeadobe-reader

unable to open a pdf file at specific page in Adobe Reader 11 using C# code


The below lines of code are used to open a PDF file at a particular page in C#. the code works absolutely fine for all the adobe version other than the latest, which is 11.

System.Diagnostics.Process myProcess = new System.Diagnostics.Process();
myProcess.StartInfo.FileName = "AcroRd32.exe";
myProcess.StartInfo.Arguments = "/A \"page=2=OpenActions\" C:\\Jack and Jill.pdf";
myProcess.Start();

Can some one please help me out and let know what is special with adobe reader 11. Any help will be greatly appreciated.

The error is "There was an error opening this document. The file cannot be found." (THE FILE DOES EXIST)

P.S: I have uninstalled adobe 11 and installed adobe reader 10 and the code works absolutely fine then.

also the arguments when given from command line when Acrobat Reader 11 is installed works fine and opens PDF.


Solution

  • Make sure u dont have spaces in the name of the file. it works if it has spaces in all other adobe readers but adobe reader 11 dosent support that.

    Hope this helps