@pixldocs/canvas-renderer 0.5.117 → 0.5.119

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.
Files changed (33) hide show
  1. package/dist/index-81pAjQOk.cjs +18489 -0
  2. package/dist/index-81pAjQOk.cjs.map +1 -0
  3. package/dist/index-CuTWdeXZ.js +18474 -0
  4. package/dist/index-CuTWdeXZ.js.map +1 -0
  5. package/dist/index.cjs +36 -18109
  6. package/dist/index.cjs.map +1 -1
  7. package/dist/index.d.ts +19 -1
  8. package/dist/index.js +36 -18092
  9. package/dist/index.js.map +1 -1
  10. package/dist/pdfFonts-CB5z77qO.js +1014 -0
  11. package/dist/pdfFonts-CB5z77qO.js.map +1 -0
  12. package/dist/{svgTextToPath-CQ2Tp03U.js → pdfFonts-CHHpRsRK.cjs} +304 -645
  13. package/dist/pdfFonts-CHHpRsRK.cjs.map +1 -0
  14. package/dist/pdfWatermark-CewmS9qQ.js +36 -0
  15. package/dist/pdfWatermark-CewmS9qQ.js.map +1 -0
  16. package/dist/pdfWatermark-DdBUt6s5.cjs +36 -0
  17. package/dist/pdfWatermark-DdBUt6s5.cjs.map +1 -0
  18. package/dist/{svgColorUtils-BkKZ8cyd.js → svgColorUtils-CIehRL4U.js} +262 -1
  19. package/dist/{svgColorUtils-BkKZ8cyd.js.map → svgColorUtils-CIehRL4U.js.map} +1 -1
  20. package/dist/{svgColorUtils-DQN6fbIM.cjs → svgColorUtils-DKcCq1sO.cjs} +262 -1
  21. package/dist/{svgColorUtils-DQN6fbIM.cjs.map → svgColorUtils-DKcCq1sO.cjs.map} +1 -1
  22. package/dist/svgTextToPath-B6FmPvcr.js +626 -0
  23. package/dist/svgTextToPath-B6FmPvcr.js.map +1 -0
  24. package/dist/svgTextToPath-B77kYzHp.cjs +665 -0
  25. package/dist/svgTextToPath-B77kYzHp.cjs.map +1 -0
  26. package/dist/vectorPdfExport-BrHHt_7L.js +4749 -0
  27. package/dist/vectorPdfExport-BrHHt_7L.js.map +1 -0
  28. package/dist/vectorPdfExport-CyJXH2cR.cjs +4766 -0
  29. package/dist/vectorPdfExport-CyJXH2cR.cjs.map +1 -0
  30. package/package.json +1 -1
  31. package/dist/svgTextToPath-4Y_THSBg.cjs +0 -1393
  32. package/dist/svgTextToPath-4Y_THSBg.cjs.map +0 -1
  33. package/dist/svgTextToPath-CQ2Tp03U.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -259,7 +259,7 @@ export declare function normalizeFontFamily(fontStack: string): string;
259
259
  * Package version banner. Bump alongside package.json so we can confirm
260
260
  * (via browser:log) that the deployed bundle matches the expected build.
261
261
  */
262
- export declare const PACKAGE_VERSION = "0.5.117";
262
+ export declare const PACKAGE_VERSION = "0.5.119";
263
263
 
264
264
  export declare interface PageSettings {
265
265
  backgroundColor?: string;
@@ -412,6 +412,15 @@ export declare class PixldocsRenderer {
412
412
  /**
413
413
  * Render a pre-resolved template config to a vector PDF.
414
414
  * Returns a Blob and ArrayBuffer.
415
+ *
416
+ * Unified path (v0.5.118+): delegates to the EXACT same
417
+ * `exportMultiPagePdf` pipeline used by the client-side editor / UseForm
418
+ * download buttons. This guarantees byte-identical output between the
419
+ * browser-side download and the server-side EC2 render — no separate SVG
420
+ * stitching path, no svg2pdf-only fallback. The only requirement is that
421
+ * each page is mounted as a real Fabric canvas (via `PreviewCanvas`) and
422
+ * registered in `fabricCanvasRegistry` before we hand off to the client
423
+ * exporter, which is what `renderPdfViaClientExport` does below.
415
424
  */
416
425
  renderPdf(templateConfig: TemplateConfig, options?: {
417
426
  title?: string;
@@ -428,6 +437,15 @@ export declare class PixldocsRenderer {
428
437
  * Convenience: fetch by ID with flat data and render ALL pages.
429
438
  */
430
439
  renderAllById(templateId: string, formData?: Record<string, any>, options?: Omit<RenderOptions, 'pageIndex'>): Promise<RenderResult[]>;
440
+ /**
441
+ * Mount every page of `templateConfig` as a real `PreviewCanvas` (so each
442
+ * `PageCanvas` registers its Fabric instance into `fabricCanvasRegistry`),
443
+ * then hand the prepared draw list off to the SAME `exportMultiPagePdf`
444
+ * function the client-side download buttons use. This guarantees 1:1
445
+ * parity between the browser-side PDF and the server-side EC2 PDF —
446
+ * same fonts, same gradients, same draw order, same selectable text.
447
+ */
448
+ private renderPdfViaClientExport;
431
449
  private getExpectedImageCount;
432
450
  private waitForCanvasImages;
433
451
  private waitForCanvasScene;