0
votes

I have a two part question about working with pdf files in a webbrowser control. I have a C# winforms project that opens a pdf file (but it actually opens adobe inside the browser). I want to add functionality to add a bookmark so: 1. How can I get the current page the user is on and 2. how can I open the pdf to that page. Right now I use navigate like this:

wb.Navigate(new Uri(url));

where:

wb is a WebBrowser control url is a string to the pdf file

I also open pdf's in adobe outside of the WebBrowser like this:

Process p = new Process();
p.StartInfo.FileName = // some string 
p.StartInfo.FileName = "acroRd32";
p.StartInfo.Arguments = "/A \"page=n\" " + FileFullyQualifiedPath;
p.Start();

where n is the page number to open.

Any help is greatly appreciated!

1

1 Answers

0
votes

of course I just found the answer to one part of my question...

if anyone is interested if you add @"#page=n" where n is the page number to the end of your url you will open the desired page.

I also found a way to navigate to different pages in the same pdf file and answered my own question here:

Stack overflow thread