WPF Web浏览器 - 显示PDF,XPS和其他文件格式时的缩放功能 [英] WPF web browser - Zoom function when displaying PDF, XPS and other file formats

查看:124
本文介绍了WPF Web浏览器 - 显示PDF,XPS和其他文件格式时的缩放功能的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,



我会在WPF应用程序中的两个单独的Web浏览器窗口中显示内容。通常,此内容是由Adobe Control或XPS查看器表示的PDF或XPS文件。
显示图像文件(例如JPG,PNG等)以及HTML内容本地在网络浏览器中。



一切运作良好,但我无法将显示的内容调整为窗口宽度或高度。
我可以使用鼠标(Ctrl +鼠标滚轮)或键盘(Ctrl +或Ctrl + - 将内容调整到所需的大小(缩放) ),但我如何在程序代码中这样做?



我希望有一个解决方案。



提前致谢!

解决方案

嗨Rene,


根据您的描述,您希望以编程方式缩放内容。在WPF中,我们可以操作文档。您可以从以下线程中看到扩展方法,因此您可以设置缩放。


https://stackoverflow.com/questions/5122485/wpf-webbrowser-how-to-zoom-content



最好的问候,


Cherry


Hello,

I'll show content in two separate web broser windows in a WPF application. Typically, this content is PDF or XPS files represented by the Adobe Control or XPS viewer. Image files (eg JPG, PNG etc.) as well as HTML content are displayed natively in the web browser.

Everything works well, but I can not adjust the displayed content to the window width or height. I can adjust the content to the desired size (zooming) with the mouse (Ctrl + mouse wheel) or with the keyboard (Ctrl ++ or Ctrl + -), but how do I do that in the program code?

I hope there is a solution.

Thanks in advance!

解决方案

Hi Rene,

According to your description, you want to zoom content programatically. In WPF we can manipulate the document. You can see a Extension Method from the following thread , so you can set the Zoom.

https://stackoverflow.com/questions/5122485/wpf-webbrowser-how-to-zoom-content

Best Regards,

Cherry


这篇关于WPF Web浏览器 - 显示PDF,XPS和其他文件格式时的缩放功能的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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