@pixldocs/canvas-renderer 0.5.156 → 0.5.157
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{index-DhIDZFPx.cjs → index-NR05ndTM.cjs} +5 -5
- package/dist/{index-DhIDZFPx.cjs.map → index-NR05ndTM.cjs.map} +1 -1
- package/dist/{index-DJQnrBbh.js → index-xn-L7QHB.js} +5 -5
- package/dist/{index-DJQnrBbh.js.map → index-xn-L7QHB.js.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-BbKisSsi.cjs → vectorPdfExport-CTktki-M.cjs} +15 -5
- package/dist/vectorPdfExport-CTktki-M.cjs.map +1 -0
- package/dist/{vectorPdfExport-DSTA9YWG.js → vectorPdfExport-CZyyQbwm.js} +15 -5
- package/dist/vectorPdfExport-CZyyQbwm.js.map +1 -0
- package/package.json +1 -1
- package/dist/vectorPdfExport-BbKisSsi.cjs.map +0 -1
- package/dist/vectorPdfExport-DSTA9YWG.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
-
const index = require("./index-
|
|
3
|
+
const index = require("./index-NR05ndTM.cjs");
|
|
4
4
|
exports.DEPLOYMENT_VERSION_MARKER = index.DEPLOYMENT_VERSION_MARKER;
|
|
5
5
|
exports.FONT_FALLBACK_DEVANAGARI = index.FONT_FALLBACK_DEVANAGARI;
|
|
6
6
|
exports.FONT_FALLBACK_MATH = index.FONT_FALLBACK_MATH;
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { D, F, o, q, s, P, t, u, v, w, x, y, z, B, C, E, G, H, I, J, K, L, b, M, N, O, Q, R, S, U, V, W, X, Y, Z, _ } from "./index-
|
|
1
|
+
import { D, F, o, q, s, P, t, u, v, w, x, y, z, B, C, E, G, H, I, J, K, L, b, M, N, O, Q, R, S, U, V, W, X, Y, Z, _ } from "./index-xn-L7QHB.js";
|
|
2
2
|
export {
|
|
3
3
|
D as DEPLOYMENT_VERSION_MARKER,
|
|
4
4
|
F as FONT_FALLBACK_DEVANAGARI,
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const jspdf = require("jspdf");
|
|
4
4
|
const svg2pdf_js = require("svg2pdf.js");
|
|
5
5
|
const fabric = require("fabric");
|
|
6
|
-
const index = require("./index-
|
|
6
|
+
const index = require("./index-NR05ndTM.cjs");
|
|
7
7
|
const pdfFonts = require("./svgTextToPath-7fhL08qs.cjs");
|
|
8
8
|
function _interopNamespaceDefault(e) {
|
|
9
9
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
@@ -1338,6 +1338,7 @@ function appendInvisibleSelectableTextLayer(svg) {
|
|
|
1338
1338
|
layer.setAttribute("data-pd-selectable-layer", "1");
|
|
1339
1339
|
layer.setAttribute("fill", "none");
|
|
1340
1340
|
layer.setAttribute("stroke", "none");
|
|
1341
|
+
layer.setAttribute("style", "fill: none; stroke: none;");
|
|
1341
1342
|
let cloned = 0;
|
|
1342
1343
|
for (const text of texts) {
|
|
1343
1344
|
if ((_a = text.closest) == null ? void 0 : _a.call(text, '[data-pd-selectable-layer="1"]')) continue;
|
|
@@ -1345,9 +1346,18 @@ function appendInvisibleSelectableTextLayer(svg) {
|
|
|
1345
1346
|
const clone = text.cloneNode(true);
|
|
1346
1347
|
clone.setAttribute("fill", "none");
|
|
1347
1348
|
clone.setAttribute("stroke", "none");
|
|
1349
|
+
clone.setAttribute("style", "fill: none; stroke: none;");
|
|
1348
1350
|
clone.removeAttribute("opacity");
|
|
1349
1351
|
clone.removeAttribute("fill-opacity");
|
|
1350
1352
|
clone.removeAttribute("stroke-opacity");
|
|
1353
|
+
for (const child of Array.from(clone.querySelectorAll("*"))) {
|
|
1354
|
+
child.setAttribute("fill", "none");
|
|
1355
|
+
child.setAttribute("stroke", "none");
|
|
1356
|
+
child.setAttribute("style", "fill: none; stroke: none;");
|
|
1357
|
+
child.removeAttribute("opacity");
|
|
1358
|
+
child.removeAttribute("fill-opacity");
|
|
1359
|
+
child.removeAttribute("stroke-opacity");
|
|
1360
|
+
}
|
|
1351
1361
|
layer.appendChild(clone);
|
|
1352
1362
|
cloned++;
|
|
1353
1363
|
}
|
|
@@ -1924,7 +1934,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
1924
1934
|
appendInvisibleSelectableTextLayer(svgToDraw);
|
|
1925
1935
|
await rasterizeShadowMarkers(svgToDraw);
|
|
1926
1936
|
await convertTextDecorationsToLines(svgToDraw);
|
|
1927
|
-
const outlined = await pdfFonts.convertAllTextToPath(new XMLSerializer().serializeToString(svgToDraw), void 0, { mode: "
|
|
1937
|
+
const outlined = await pdfFonts.convertAllTextToPath(new XMLSerializer().serializeToString(svgToDraw), void 0, { mode: "all" });
|
|
1928
1938
|
const outlinedDoc = parser.parseFromString(outlined, "image/svg+xml");
|
|
1929
1939
|
if (!outlinedDoc.querySelector("parsererror") && ((_a = outlinedDoc.documentElement) == null ? void 0 : _a.tagName.toLowerCase()) === "svg") {
|
|
1930
1940
|
svgToDraw = outlinedDoc.documentElement;
|
|
@@ -2513,7 +2523,7 @@ async function fetchSvgAsElement(imageUrl, colorMap) {
|
|
|
2513
2523
|
async function getRecoloredSvgDataUrl(imageUrl, colorMap) {
|
|
2514
2524
|
if (!colorMap || Object.keys(colorMap).length === 0) return null;
|
|
2515
2525
|
try {
|
|
2516
|
-
const { getNormalizedSvgUrl } = await Promise.resolve().then(() => require("./index-
|
|
2526
|
+
const { getNormalizedSvgUrl } = await Promise.resolve().then(() => require("./index-NR05ndTM.cjs")).then((n) => n.canvasImageLoader);
|
|
2517
2527
|
return await getNormalizedSvgUrl(imageUrl, colorMap);
|
|
2518
2528
|
} catch {
|
|
2519
2529
|
return null;
|
|
@@ -3294,7 +3304,7 @@ async function fetchImageAsBase64(imageUrl, opts = {}) {
|
|
|
3294
3304
|
}
|
|
3295
3305
|
let fetchUrl = imageUrl;
|
|
3296
3306
|
if (imageUrl.startsWith("http://") || imageUrl.startsWith("https://")) {
|
|
3297
|
-
const { isPrivateUrl } = await Promise.resolve().then(() => require("./index-
|
|
3307
|
+
const { isPrivateUrl } = await Promise.resolve().then(() => require("./index-NR05ndTM.cjs")).then((n) => n.canvasImageLoader);
|
|
3298
3308
|
if (isPrivateUrl(imageUrl)) return null;
|
|
3299
3309
|
const proxyUrl = new URL(`${index.API_URL}/image-proxy`);
|
|
3300
3310
|
proxyUrl.searchParams.set("url", imageUrl);
|
|
@@ -5277,4 +5287,4 @@ exports.exportMultiPagePdf = exportMultiPagePdf;
|
|
|
5277
5287
|
exports.logTextMeasurementDiagnostic = logTextMeasurementDiagnostic;
|
|
5278
5288
|
exports.preparePagesForExport = preparePagesForExport;
|
|
5279
5289
|
exports.rewriteSvgFontsForJsPDFWithSourceMeta = rewriteSvgFontsForJsPDFWithSourceMeta;
|
|
5280
|
-
//# sourceMappingURL=vectorPdfExport-
|
|
5290
|
+
//# sourceMappingURL=vectorPdfExport-CTktki-M.cjs.map
|