[]
        
(Showing Draft Content)

PageViewport

Type Alias: PageViewport

PageViewport: object

PDF page viewport created based on scale, rotation and offset.

Type declaration

clone()

Clone viewport.

Parameters

args

Partial<PageViewport>

Returns

PageViewport

convertToPdfPoint()

Converts viewport coordinates to the PDF location. Useful for converting canvas pixel location(top/left) into PDF location (bottom/left).

Parameters

x

any

The x-coordinate.

y

any

The y-coordinate.

Returns

number[]

convertToViewportPoint()

Converts PDF point to the viewport coordinates. Useful for converting PDF location (bottom/left) into canvas pixel coordinates(top/left).

Parameters

x

number

The x-coordinate.

y

number

The y-coordinate.

Returns

number[]

convertToViewportRectangle()

Converts PDF rectangle to the viewport coordinates.

Parameters

rect

number[]

The xMin, yMin, xMax and yMax coordinates.

Returns

number[]

height

height: number

height

offsetX

offsetX: number

offsetY

offsetY: number

rotation

rotation: number

scale

scale: number

scale

transform

transform: number[]

Viewport transform.

viewBox

viewBox: number[]

viewBox

width

width: number

width