@overtone-art/canvas-editor-core 0.2.7 → 0.2.8

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/node.d.mts CHANGED
@@ -1,6 +1,55 @@
1
- import { c as EditorState } from './types-bOY7oYVq.mjs';
1
+ import { c as EditorState } from './types-D60CfxL9.mjs';
2
2
  import 'fabric';
3
3
 
4
+ interface PrintPdfOptions {
5
+ /** Rasterization density. Defaults to the document DPI, or 300. */
6
+ dpi?: number;
7
+ /** Bleed on every edge, in inches. Defaults to 0.125in. */
8
+ bleed?: number;
9
+ /** Space outside bleed reserved for printer marks, in inches. Defaults to 0.25in. */
10
+ marksMargin?: number;
11
+ trimMarks?: boolean;
12
+ registrationMarks?: boolean;
13
+ /** Optional safe-area inset in inches for preflight warnings. */
14
+ safeArea?: number;
15
+ /** Sharp built-in `cmyk` profile or an absolute path to a custom ICC profile. */
16
+ iccProfile?: string;
17
+ /** Ceiling on the rasterized bleed image, in pixels. Defaults to 250 megapixels. */
18
+ maxPixels?: number;
19
+ outputConditionIdentifier?: string;
20
+ title?: string;
21
+ allowImageUrl?: NodeRenderOptions['allowImageUrl'];
22
+ /** Preserve SVG shapes/text over a CMYK bleed raster. Defaults to `vector`. */
23
+ rendering?: 'vector' | 'raster';
24
+ /** PDFKit font registrations keyed by the exact SVG font-family name. */
25
+ fontFiles?: Record<string, string | Uint8Array>;
26
+ /** Convert text backed by `fontFiles` into glyph paths. Defaults to true. */
27
+ outlineFonts?: boolean;
28
+ }
29
+ interface PrintPdfResult {
30
+ format: 'pdf';
31
+ mimeType: 'application/pdf';
32
+ data: Uint8Array;
33
+ standard: 'PDF/X-4';
34
+ colourSpace: 'CMYK';
35
+ rendering: 'vector' | 'raster';
36
+ outlinedFonts: string[];
37
+ unoutlinedFonts: string[];
38
+ dpi: number;
39
+ trimWidthPoints: number;
40
+ trimHeightPoints: number;
41
+ bleedPoints: number;
42
+ warnings: string[];
43
+ }
44
+ /**
45
+ * Render an EditorState into a print-production PDF/X-4 file.
46
+ *
47
+ * The design is rasterized at the requested density, converted through Sharp's
48
+ * CMYK ICC pipeline, edge-extended into bleed, and embedded with output intent,
49
+ * trim/bleed boxes, XMP identification, and optional printer marks.
50
+ */
51
+ declare function renderPrintPdf(state: EditorState, options?: PrintPdfOptions): Promise<PrintPdfResult>;
52
+
4
53
  interface NodeRenderOptions {
5
54
  format?: 'png' | 'jpeg' | 'webp' | 'svg';
6
55
  multiplier?: number;
@@ -34,4 +83,4 @@ declare function renderMockupStateBatch(states: EditorState[], options?: NodeRen
34
83
  concurrency?: number;
35
84
  }): Promise<NodeRenderResult[]>;
36
85
 
37
- export { type NodeRenderOptions, type NodeRenderResult, renderEditorState, renderEditorStateBatch, renderMockupState, renderMockupStateBatch };
86
+ export { type NodeRenderOptions, type NodeRenderResult, type PrintPdfOptions, type PrintPdfResult, renderEditorState, renderEditorStateBatch, renderMockupState, renderMockupStateBatch, renderPrintPdf };
package/dist/node.d.ts CHANGED
@@ -1,6 +1,55 @@
1
- import { c as EditorState } from './types-bOY7oYVq.js';
1
+ import { c as EditorState } from './types-D60CfxL9.js';
2
2
  import 'fabric';
3
3
 
4
+ interface PrintPdfOptions {
5
+ /** Rasterization density. Defaults to the document DPI, or 300. */
6
+ dpi?: number;
7
+ /** Bleed on every edge, in inches. Defaults to 0.125in. */
8
+ bleed?: number;
9
+ /** Space outside bleed reserved for printer marks, in inches. Defaults to 0.25in. */
10
+ marksMargin?: number;
11
+ trimMarks?: boolean;
12
+ registrationMarks?: boolean;
13
+ /** Optional safe-area inset in inches for preflight warnings. */
14
+ safeArea?: number;
15
+ /** Sharp built-in `cmyk` profile or an absolute path to a custom ICC profile. */
16
+ iccProfile?: string;
17
+ /** Ceiling on the rasterized bleed image, in pixels. Defaults to 250 megapixels. */
18
+ maxPixels?: number;
19
+ outputConditionIdentifier?: string;
20
+ title?: string;
21
+ allowImageUrl?: NodeRenderOptions['allowImageUrl'];
22
+ /** Preserve SVG shapes/text over a CMYK bleed raster. Defaults to `vector`. */
23
+ rendering?: 'vector' | 'raster';
24
+ /** PDFKit font registrations keyed by the exact SVG font-family name. */
25
+ fontFiles?: Record<string, string | Uint8Array>;
26
+ /** Convert text backed by `fontFiles` into glyph paths. Defaults to true. */
27
+ outlineFonts?: boolean;
28
+ }
29
+ interface PrintPdfResult {
30
+ format: 'pdf';
31
+ mimeType: 'application/pdf';
32
+ data: Uint8Array;
33
+ standard: 'PDF/X-4';
34
+ colourSpace: 'CMYK';
35
+ rendering: 'vector' | 'raster';
36
+ outlinedFonts: string[];
37
+ unoutlinedFonts: string[];
38
+ dpi: number;
39
+ trimWidthPoints: number;
40
+ trimHeightPoints: number;
41
+ bleedPoints: number;
42
+ warnings: string[];
43
+ }
44
+ /**
45
+ * Render an EditorState into a print-production PDF/X-4 file.
46
+ *
47
+ * The design is rasterized at the requested density, converted through Sharp's
48
+ * CMYK ICC pipeline, edge-extended into bleed, and embedded with output intent,
49
+ * trim/bleed boxes, XMP identification, and optional printer marks.
50
+ */
51
+ declare function renderPrintPdf(state: EditorState, options?: PrintPdfOptions): Promise<PrintPdfResult>;
52
+
4
53
  interface NodeRenderOptions {
5
54
  format?: 'png' | 'jpeg' | 'webp' | 'svg';
6
55
  multiplier?: number;
@@ -34,4 +83,4 @@ declare function renderMockupStateBatch(states: EditorState[], options?: NodeRen
34
83
  concurrency?: number;
35
84
  }): Promise<NodeRenderResult[]>;
36
85
 
37
- export { type NodeRenderOptions, type NodeRenderResult, renderEditorState, renderEditorStateBatch, renderMockupState, renderMockupStateBatch };
86
+ export { type NodeRenderOptions, type NodeRenderResult, type PrintPdfOptions, type PrintPdfResult, renderEditorState, renderEditorStateBatch, renderMockupState, renderMockupStateBatch, renderPrintPdf };