Welcome Guest Search | Active Topics | Sign In | Register

WebBrowser WebView.ZoomFactorChanged in pdf viewer Options
Fabien
Posted: Tuesday, September 22, 2015 9:16:37 AM
Rank: Advanced Member
Groups: Member

Joined: 7/21/2014
Posts: 130
Hi,

How can i make difference in the WebView.ZoomFactorChanged event between a "standard" web page and the built-in PDF Viewer?

The extension of the url aren't a solution because it doesn't work for pdf create "on the fly".

Thanks
eo_support
Posted: Tuesday, September 22, 2015 10:36:22 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,229
Hi,

I do not believe this is possible. It appears that in the latest Chrome engine they treat PDF somewhat "native", so a PDF document and a regular HTML document share the same zooming level.

If you wish them to have different zoom level, you can turn the built-in PDF plug-in off and rely on Adobe's plugin. You would set this property to false to disable the built-in PDF plug-in:

http://www.essentialobjects.com/doc/eo.webbrowser.runtime.disablebuiltinplugins.aspx

Thanks!
Fabien
Posted: Monday, September 28, 2015 5:41:25 AM
Rank: Advanced Member
Groups: Member

Joined: 7/21/2014
Posts: 130
The problem is that we need to keep the built-in plugin

Is there a way to get the MIME type (or something else) in the WebView.ZoomFactorChanged, to detect if the page is a pdf or not.

Thanks
eo_support
Posted: Tuesday, September 29, 2015 2:01:41 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,229
Hi,

You can do this:

Code: C#
string type = WebView1.EvalScript("document.body.getElementsByTagName('embed')[0].type") as string;


This should return "application/pdf" for a PDF file.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.