new PageViewport()
PDF page viewport created based on scale, rotation and offset.
Methods
clone(args) → {PDFJS.PageViewport}
Clones viewport with additional properties.
Name | Type | Description |
---|---|---|
args | Object | (optional) If specified, may contain the 'scale' or 'rotation' properties to override the corresponding properties in the cloned viewport. |
Cloned viewport.
- Type:
- PDFJS.
PageViewport
convertToPdfPoint(x, y) → {Object}
Converts viewport coordinates to the PDF location. For examples, useful for converting canvas pixel location into PDF one.
Name | Type | Description |
---|---|---|
x | number | X coordinate. |
y | number | Y coordinate. |
- See
- convertToViewportPoint
Object that contains 'x' and 'y' properties of the point in the PDF coordinate space.
- Type:
- Object
convertToViewportPoint(x, y) → {Object}
Converts PDF point to the viewport coordinates. For examples, useful for converting PDF location into canvas pixel coordinates.
Name | Type | Description |
---|---|---|
x | number | X coordinate. |
y | number | Y coordinate. |
- See
- convertToPdfPoint
- convertToViewportRectangle
Object that contains 'x' and 'y' properties of the point in the viewport coordinate space.
- Type:
- Object
convertToViewportRectangle(rect) → {Array}
Converts PDF rectangle to the viewport coordinates.
Name | Type | Description |
---|---|---|
rect | Array | xMin, yMin, xMax and yMax coordinates. |
- See
- convertToViewportPoint
Contains corresponding coordinates of the rectangle in the viewport coordinate space.
- Type:
- Array