Click here to Skip to main content
12,996,261 members (66,555 online)
Rate this:
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
Updated 2-Mar-16 5:46am

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 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 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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web01 | 2.8.170609.2 | Last Updated 1 Apr 2016
Copyright © CodeProject, 1999-2017
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