From 00d45fce33259d17c095fb057983924049de6e1e Mon Sep 17 00:00:00 2001 From: Jonas Jenwald Date: Wed, 10 Jun 2020 15:31:26 +0200 Subject: [PATCH] Update `SVGGraphics` to account for globally cached images (PR 11912 follow-up) Since there's (essentially) no tests for the SVG-backend, these changes didn't make in into PR 11912 when the code in the `src/display/canvas.js` file was modified. --- src/display/svg.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/display/svg.js b/src/display/svg.js index 3aa4cf083c915..81b1dc1a9e0a5 100644 --- a/src/display/svg.js +++ b/src/display/svg.js @@ -1560,7 +1560,9 @@ if (typeof PDFJSDev === "undefined" || PDFJSDev.test("GENERIC")) { } paintImageXObject(objId) { - const imgData = this.objs.get(objId); + const imgData = objId.startsWith("g_") + ? this.commonObjs.get(objId) + : this.objs.get(objId); if (!imgData) { warn(`Dependent image with object ID ${objId} is not ready yet`); return;