Click here to Skip to main content
11,718,589 members (87,815 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 Sergey Alexandrovich Kryukov 750
1 F-ES Sitecore 250
2 OriginalGriff 230
3 Jochen Arndt 160
4 Maciej Los 130
0 Sergey Alexandrovich Kryukov 1,679
1 OriginalGriff 610
2 Maciej Los 529
3 Richard MacCutchan 460
4 F-ES Sitecore 455

Advertise | Privacy | Mobile
Web02 | 2.8.150901.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