Class: DisplayModeManager

CoreControls. DisplayModeManager

Represents an object that manages the display modes used by DocumentViewer


new DisplayModeManager()

You must NOT instantiate this yourself. Access the display mode manager instance as follows:

Examples
// In your app
var viewer = new PDFTron.WebViewer({ ... }, viewerElement);
viewerElement.addEventListener('ready', function() {
  var instance = viewer.getInstance();
  var docViewer = instance.docViewer;
  var displayModeManager = docViewer.getDisplayModeManager();
  // displayModeManager.someAPI();
});
// In a config file
$(document).on('viewerLoaded', function() {
  var instance = readerControl;
  var docViewer = instance.docViewer;
  var displayModeManager = docViewer.getDisplayModeManager();
  // displayModeManager.someAPI();
});

Methods


getDisplayMode()

Returns the current display mode.

Returns:

The current display mode.


setDisplayMode(displayMode)

Sets the display mode. Also removes selection caused by text selection or search. Only renders if a document has been loaded.

Parameters:
Name Type Description
displayMode object

The display mode object to set as the current display mode