@pixldocs/canvas-renderer 0.5.198 → 0.5.199

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.
@@ -16939,9 +16939,9 @@ function captureFabricCanvasSvgForPdf(fabricInstance, canvasWidth, canvasHeight)
16939
16939
  }
16940
16940
  return svgString;
16941
16941
  }
16942
- const resolvedPackageVersion = "0.5.198";
16942
+ const resolvedPackageVersion = "0.5.199";
16943
16943
  const PACKAGE_VERSION = resolvedPackageVersion;
16944
- const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.198";
16944
+ const DEPLOYMENT_VERSION_MARKER = "__PIXLDOCS_CANVAS_RENDERER_VERSION__:0.5.199";
16945
16945
  const roundParityValue = (value) => {
16946
16946
  if (typeof value !== "number") return value;
16947
16947
  return Number.isFinite(value) ? Number(value.toFixed(3)) : value;
@@ -17620,7 +17620,7 @@ class PixldocsRenderer {
17620
17620
  await this.waitForCanvasScene(container, cloned, i);
17621
17621
  }
17622
17622
  console.log(`[canvas-renderer][pdf-unified] mounted ${cloned.pages.length} page(s), handing off to client exportMultiPagePdf`);
17623
- const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-CBUSNaeP.cjs"));
17623
+ const { exportMultiPagePdf, preparePagesForExport } = await Promise.resolve().then(() => require("./vectorPdfExport-Dq4rWmf6.cjs"));
17624
17624
  const prepared = preparePagesForExport(
17625
17625
  cloned.pages,
17626
17626
  canvasWidth,
@@ -17631,26 +17631,13 @@ class PixldocsRenderer {
17631
17631
  watermark: !!options.watermark,
17632
17632
  returnBlob: true,
17633
17633
  pdfTextMode: options.textMode ?? (cloned == null ? void 0 : cloned.pdfTextMode) ?? ((_a = cloned.canvas) == null ? void 0 : _a.n) ?? "auto",
17634
- // IMPORTANT: We intentionally do NOT skip the live-canvas SVG fast path
17635
- // here, even when `shouldForcePerElement` is true via auto-detection.
17636
- //
17637
- // Reason: skipping the fast path forces the config-space export, which
17638
- // computes positions from stored values rather than the live Fabric
17639
- // layout (post auto-shrink, post text-init, post crop-group bake).
17640
- // That drift causes severe text overlap / mis-positioning in the PDF
17641
- // while the on-screen preview (which uses the live canvas) still looks
17642
- // correct. v0.5.191 shipped with this skip enabled and produced exactly
17643
- // that regression.
17644
- //
17645
- // The large-photo missing/corrupt image issue is solved by the
17646
- // `downscaleConfigRasterImages()` pre-pass above, which shrinks and
17647
- // recompresses oversized `data:image/*` sources before the canvas
17648
- // mounts. That keeps SVG capture reliable without altering layout.
17649
- //
17650
- // We still honor an explicit `forcePerElementPdf: true` from the host
17651
- // app (advanced opt-in for niche cases), but the auto path no longer
17652
- // toggles this flag.
17653
- skipLiveCanvasSvgFastPath: forceMode === true
17634
+ // Safari/WebKit can still let svg2pdf silently drop valid JPEG data-URL
17635
+ // <image> nodes even after the data is compressed and Fabric has loaded
17636
+ // it. For auto Safari mode, bypass only the full-page SVG->svg2pdf fast
17637
+ // path and use the live Fabric object PDF path instead, preserving live
17638
+ // matrices/order so we do not regress into stale config-space layout.
17639
+ skipLiveCanvasSvgFastPath: forceMode === true,
17640
+ useLiveCanvasObjectPdfPath: shouldForcePerElement && forceMode !== true
17654
17641
  });
17655
17642
  if (!result || typeof result === "undefined") {
17656
17643
  throw new Error("exportMultiPagePdf returned no blob (returnBlob path failed)");
@@ -19817,7 +19804,7 @@ async function prepareLiveCanvasSvgForPdf(rawSvg, pageWidth, pageHeight, pageKey
19817
19804
  if (options == null ? void 0 : options.stripPageBackground) stripRootPageBackgroundFromSvg(svgToDraw);
19818
19805
  sanitizeSvgTreeForPdf(svgToDraw);
19819
19806
  try {
19820
- const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-CBUSNaeP.cjs"));
19807
+ const { bakeTextAnchorPositionsFromLiveSvg, logTextMeasurementDiagnostic } = await Promise.resolve().then(() => require("./vectorPdfExport-Dq4rWmf6.cjs"));
19821
19808
  try {
19822
19809
  await logTextMeasurementDiagnostic(svgToDraw);
19823
19810
  } catch {
@@ -20214,4 +20201,4 @@ exports.setAutoShrinkDebug = setAutoShrinkDebug;
20214
20201
  exports.setBundledAssetPrefixes = setBundledAssetPrefixes;
20215
20202
  exports.warmResolvedTemplateForPreview = warmResolvedTemplateForPreview;
20216
20203
  exports.warmTemplateFromForm = warmTemplateFromForm;
20217
- //# sourceMappingURL=index-CM6Bzcyx.cjs.map
20204
+ //# sourceMappingURL=index-CEUoSPy-.cjs.map