在c#中的webbrowser控件中放大和缩小pdf文件 [英] Zoom in and out for a pdf file in a webbrowser control in c#

查看:436
本文介绍了在c#中的webbrowser控件中放大和缩小pdf文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我使用webbrowser控件显示本地pdf文件,效果很好。

我有一件事必须弄清楚我必须能够以编程方式放大或缩小,因为我从Adobe阅读器隐藏工具栏。



有谁知道怎么做以编程方式?



TIA

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

推荐答案

您可以将Adobe命令作为查询字符串参数传递到网站链接。例如

http://myapp/mypdf.pdf?#zoom = 100%& view = fit& navpanes = 0& toolbar = 0 将缩放更改为100%,视图适合,没有导航窗格,没有工具栏。



更多外观这个 [ ^ ]链接。



编辑



好​​吧,接受来自的参数来自用户输入控件,如文本框或组合框。即



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

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");
}


这篇关于在c#中的webbrowser控件中放大和缩小pdf文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆