Click here to Skip to main content
15,891,704 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi,

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?

TIA
Posted
Updated 2-Mar-16 5:46am
v3

1 solution

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.

EDITED

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

C#
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");
}
 
Share this answer
 
v3
Comments
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


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900