This question is also at sharepoint.stackexchange.com but has failed to get views or responses so I’m posting here.
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?
See answer at sharepoint.stackexchange.com – the zoom and positioning is saved within the document, so set it there. I was unable to control the zoom using javascript.