Merge pull request #15173 from Snuffleupagus/deprecated-svg
[api-minor] Deprecate the SVG back-end
This commit is contained in:
commit
5bfba89b0a
@ -14,6 +14,7 @@
|
||||
*/
|
||||
/* globals __non_webpack_require__ */
|
||||
|
||||
import { deprecated, DOMSVGFactory } from "./display_utils.js";
|
||||
import {
|
||||
FONT_IDENTITY_MATRIX,
|
||||
IDENTITY_MATRIX,
|
||||
@ -24,7 +25,6 @@ import {
|
||||
Util,
|
||||
warn,
|
||||
} from "../shared/util.js";
|
||||
import { DOMSVGFactory } from "./display_utils.js";
|
||||
import { isNodeJS } from "../shared/is_node.js";
|
||||
|
||||
/** @type {any} */
|
||||
@ -467,6 +467,9 @@ if (
|
||||
|
||||
SVGGraphics = class {
|
||||
constructor(commonObjs, objs, forceDataSchema = false) {
|
||||
deprecated(
|
||||
"The SVG back-end is no longer maintained and *may* be removed in the future."
|
||||
);
|
||||
this.svgFactory = new DOMSVGFactory();
|
||||
|
||||
this.current = new SVGExtraState();
|
||||
|
15
web/app.js
15
web/app.js
@ -1795,10 +1795,17 @@ const PDFViewerApplication = {
|
||||
this.pdfViewer.cleanup();
|
||||
this.pdfThumbnailViewer.cleanup();
|
||||
|
||||
// We don't want to remove fonts used by active page SVGs.
|
||||
this.pdfDocument.cleanup(
|
||||
/* keepLoadedFonts = */ this.pdfViewer.renderer === RendererType.SVG
|
||||
);
|
||||
if (
|
||||
typeof PDFJSDev === "undefined" ||
|
||||
PDFJSDev.test("!PRODUCTION || GENERIC")
|
||||
) {
|
||||
// We don't want to remove fonts used by active page SVGs.
|
||||
this.pdfDocument.cleanup(
|
||||
/* keepLoadedFonts = */ this.pdfViewer.renderer === RendererType.SVG
|
||||
);
|
||||
} else {
|
||||
this.pdfDocument.cleanup();
|
||||
}
|
||||
},
|
||||
|
||||
forceRendering() {
|
||||
|
@ -344,7 +344,11 @@ class PDFPageView {
|
||||
}
|
||||
this._resetZoomLayer();
|
||||
}
|
||||
if (this.svg) {
|
||||
if (
|
||||
(typeof PDFJSDev === "undefined" ||
|
||||
PDFJSDev.test("!PRODUCTION || GENERIC")) &&
|
||||
this.svg
|
||||
) {
|
||||
this.paintedViewportMap.delete(this.svg);
|
||||
delete this.svg;
|
||||
}
|
||||
@ -380,7 +384,11 @@ class PDFPageView {
|
||||
docStyle.setProperty("--scale-factor", this.viewport.scale);
|
||||
}
|
||||
|
||||
if (this.svg) {
|
||||
if (
|
||||
(typeof PDFJSDev === "undefined" ||
|
||||
PDFJSDev.test("!PRODUCTION || GENERIC")) &&
|
||||
this.svg
|
||||
) {
|
||||
this.cssTransform({
|
||||
target: this.svg,
|
||||
redrawAnnotationLayer: true,
|
||||
@ -733,6 +741,8 @@ class PDFPageView {
|
||||
};
|
||||
|
||||
const paintTask =
|
||||
(typeof PDFJSDev === "undefined" ||
|
||||
PDFJSDev.test("!PRODUCTION || GENERIC")) &&
|
||||
this.renderer === RendererType.SVG
|
||||
? this.paintOnSvg(canvasWrapper)
|
||||
: this.paintOnCanvas(canvasWrapper);
|
||||
|
Loading…
x
Reference in New Issue
Block a user