diff --git a/src/display/api.js b/src/display/api.js index 5b9a25d42..93a3c890a 100644 --- a/src/display/api.js +++ b/src/display/api.js @@ -1202,8 +1202,6 @@ class PDFDocumentProxy { * The default value is `AnnotationMode.ENABLE`. * @property {Array} [transform] - Additional transform, applied just * before viewport transform. - * @property {Object} [canvasFactory] - The factory instance that will be used - * when creating canvases. The default value is {new DOMCanvasFactory()}. * @property {CanvasGradient | CanvasPattern | string} [background] - Background * to use for the canvas. * Any valid `canvas.fillStyle` can be used: a `DOMString` parsed as CSS @@ -1408,7 +1406,6 @@ class PDFPageProxy { intent = "display", annotationMode = AnnotationMode.ENABLE, transform = null, - canvasFactory = null, background = null, optionalContentConfigPromise = null, annotationCanvasMap = null, @@ -1417,9 +1414,9 @@ class PDFPageProxy { }) { if ( (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) && - canvasFactory + arguments[0]?.canvasFactory ) { - deprecated( + throw new Error( "render no longer accepts the `canvasFactory`-option, " + "please pass it to the `getDocument`-function instead." ); @@ -1512,7 +1509,7 @@ class PDFPageProxy { annotationCanvasMap, operatorList: intentState.operatorList, pageIndex: this._pageIndex, - canvasFactory: canvasFactory || this._transport.canvasFactory, + canvasFactory: this._transport.canvasFactory, filterFactory: this._transport.filterFactory, useRequestAnimationFrame: !intentPrint, pdfBug: this._pdfBug,