Rotate

In this document
chevron_rightRotating through UI
chevron_rightOutside the iframe
chevron_rightRelated events

Rotating through UI

  • The rotate UI is shown when you hover the layout button, found on the top tool bar
  • Clockwise/Counter-clockwise buttons refer to rotating documents 90 degrees in the corresponding direction
This is just changing how the pages are presented, not modifying the document.

Rotating programmatically

Outside the iframe

myWebViewer.rotateClockwise();
myWebViewer.rotateCounterClockwise();

Inside a config file

// rotates all pages
readerControl.rotateClockwise();
readerControl.rotateCounterClockwise();

// rotates only page 2
readerControl.rotateClockWise(2);

// set a specific rotation
readerControl.docViewer.setRotation(CoreControls.PageRotation.e_270);
// set a specific rotation for a specific page
readerControl.docViewer.setRotation(CoreControls.PageRotation.e_270, 5);

// sets the specific page rotations of multiple pages
// page values are 0-indexed
readerControl.docViewer.setPageRotations({
  0: CoreControls.PageRotation.e_90,
  4: CoreControls.PageRotation.e_270,
  11: CoreControls.PageRotation.e_180
});

Inside a config file

readerControl.docViewer.on('rotationUpdated', function(event, rotation, pageNumber) {
  ...
});