Creates a display mode.
The viewer to lay out.
The layout mode.
OptionalisScrollable: boolean
Whether the layout scrolls. Defaults to true for every mode except Custom.
Lays out and returns the page numbers laid out
Returns the offset of a page.
Page number (1-based); unused.
Always (0, 0).
Display size of the page (full rotation, zoom not applied)
Displayed height in PDF points.
Displayed width in PDF points.
Always 0.
Always 0.
Returns the CSS scale applied to the viewer element.
Always 1 on both axes.
Horizontal scale.
Vertical scale.
The page each of the two window points falls on; null when on no page
The lower of the two page numbers; null when the point is on no page.
The higher of the two page numbers; null when the point is on no page.
Pages intersecting the viewport (extended by topMargin viewport heights up and down, and horizontalMargin viewport widths left and right), sorted by visible fraction in the unextended viewport, highest first. Extends by half a viewport each way by default, for prefetching.
OptionaltopMargin: numberOptionalhorizontalMargin: numberChecks whether the mode scrolls through all pages.
true for Continuous, FacingContinuous and Cover.
Checks whether the layout scrolls.
The value given to the constructor, or true for every mode except Custom.
Converts a point from page coordinates to window coordinates, applying zoom and the full page rotation.
Point in page coordinates.
Page number (1-based).
The point in window coordinates.
Ignores the page's own /Rotate: page coordinates are in display orientation (sizes of getPageInfo), with only the view rotation added
Overrides layout and coordinate methods with your own implementations; methods not given keep the default behavior.
The methods to override.
Deprecated custom grid: columns columns, only rows [startRow, endRow) laid out; switches to Custom mode
Converts a point from window coordinates to page coordinates of a page.
Point in window coordinates.
Page number (1-based).
The point in page coordinates, with the page number.
The page number passed in.
Like windowToPage, but ignores the page's own rotation: the result is in display orientation, with only the view rotation removed.
Point in window coordinates.
Page number (1-based).
The point in display-oriented page coordinates, with the page number.
The page number passed in.
A page layout mode together with the coordinate conversions between page and window coordinates. Page coordinates are unrotated, top-left origin, in PDF points; window coordinates are CSS pixels relative to the viewer element.