Click here to Skip to main content
11,927,600 members (47,714 online)
Rate this:
Please Sign up or sign in to vote.
See more: C#2.0 C#3.0 C# Windows .NET C#4.0 , +

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 10:45am
Edited 27-Jun-11 11: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 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
Web04 | 2.8.151126.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