Click here to Skip to main content
11,790,904 members (65,281 online)
Rate this: bad
Please Sign up or sign in to vote.

I am using a webbrowser control to show a local pdf file, and it works well.
One thing I have to figure out is I have to be able to zoom in or out in programmatically since I hide the toolbars from Adobe reader.

Does anyone know how to do it in programmatically?

Posted 27-Jun-11 9:45am
Edited 27-Jun-11 10:08am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You can pass Adobe commands as query string parameters to the web site link. E.g
http://myapp/mypdf.pdf?#zoom=100%&view=fit&navpanes=0&toolbar=0 will change zoom to 100 %, view to fit , no navigation panes and no tool bar.

For more look this [^] link.


Well, accept the parameters from user input controls such as textbox or combobox. i.e

private void button1_Click(object sender, System.EventArgs e)
    string zoomFactor = int.Parse(TextBox1.Text);
    WebBrowser1.Navigate("http://mpapp/mypdf/roles.pdf?#zoom=" + zoomFactor + "%&navpanes=0&toolbar=0");
Member 7839509 at 27-Jun-11 22:19pm
My problem is that after load a pdf file in a webbrowser control with 100%, I'd like to change it to e.x, 150% 200% or 250%. So your solution is just for opening a pdf file with 100%. I'd like to program like a user click zoom button in toolbar. I do not know how I can handle zoom after opening. Anyway thanks though.
Wonde Tadesse at 28-Jun-11 8:19am
Answer updated.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 410
1 ppolymorphe 385
2 Richard MacCutchan 118
3 Jochen Arndt 80
4 Maciej Los 70
0 OriginalGriff 1,329
1 Maciej Los 835
2 ppolymorphe 780
3 KrunalRohit 686
4 CPallini 661

Advertise | Privacy | Mobile
Web04 | 2.8.1509028.1 | Last Updated 28 Jun 2011
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100