diff --git a/src/display/api.js b/src/display/api.js index 6a75d82886b75..45626fdb69c6d 100644 --- a/src/display/api.js +++ b/src/display/api.js @@ -904,15 +904,22 @@ class PDFPageProxy { * @param {number} rotate Degrees to rotate the viewport. If omitted this * defaults to the page rotation. * @param {boolean} dontFlip (optional) If true, axis Y will not be flipped. + * @param {number} offsetX (optional) The horizontal, i.e. x-axis, offset. + * The default value is `0`. + * @param {number} offsetY (optional) The vertical, i.e. y-axis, offset. + * The default value is `0`. * @return {PageViewport} Contains 'width' and 'height' properties * along with transforms required for rendering. */ - getViewport(scale, rotate = this.rotate, dontFlip = false) { + getViewport(scale, rotate = this.rotate, dontFlip = false, + offsetX = 0, offsetY = 0) { return new PageViewport({ viewBox: this.view, scale, rotation: rotate, dontFlip, + offsetX, + offsetY, }); }