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 pageNumbernumber 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 -
getPageTransform(pageNumber)
-
Returns the amount the page is shifted relative to the viewport
Parameters:
Name Type Description pageNumbernumber The number of the page - Inherited From:
Returns:
An object containing x, y offsets relative to the viewport and width, height of the page -
getSelectedPages(mousePt1, mousePt2)
-
Gets the indexes of the first and last pages selected
Parameters:
Name Type Description mousePt1Core.DisplayMode.Point The starting mouse point mousePt2Core.DisplayMode.Point The ending mouse point - Inherited From:
Returns:
Object with first and last selected page numbers; last must be >= first -
getVisiblePages( [amountAhead] [, amountSide])
-
Returns an array of page indexes that are visible on screen
Parameters:
Name Type Argument Description amountAheadnumber <optional>
The amount of space ahead of the viewport to count as visible as a multiple of the screen height (default is 0.5) amountSidenumber <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 pagePtCore.DisplayMode.Point Point in page coordinates pageNumbernumber The page number - Inherited From:
Returns:
Point in window coordinates -
pageToWindowNoRotate(pagePt, pageNumber)
-
Converts page coordinates to viewer coordinates without accounting for page rotation
Parameters:
Name Type Description pagePtCore.DisplayMode.Point Point in unrotated page coordinates pageNumbernumber The page number - Inherited From:
Returns:
Point in viewer coordinates ignoring rotation -
setCustomFunctions(fns)
-
Sets callbacks to provide custom functionality when in custom display mode
Parameters:
Name Type Description fnsCore.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 nColsnumber The number of columns nRowsnumber The number of rows currentRownumber The current row to be displayed startRownumber The starting row to have in the DOM endRownumber 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 windowPtCore.DisplayMode.Point Point in window coordinates pageNumbernumber The page number - Inherited From:
Returns:
Point in page coordinates including the pageNumber property -
windowToPageNoRotate(windowPt, pageNumber)
-
Converts viewer coordinates to page coordinates without accounting for page rotation
Parameters:
Name Type Description windowPtCore.DisplayMode.Point Point in viewer coordinates pageNumbernumber The page number - Inherited From:
Returns:
Point in unrotated page coordinates with pageNumber