Limit even more SVG-specific code to the GENERIC viewer
Given that the SVG back-end is not defined anywhere except in GENERIC builds, we can remove a bit more unnecessary code in e.g. the Firefox PDF Viewer.
This commit is contained in:
parent
bf7eef7109
commit
f4e60ae986
@ -127,7 +127,6 @@ function isValidAnnotationEditorMode(mode) {
|
|||||||
* mainly for annotation icons. Include trailing slash.
|
* mainly for annotation icons. Include trailing slash.
|
||||||
* @property {boolean} [enablePrintAutoRotate] - Enables automatic rotation of
|
* @property {boolean} [enablePrintAutoRotate] - Enables automatic rotation of
|
||||||
* landscape pages upon printing. The default is `false`.
|
* landscape pages upon printing. The default is `false`.
|
||||||
* @property {string} renderer - 'canvas' or 'svg'. The default is 'canvas'.
|
|
||||||
* @property {boolean} [useOnlyCssZoom] - Enables CSS only zooming. The default
|
* @property {boolean} [useOnlyCssZoom] - Enables CSS only zooming. The default
|
||||||
* value is `false`.
|
* value is `false`.
|
||||||
* @property {number} [maxCanvasPixels] - The maximum supported canvas size in
|
* @property {number} [maxCanvasPixels] - The maximum supported canvas size in
|
||||||
@ -285,7 +284,12 @@ class BaseViewer {
|
|||||||
options.annotationEditorMode ?? ANNOTATION_EDITOR_MODE;
|
options.annotationEditorMode ?? ANNOTATION_EDITOR_MODE;
|
||||||
this.imageResourcesPath = options.imageResourcesPath || "";
|
this.imageResourcesPath = options.imageResourcesPath || "";
|
||||||
this.enablePrintAutoRotate = options.enablePrintAutoRotate || false;
|
this.enablePrintAutoRotate = options.enablePrintAutoRotate || false;
|
||||||
this.renderer = options.renderer || RendererType.CANVAS;
|
if (
|
||||||
|
typeof PDFJSDev === "undefined" ||
|
||||||
|
PDFJSDev.test("!PRODUCTION || GENERIC")
|
||||||
|
) {
|
||||||
|
this.renderer = options.renderer || RendererType.CANVAS;
|
||||||
|
}
|
||||||
this.useOnlyCssZoom = options.useOnlyCssZoom || false;
|
this.useOnlyCssZoom = options.useOnlyCssZoom || false;
|
||||||
this.maxCanvasPixels = options.maxCanvasPixels;
|
this.maxCanvasPixels = options.maxCanvasPixels;
|
||||||
this.l10n = options.l10n || NullL10n;
|
this.l10n = options.l10n || NullL10n;
|
||||||
@ -778,7 +782,11 @@ class BaseViewer {
|
|||||||
textHighlighterFactory: this,
|
textHighlighterFactory: this,
|
||||||
structTreeLayerFactory: this,
|
structTreeLayerFactory: this,
|
||||||
imageResourcesPath: this.imageResourcesPath,
|
imageResourcesPath: this.imageResourcesPath,
|
||||||
renderer: this.renderer,
|
renderer:
|
||||||
|
typeof PDFJSDev === "undefined" ||
|
||||||
|
PDFJSDev.test("!PRODUCTION || GENERIC")
|
||||||
|
? this.renderer
|
||||||
|
: null,
|
||||||
useOnlyCssZoom: this.useOnlyCssZoom,
|
useOnlyCssZoom: this.useOnlyCssZoom,
|
||||||
maxCanvasPixels: this.maxCanvasPixels,
|
maxCanvasPixels: this.maxCanvasPixels,
|
||||||
pageColors: this.pageColors,
|
pageColors: this.pageColors,
|
||||||
|
@ -80,7 +80,6 @@ import { NullL10n } from "./l10n_utils.js";
|
|||||||
* @property {Object} [textHighlighterFactory]
|
* @property {Object} [textHighlighterFactory]
|
||||||
* @property {string} [imageResourcesPath] - Path for image resources, mainly
|
* @property {string} [imageResourcesPath] - Path for image resources, mainly
|
||||||
* for annotation icons. Include trailing slash.
|
* for annotation icons. Include trailing slash.
|
||||||
* @property {string} renderer - 'canvas' or 'svg'. The default is 'canvas'.
|
|
||||||
* @property {boolean} [useOnlyCssZoom] - Enables CSS only zooming. The default
|
* @property {boolean} [useOnlyCssZoom] - Enables CSS only zooming. The default
|
||||||
* value is `false`.
|
* value is `false`.
|
||||||
* @property {number} [maxCanvasPixels] - The maximum supported canvas size in
|
* @property {number} [maxCanvasPixels] - The maximum supported canvas size in
|
||||||
@ -139,7 +138,12 @@ class PDFPageView {
|
|||||||
this.eventBus
|
this.eventBus
|
||||||
);
|
);
|
||||||
this.structTreeLayerFactory = options.structTreeLayerFactory;
|
this.structTreeLayerFactory = options.structTreeLayerFactory;
|
||||||
this.renderer = options.renderer || RendererType.CANVAS;
|
if (
|
||||||
|
typeof PDFJSDev === "undefined" ||
|
||||||
|
PDFJSDev.test("!PRODUCTION || GENERIC")
|
||||||
|
) {
|
||||||
|
this.renderer = options.renderer || RendererType.CANVAS;
|
||||||
|
}
|
||||||
this.l10n = options.l10n || NullL10n;
|
this.l10n = options.l10n || NullL10n;
|
||||||
|
|
||||||
this.paintTask = null;
|
this.paintTask = null;
|
||||||
|
@ -48,10 +48,13 @@ const SidebarView = {
|
|||||||
LAYERS: 4,
|
LAYERS: 4,
|
||||||
};
|
};
|
||||||
|
|
||||||
const RendererType = {
|
const RendererType =
|
||||||
CANVAS: "canvas",
|
typeof PDFJSDev === "undefined" || PDFJSDev.test("!PRODUCTION || GENERIC")
|
||||||
SVG: "svg",
|
? {
|
||||||
};
|
CANVAS: "canvas",
|
||||||
|
SVG: "svg",
|
||||||
|
}
|
||||||
|
: null;
|
||||||
|
|
||||||
const TextLayerMode = {
|
const TextLayerMode = {
|
||||||
DISABLE: 0,
|
DISABLE: 0,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user