Class: VirtualDisplayMode

Core. VirtualDisplayMode

Represents a VirtualDisplay Mode

new VirtualDisplayMode(docViewer, mode [, scrollable])

Constructs a new Virtual Display Mode that specifies how the pages are displayed on the screen
Parameters:
Name Type Argument Description
docViewer Core.DocumentViewer The DocumentViewer instance
mode Core.DisplayModes The display mode type
scrollable boolean <optional>
Whether the virtual display mode is scrollable or not

Extends

Methods


getMode()

Returns the current display mode
Inherited From:
Returns:
The current display mode value
Type
string

getPageOffset(pageNumber)

Returns the amount the page is offset from its container
Parameters:
Name Type Description
pageNumber number The number of the page
Inherited From:
Returns:
A point with x and y properties of the amount the page is offset from its container
Type
Core.DisplayMode.Point

getPageTransform(pageNumber)

Returns the amount the page is shifted relative to the viewport
Parameters:
Name Type Description
pageNumber number The number of the page
Inherited From:
Returns:
An object containing x, y offsets relative to the viewport and width, height of the page
Type
Core.DisplayMode.PageTransformReturnType

getSelectedPages(mousePt1, mousePt2)

Gets the indexes of the first and last pages selected
Parameters:
Name Type Description
mousePt1 Core.DisplayMode.Point The starting mouse point
mousePt2 Core.DisplayMode.Point The ending mouse point
Inherited From:
Returns:
Object with first and last selected page numbers; last must be >= first
Type
Core.DisplayMode.SelectedPagesReturnType

getVisiblePages( [amountAhead] [, amountSide])

Returns an array of page indexes that are visible on screen
Parameters:
Name Type Argument Description
amountAhead number <optional>
The amount of space ahead of the viewport to count as visible as a multiple of the screen height (default is 0.5)
amountSide number <optional>
The amount of space to the side of the viewport to count as visible as a multiple of the screen height (default is 0.5)
Overrides:
Returns:
an array page numbers
Type
Array.<number>

isContinuous()

Returns whether the current display mode is continuous
Inherited From:
Returns:
true if the display mode is continuous i.e. shows more than one row at a time
Type
boolean

IsScrollable()

Returns whether the current display mode is scrollable
Inherited From:
Returns:
true if scrolling is enabled for this display mode
Type
boolean

pageToWindow(pagePt, pageNumber)

Converts page coordinates to window coordinates
Parameters:
Name Type Description
pagePt Core.DisplayMode.Point Point in page coordinates
pageNumber number The page number
Inherited From:
Returns:
Point in window coordinates
Type
Core.DisplayMode.Point

pageToWindowNoRotate(pagePt, pageNumber)

Converts page coordinates to viewer coordinates without accounting for page rotation
Parameters:
Name Type Description
pagePt Core.DisplayMode.Point Point in unrotated page coordinates
pageNumber number The page number
Inherited From:
Returns:
Point in viewer coordinates ignoring rotation
Type
Core.DisplayMode.Point

setCustomFunctions(fns)

Sets callbacks to provide custom functionality when in custom display mode
Parameters:
Name Type Description
fns Core.DisplayMode.CustomFunctionParameters Object containing callback overrides for the functions listed on Core.DisplayMode.CustomFunctionParameters
Inherited From:

setParameters(nCols, nRows, currentRow, startRow, endRow)

Sets parameters of the display mode
Parameters:
Name Type Description
nCols number The number of columns
nRows number The number of rows
currentRow number The current row to be displayed
startRow number The starting row to have in the DOM
endRow number The ending row to have in the DOM
Inherited From:
Deprecated:
  • setParameters has been deprecated

windowToPage(windowPt, pageNumber)

Converts window coordinates to page coordinates
Parameters:
Name Type Description
windowPt Core.DisplayMode.Point Point in window coordinates
pageNumber number The page number
Inherited From:
Returns:
Point in page coordinates including the pageNumber property
Type
Core.DisplayMode.PagePoint

windowToPageNoRotate(windowPt, pageNumber)

Converts viewer coordinates to page coordinates without accounting for page rotation
Parameters:
Name Type Description
windowPt Core.DisplayMode.Point Point in viewer coordinates
pageNumber number The page number
Inherited From:
Returns:
Point in unrotated page coordinates with pageNumber
Type
Core.DisplayMode.PagePoint