Zoom

In this document
chevron_rightZooming through UI
chevron_rightOutside the iframe
chevron_rightRelated events
chevron_rightOutside the iframe

Zooming through UI

  • The zoom UI is found on the top tool bar
  • Plus and minus buttons zoom in and out of the document
  • You can also specify the zoom level you want by typing in the text field and pressing enter

Zooming programmatically

Outside the iframe

var currentZoom = myWebViewer.getZoomLevel();
myWebViewer.setZoomLevel(currentZoom * 0.8);

Inside a config file

var currentZoom = readerControl.getZoomLevel();
readerControl.setZoomLevel(currentZoom * 0.8);

// offsets depend on the size of the UI elements surrounding the document view
readerControl.docViewer.zoomToMouse(1.2, leftPanelOffset, toolbarOffset);

Outside the iframe

viewerElement.on('zoomChanged', function(event, zoomLevel) {
  ...
});

Inside a config file

$(document).on('zoomChanged', function(event, zoomLevel) {
  ...
});

// or

readerControl.docViewer.on('zoomUpdated', function(event, zoomLevel) {
  ...
});