@pixldocs/canvas-renderer 0.5.173 → 0.5.175
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-ChHYFk0E.js → index-CTIPncpy.js} +19 -15
- package/dist/{index-ChHYFk0E.js.map → index-CTIPncpy.js.map} +1 -1
- package/dist/{index-ZehEOqUB.cjs → index-DOxhZsjV.cjs} +19 -15
- package/dist/{index-ZehEOqUB.cjs.map → index-DOxhZsjV.cjs.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/{vectorPdfExport-BWDj55kq.cjs → vectorPdfExport-BZAl0Pdr.cjs} +17 -5
- package/dist/{vectorPdfExport-BWDj55kq.cjs.map → vectorPdfExport-BZAl0Pdr.cjs.map} +1 -1
- package/dist/{vectorPdfExport-CyTa-D1p.js → vectorPdfExport-COqBgUXt.js} +17 -5
- package/dist/{vectorPdfExport-CyTa-D1p.js.map → vectorPdfExport-COqBgUXt.js.map} +1 -1
- package/package.json +1 -1
|
@@ -16349,9 +16349,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
|
|
|
16349
16349
|
}
|
|
16350
16350
|
return svgString;
|
|
16351
16351
|
}
|
|
16352
|
-
const resolvedPackageVersion = "0.5.
|
|
16352
|
+
const resolvedPackageVersion = "0.5.175";
|
|
16353
16353
|
const PACKAGE_VERSION = resolvedPackageVersion;
|
|
16354
|
-
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.
|
|
16354
|
+
const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.175";
|
|
16355
16355
|
const roundParityValue = (value) => {
|
|
16356
16356
|
if (typeof value !== "number") return value;
|
|
16357
16357
|
return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
|
|
@@ -16725,7 +16725,8 @@ class PixldocsRenderer {
|
|
|
16725
16725
|
*/
|
|
16726
16726
|
async renderPdf(templateConfig, options) {
|
|
16727
16727
|
return this.renderPdfViaClientExport(templateConfig, {
|
|
16728
|
-
title: options == null ? void 0 : options.title
|
|
16728
|
+
title: options == null ? void 0 : options.title,
|
|
16729
|
+
textMode: options == null ? void 0 : options.textMode
|
|
16729
16730
|
});
|
|
16730
16731
|
}
|
|
16731
16732
|
/**
|
|
@@ -16733,7 +16734,7 @@ class PixldocsRenderer {
|
|
|
16733
16734
|
* This is the primary PDF export API — mirrors renderFromForm() but returns a PDF.
|
|
16734
16735
|
*/
|
|
16735
16736
|
async renderPdfFromForm(options) {
|
|
16736
|
-
const { templateId, formSchemaId, sectionState, themeId, watermark, watermarkOptions, prefetched, title, fontBaseUrl } = options;
|
|
16737
|
+
const { templateId, formSchemaId, sectionState, themeId, watermark, watermarkOptions, prefetched, title, fontBaseUrl, textMode } = options;
|
|
16737
16738
|
const resolved = await resolveFromForm({
|
|
16738
16739
|
templateId,
|
|
16739
16740
|
formSchemaId,
|
|
@@ -16751,7 +16752,8 @@ class PixldocsRenderer {
|
|
|
16751
16752
|
}
|
|
16752
16753
|
return this.renderPdfViaClientExport(configToRender, {
|
|
16753
16754
|
title: title ?? resolved.config.name,
|
|
16754
|
-
watermark: shouldWatermark
|
|
16755
|
+
watermark: shouldWatermark,
|
|
16756
|
+
textMode
|
|
16755
16757
|
});
|
|
16756
16758
|
}
|
|
16757
16759
|
async renderById(templateId, formData, options) {
|
|
@@ -16846,11 +16848,11 @@ class PixldocsRenderer {
|
|
|
16846
16848
|
await this.waitForCanvasScene(container, cloned, i);
|
|
16847
16849
|
const expected = this.getExpectedImageCount(cloned, i);
|
|
16848
16850
|
await this.waitForCanvasImages(container, expected);
|
|
16849
|
-
await this.waitForStableTextMetrics(container, cloned);
|
|
16851
|
+
await this.waitForStableTextMetrics(container, cloned, { clearGlobalCharCache: false });
|
|
16850
16852
|
await this.waitForCanvasScene(container, cloned, i);
|
|
16851
16853
|
}
|
|
16852
16854
|
console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
|
|
16853
|
-
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
16855
|
+
const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-BZAl0Pdr.cjs"));
|
|
16854
16856
|
const prepared = preparePagesForExport(
|
|
16855
16857
|
cloned.pages,
|
|
16856
16858
|
canvasWidth,
|
|
@@ -16860,7 +16862,7 @@ class PixldocsRenderer {
|
|
|
16860
16862
|
title: options.title,
|
|
16861
16863
|
watermark: !!options.watermark,
|
|
16862
16864
|
returnBlob: true,
|
|
16863
|
-
pdfTextMode: ((_a = cloned.canvas) == null ? void 0 : _a.n) ?? "
|
|
16865
|
+
pdfTextMode: options.textMode ?? (cloned == null ? void 0 : cloned.pdfTextMode) ?? ((_a = cloned.canvas) == null ? void 0 : _a.n) ?? "auto"
|
|
16864
16866
|
});
|
|
16865
16867
|
if (!result || typeof result === "undefined") {
|
|
16866
16868
|
throw new Error("exportMultiPagePdf returned no blob (returnBlob path failed)");
|
|
@@ -17489,7 +17491,7 @@ class PixldocsRenderer {
|
|
|
17489
17491
|
(_a = fabricInstance == null ? void 0 : fabricInstance.getObjects) == null ? void 0 : _a.call(fabricInstance).forEach((obj) => visit(obj));
|
|
17490
17492
|
logJsonLine("[canvas-renderer][fabric-text-parity]", { stage, textboxes: sample.length, sample });
|
|
17491
17493
|
}
|
|
17492
|
-
async waitForStableTextMetrics(container, config) {
|
|
17494
|
+
async waitForStableTextMetrics(container, config, options = {}) {
|
|
17493
17495
|
var _a, _b, _c;
|
|
17494
17496
|
if (typeof document !== "undefined") {
|
|
17495
17497
|
void ensureFontsForResolvedConfig(config);
|
|
@@ -17524,9 +17526,11 @@ class PixldocsRenderer {
|
|
|
17524
17526
|
obj.dirty = true;
|
|
17525
17527
|
}
|
|
17526
17528
|
};
|
|
17527
|
-
|
|
17528
|
-
|
|
17529
|
-
|
|
17529
|
+
if (options.clearGlobalCharCache !== false) {
|
|
17530
|
+
try {
|
|
17531
|
+
clearFabricCharCache();
|
|
17532
|
+
} catch {
|
|
17533
|
+
}
|
|
17530
17534
|
}
|
|
17531
17535
|
fabricInstance.getObjects().forEach(primeCharBounds);
|
|
17532
17536
|
(_a = fabricInstance.calcOffset) == null ? void 0 : _a.call(fabricInstance);
|
|
@@ -18986,7 +18990,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
|
|
|
18986
18990
|
if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
|
|
18987
18991
|
sanitizeSvgTreeForPdf(svgToDraw);
|
|
18988
18992
|
try {
|
|
18989
|
-
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-
|
|
18993
|
+
const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-BZAl0Pdr.cjs"));
|
|
18990
18994
|
try {
|
|
18991
18995
|
await logTextMeasurementDiagnostic(svgToDraw);
|
|
18992
18996
|
} catch {
|
|
@@ -19109,7 +19113,7 @@ async function assemblePdfFromSvgs(svgResults, options = {}) {
|
|
|
19109
19113
|
const shouldStripBg = stripPageBackground ?? hasGradient;
|
|
19110
19114
|
const textMode = options.textMode ?? (options.outlineText === true ? "pixel-perfect" : "selectable");
|
|
19111
19115
|
const shouldOutlineText = textMode === "pixel-perfect" || textMode === "auto";
|
|
19112
|
-
const outlineSubMode = textMode === "
|
|
19116
|
+
const outlineSubMode = textMode === "pixel-perfect" ? "all" : "gradient-only";
|
|
19113
19117
|
let pageSvg = page.svg;
|
|
19114
19118
|
try {
|
|
19115
19119
|
pageSvg = await convertSvgTextDecorationsToLinesString(pageSvg);
|
|
@@ -19396,4 +19400,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
|
|
|
19396
19400
|
exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
|
|
19397
19401
|
exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
|
|
19398
19402
|
exports.warmTemplateFromForm = warmTemplateFromForm;
|
|
19399
|
-
//# sourceMappingURL=index-
|
|
19403
|
+
//# sourceMappingURL=index-DOxhZsjV.cjs.map
|