Class: WebViewerInterface

WebViewerInterface


new WebViewerInterface()

These functions should be overridden in a ReaderControl so that WebViewer can interact with it

Methods


fitHeight()

Controls if the document's Zoom property will be adjusted so that the height of the current page or panel will exactly fit into the available space. Not supported by HTML5 viewers.


fitPage()

Controls if the document's Zoom property will be adjusted so that the width and height of the current page or panel will fit into the available space. Not supported for mobile viewer.


fitWidth()

Controls if the document's Zoom property will be adjusted so that the width of the current page or panel will exactly fit into the available space. Not supported for mobile viewer.


fitZoom()

Sets the FitMode to Zoom, where the zoom level is free from pre-defined fit modes.


getCurrentPageNumber()

Gets the current page number

Returns:

the current page number

Type
integer

getFitMode()

Gets the current fit mode

Returns:

the current fit mode

Type
object

getLayoutMode()

Gets the layout mode of the document. Not supported for mobile viewer.

Returns:

the layout mode of the document


getPageCount()

Gets the total page count of the loaded document

Returns:

the total page count of the loaded document

Type
integer

getShowSideWindow()

Gets the value whether the side window is visible or not. Not supported for mobile viewer.

Returns:

true if the side window is shown


getToolMode()

Gets the current tool mode

Returns:

the current tool mode

Type
object

getZoomLevel()

Gets the current zoom level

Returns:

the current zoom level in float, where 1.0 is 100%.

Type
number

goToFirstPage()

Navigates to the first page of the document


goToLastPage()

Navigates to the last page of the document


goToNextPage()

Navigates to the next page of the document. This method will increment the current page number by 1, regardless of display modes (where more than 1 page is displayed at a time).


goToPrevPage()

Navigates to the previous page of the document. This method will decrement the current page number by 1, regardless of display modes (where more than 1 page is displayed at a time).


loadDocument(url)

Loads a document into the WebViewer.

Parameters:
Name Type Description
url

url of the document to be loaded (relative urls may not work, it is recommended to use absolute urls)


rotateClockwise()

Rotates the document viewer's orientation by 90 degrees clockwise.


rotateCounterClockwise()

Rotates the document viewer's orientation by 90 degrees counter clockwise.


searchText(pattern, searchMode)

Searches the loaded document finding for the matching pattern.

Search mode includes:

  • None
  • CaseSensitive
  • WholeWord
  • SearchUp
  • PageStop
  • ProvideQuads
  • AmbientString
Parameters:
Name Type Description
pattern

the pattern to look for

searchMode

must one or a combination of the above search modes. To combine search modes, simply pass them as comma separated values in one string. i.e. "CaseSensitive,WholeWord"


setCurrentPageNumber(pageNumber)

Sets the current page number and navigates to the specified page in the viewer.

Parameters:
Name Type Description
pageNumber integer

the new page number


setFitMode(fitMode)

Sets the fit mode

Parameters:
Name Type Description
fitMode object

the object representing the fit mode


setLayoutMode(layout)

Sets the layout mode of the document. Not supported for mobile viewer.

Parameters:
Name Type Description
layout

the layout mode to set


setShowSideWindow(value)

Sets the value whether the side window is visible or not. Not supported for mobile viewer.

Parameters:
Name Type Description
value

true to show the side window


setToolMode(toolMode)

Sets the tool mode

Parameters:
Name Type Description
toolMode object

the object representing the tool mode


setZoomLevel(zoomLevel)

Sets the current zoom level

Parameters:
Name Type Description
zoomLevel number

the new zoom level, where 1.0 is 100%.