Welcome Guest Search | Active Topics | Sign In | Register

Scaling WebControl content to fit to width of container Options
AChallenger
Posted: Tuesday, February 11, 2014 4:59:53 PM
Rank: Newbie
Groups: Member

Joined: 2/11/2014
Posts: 3
We've recently switched our document management application from using PDF representations of traffic citations to using HTML displayed in an EO WebControl.

The current document is displayed in the right pane of the application, which can be resized using a gridsplitter. The HTML inside the pane is of fixed width, and we'd like to scale it up or down to fit in the width of the preview pane.

Approaches we've tried:
- Placing the WebControl in a ViewBox control, which resulted in a blank browser pane
- Applying a ScaleTransform to the LayoutTransform of the WebControl or its parent, which also resulted in a blank browser pane
- Executing javascript on the WebControl.WebView that changes the document.body.style.zoom property to a floating point scale factor. This has been the most effective technique, however we're seeing a lot of jittering and inconsistency of text items upon resize.

I've created a sample project that exhibits the symptoms of the third approach and uploaded it here: https://dl.dropboxusercontent.com/u/856499/WpfApplication2.zip

To see what I'm talking about, grab the bottom corner of the window. You'll notice that the browser resizes and the contents mostly scale, but text elements seem to jump around and change how they are proportioned. The CSS3 zoom property should smoothly scale the contents.

Is there a better way to achieve this? A workaround for the text issues?

Thanks for your help!
eo_support
Posted: Tuesday, February 11, 2014 5:12:26 PM
Rank: Administration
Groups: Administration

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

The best way to handle this is to applying a zoom level on the WebView ---- which is a feature that is on our list but is not implemented yet. We are looking to add this feature in the coming weeks. I would recommend you to wait until this feature is available. It will be a single property like "ZoomLevel" on the WebView class.

Thanks!
AChallenger
Posted: Tuesday, February 11, 2014 5:15:03 PM
Rank: Newbie
Groups: Member

Joined: 2/11/2014
Posts: 3
Excellent, sounds like exactly what we need. Please let me know when this feature is available for us to test, even in a beta format.

Thanks for your help.


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.