@pixldocs/canvas-renderer 0.5.190 → 0.5.192
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/README.md +40 -0
- package/dist/{index-Dt4aPZtQ.js → index-CqgOWYwR.js} +149 -9
- package/dist/{index-Dt4aPZtQ.js.map → index-CqgOWYwR.js.map} +1 -1
- package/dist/{index-BUm3wqlB.cjs → index-UIDDdWwb.cjs} +149 -9
- package/dist/{index-BUm3wqlB.cjs.map → index-UIDDdWwb.cjs.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +38 -0
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-DFGqTzvI.js → vectorPdfExport-DuVMxQSS.js} +7 -7
- package/dist/{vectorPdfExport-DFGqTzvI.js.map → vectorPdfExport-DuVMxQSS.js.map} +1 -1
- package/dist/{vectorPdfExport-Cgw8dB-L.cjs → vectorPdfExport-O8vRHBlU.cjs} +7 -7
- package/dist/{vectorPdfExport-Cgw8dB-L.cjs.map → vectorPdfExport-O8vRHBlU.cjs.map} +1 -1
- package/package.json +1 -1
|
@@ -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-UIDDdWwb.cjs");
|
|
7
7
|
const pdfFonts = require("./pdfFonts-BTj2f465.cjs");
|
|
8
8
|
function _interopNamespaceDefault(e) {
|
|
9
9
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
|
@@ -2525,7 +2525,7 @@ async function fetchSvgAsElement(imageUrl, colorMap) {
|
|
|
2525
2525
|
async function getRecoloredSvgDataUrl(imageUrl, colorMap) {
|
|
2526
2526
|
if (!colorMap || Object.keys(colorMap).length === 0) return null;
|
|
2527
2527
|
try {
|
|
2528
|
-
const { getNormalizedSvgUrl } = await Promise.resolve().then(() => require("./index-
|
|
2528
|
+
const { getNormalizedSvgUrl } = await Promise.resolve().then(() => require("./index-UIDDdWwb.cjs")).then((n) => n.canvasImageLoader);
|
|
2529
2529
|
return await getNormalizedSvgUrl(imageUrl, colorMap);
|
|
2530
2530
|
} catch {
|
|
2531
2531
|
return null;
|
|
@@ -3316,7 +3316,7 @@ async function fetchImageAsBase64(imageUrl, opts = {}) {
|
|
|
3316
3316
|
}
|
|
3317
3317
|
let fetchUrl = imageUrl;
|
|
3318
3318
|
if (imageUrl.startsWith("http://") || imageUrl.startsWith("https://")) {
|
|
3319
|
-
const { isPrivateUrl } = await Promise.resolve().then(() => require("./index-
|
|
3319
|
+
const { isPrivateUrl } = await Promise.resolve().then(() => require("./index-UIDDdWwb.cjs")).then((n) => n.canvasImageLoader);
|
|
3320
3320
|
if (isPrivateUrl(imageUrl)) return null;
|
|
3321
3321
|
const proxyUrl = new URL(`${index.API_URL}/image-proxy`);
|
|
3322
3322
|
proxyUrl.searchParams.set("url", imageUrl);
|
|
@@ -4923,7 +4923,7 @@ function preparePagesForExport(pages, canvasWidth, canvasHeight, options) {
|
|
|
4923
4923
|
}
|
|
4924
4924
|
async function exportMultiPagePdf(pages, options) {
|
|
4925
4925
|
var _a, _b, _c, _d, _e;
|
|
4926
|
-
const { filename = "document.pdf", title, watermark = false, returnBlob = false, pdfTextMode = "selectable" } = options;
|
|
4926
|
+
const { filename = "document.pdf", title, watermark = false, returnBlob = false, pdfTextMode = "selectable", skipLiveCanvasSvgFastPath = false } = options;
|
|
4927
4927
|
pdfFonts.resetPdfFontRegistry();
|
|
4928
4928
|
if (pages.length === 0) {
|
|
4929
4929
|
throw new Error("No pages to export");
|
|
@@ -5067,8 +5067,8 @@ async function exportMultiPagePdf(pages, options) {
|
|
|
5067
5067
|
}
|
|
5068
5068
|
}
|
|
5069
5069
|
const liveCanvasForPage = page.pageId ? index.getCanvasForPage(page.pageId) : null;
|
|
5070
|
-
let allowLiveCanvasFallback = !!liveCanvasForPage;
|
|
5071
|
-
if (liveCanvasForPage) {
|
|
5070
|
+
let allowLiveCanvasFallback = !!liveCanvasForPage && !skipLiveCanvasSvgFastPath;
|
|
5071
|
+
if (liveCanvasForPage && !skipLiveCanvasSvgFastPath) {
|
|
5072
5072
|
try {
|
|
5073
5073
|
const liveSvgString = index.captureFabricCanvasSvgForPdf(
|
|
5074
5074
|
liveCanvasForPage,
|
|
@@ -5310,4 +5310,4 @@ exports.exportMultiPagePdf = exportMultiPagePdf;
|
|
|
5310
5310
|
exports.logTextMeasurementDiagnostic = logTextMeasurementDiagnostic;
|
|
5311
5311
|
exports.preparePagesForExport = preparePagesForExport;
|
|
5312
5312
|
exports.rewriteSvgFontsForJsPDFWithSourceMeta = rewriteSvgFontsForJsPDFWithSourceMeta;
|
|
5313
|
-
//# sourceMappingURL=vectorPdfExport-
|
|
5313
|
+
//# sourceMappingURL=vectorPdfExport-O8vRHBlU.cjs.map
|