Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'm trying to set the zoom level of a Visio document which is shown through the Visio Web Service.

http://mysite/_layouts/VisioWebAccess/VisioWebAccess.aspx?id=/Shared%20Documents/MyDiagram.vdw

I want to use the 'fit to page' zoom level which is achieved by pressing the button on the right of the toolbar. My first thought was click the button via javascript, but didn't get immediate success and also stumbled across MSDN articles on Objects in the Visio Services JavaScript API, the Vwa.VwaControl.getActivePage Method and the Vwa.Page.setZoom Method.

I can successfully construct a VwaControl object

vwaControl = new Vwa.VwaControl("ctl00_PlaceHolderMain_VisioWebAccess");

but I get null when I call getActivePage() on this control.

I've tried constructing other VwaControl using other ids from the page but none of them are valid - I get an error like "VwaControl does not exist for id {0}". I've tried traversing down the tree from vwaControl._control._zoomControl._fitButton._clickDelegate but I don't know how to fire that delegate.

Has anyone implemented an 'auto zoom to fit' feature in the VisioWebAccess.aspx page?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

I've given up trying to modify the ASPX to auto-fit the Visio document, but have instead found another solution.

Select 'Fit to Window' in Visio before saving the file. This View preference is saved with the file, and when opened using Visio Web Services the file will be opened in 'Fit to Window' mode.

In the same way, zooming in on a particular part of a drawing and saving will cause it to load with that same zoom.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.