Move the maxCanvasPixels option to a BaseViewer/PDFPageView option

This removes the `PDFJS.maxCanvasPixels` dependency from the viewer components, but please note that as a *temporary* solution the default viewer still uses it.
This commit is contained in:
Jonas Jenwald 2018-02-13 13:02:15 +01:00
parent f4280368f7
commit fdf99c6af5
3 changed files with 18 additions and 5 deletions

View file

@ -50,6 +50,9 @@ const DEFAULT_CACHE_SIZE = 10;
* @property {string} renderer - 'canvas' or 'svg'. The default is 'canvas'.
* @property {boolean} useOnlyCssZoom - (optional) Enables CSS only zooming.
* The default value is `false`.
* @property {number} maxCanvasPixels - (optional) The maximum supported canvas
* size in total pixels, i.e. width * height. Use -1 for no limit.
* The default value is 4096 * 4096 (16 mega-pixels).
* @property {IL10n} l10n - Localization service.
*/
@ -114,6 +117,7 @@ class BaseViewer {
this.enablePrintAutoRotate = options.enablePrintAutoRotate || false;
this.renderer = options.renderer || RendererType.CANVAS;
this.useOnlyCssZoom = options.useOnlyCssZoom || false;
this.maxCanvasPixels = options.maxCanvasPixels;
this.l10n = options.l10n || NullL10n;
this.defaultRenderingQueue = !options.renderingQueue;
@ -381,6 +385,7 @@ class BaseViewer {
renderInteractiveForms: this.renderInteractiveForms,
renderer: this.renderer,
useOnlyCssZoom: this.useOnlyCssZoom,
maxCanvasPixels: this.maxCanvasPixels,
l10n: this.l10n,
});
bindOnAfterAndBeforeDraw(pageView);