getPagesByPath = function getPagesByPath(path, pageWrapX, pageWrapY) {
    var result = [];
    pageWrapX = pageWrapX || this.pdf.internal.pageSize.width;
    pageWrapY = pageWrapY || this.pdf.internal.pageSize.height - this.margin[0] - this.margin[2];
    var yOffset = this.posY + this.ctx.prevPageLastElemOffset;

    switch (path.type) {
      default:
      case "mt":
      case "lt":
        result.push(Math.floor((path.y + yOffset) / pageWrapY) + 1);
        break;

      case "arc":
        result.push(Math.floor((path.y + yOffset - path.radius) / pageWrapY) + 1);
        result.push(Math.floor((path.y + yOffset + path.radius) / pageWrapY) + 1);
        break;

      case "qct":
        var rectOfQuadraticCurve = getQuadraticCurveBoundary(this.ctx.lastPoint.x, this.ctx.lastPoint.y, path.x1, path.y1, path.x, path.y);
        result.push(Math.floor((rectOfQuadraticCurve.y + yOffset) / pageWrapY) + 1);
        result.push(Math.floor((rectOfQuadraticCurve.y + rectOfQuadraticCurve.h + yOffset) / pageWrapY) + 1);
        break;

      case "bct":
        var rectOfBezierCurve = getBezierCurveBoundary(this.ctx.lastPoint.x, this.ctx.lastPoint.y, path.x1, path.y1, path.x2, path.y2, path.x, path.y);
        result.push(Math.floor((rectOfBezierCurve.y + yOffset) / pageWrapY) + 1);
        result.push(Math.floor((rectOfBezierCurve.y + rectOfBezierCurve.h + yOffset) / pageWrapY) + 1);
        break;

      case "rect":
        result.push(Math.floor((path.y + yOffset) / pageWrapY) + 1);
        result.push(Math.floor((path.y + path.h + yOffset) / pageWrapY) + 1);
    }

    for (var i = 0; i < result.length; i += 1) {
      while (this.pdf.internal.getNumberOfPages() < result[i]) {
        addPage.call(this);
      }
    }

    return result;
  }
Draws an image, canvas, or video onto the canvas

@function
@param img {} Specifies the image, canvas, or video element to use
@param sx {Number} Optional. The x coordinate where to start clipping
@param sy {Number} Optional. The y coordinate where to start clipping
@param swidth {Number} Optional. The width of the clipped image
@param sheight {Number} Optional. The height of the clipped image
@param x {Number} The x coordinate where to place the image on the canvas
@param y {Number} The y coordinate where to place the image on the canvas
@param width {Number} Optional. The width of the image to use (stretch or reduce the image)
@param height {Number} Optional. The height of the image to use (stretch or reduce the image)