@imgly/codesign-mcp 0.3.0 → 0.3.1-next.20260827101508.gd4bd07a

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 (36) hide show
  1. package/assets/ai-plugins/apps.mjs +5 -5
  2. package/assets/ai-plugins/version.json +1 -1
  3. package/assets/docs/api/SKILL.md +2 -2
  4. package/assets/docs/api/index.d.ts +19 -3
  5. package/assets/docs/guide/SKILL.md +2 -2
  6. package/assets/docs/guide/actions.md +430 -0
  7. package/assets/docs/guide/api/node/interfaces/assetstylepreset.md +1 -1
  8. package/assets/docs/guide/api/node/type-aliases/exportoptions.md +1 -0
  9. package/assets/docs/guide/concepts/import-export.md +125 -0
  10. package/assets/docs/guide/concepts/plugin-architecture.md +187 -0
  11. package/assets/docs/guide/concepts.md +2 -0
  12. package/assets/docs/guide/conversion/to-pdf.md +1 -0
  13. package/assets/docs/guide/export-save-publish/export/compress.md +1 -0
  14. package/assets/docs/guide/export-save-publish/export/overview.md +5 -1
  15. package/assets/docs/guide/export-save-publish/export/to-pdf.md +17 -1
  16. package/assets/docs/guide/export-save-publish/for-printing.md +5 -0
  17. package/assets/docs/guide/file-format-support.md +3 -0
  18. package/assets/docs/guide/get-started/agent-skills.md +136 -34
  19. package/assets/docs/guide/get-started/cesdk-plugin-coding-agents.md +32 -10
  20. package/assets/docs/guide/guides.md +1 -0
  21. package/assets/docs/guide/open-the-editor/import-design/from-indesign.md +2 -0
  22. package/assets/docs/guide/open-the-editor/import-design/from-photoshop.md +4 -2
  23. package/assets/docs/guide/references/update-check.md +85 -0
  24. package/assets/docs/guide/rules/asset-handling.md +17 -6
  25. package/assets/docs/guide/rules/common-pitfalls.md +33 -22
  26. package/assets/docs/guide/rules/content-fill-mode.md +4 -4
  27. package/assets/docs/guide/rules/silent-init-errors.md +1 -1
  28. package/assets/docs/guide/rules/verify-properties-before-use.md +11 -2
  29. package/dist/assets/inline.generated.d.ts.map +1 -1
  30. package/dist/assets/inline.generated.js +28 -25
  31. package/dist/assets/inline.generated.js.map +1 -1
  32. package/dist/cli/trial-license.generated.d.ts +1 -1
  33. package/dist/cli/trial-license.generated.js +1 -1
  34. package/dist/cli/trial-license.generated.js.map +1 -1
  35. package/package.json +9 -9
  36. package/assets/docs/guide/api-reference/overview.md +0 -20
@@ -0,0 +1,125 @@
1
+ > This is one page of the CE.SDK Node.js documentation. For a complete overview, see the [Node.js Documentation Index](https://img.ly/docs/cesdk/node.md). For all docs in one file, see [llms-full.txt](./llms-full.txt.md).
2
+
3
+ **Navigation:** [Concepts](./concepts.md) > [Import and Export](./concepts/import-export.md)
4
+
5
+ ---
6
+
7
+ Understand every way files move in and out of CE.SDK—importing media and design files, loading and saving native scenes, and exporting finished output.
8
+
9
+ When developers ask whether CE.SDK "supports" a file format, the answer depends on which workflow they mean. Importing an image as content, converting a Photoshop file into an editable design, and rendering a finished PDF are three different operations with different format support. This page maps every way files come in and go out, and links to the guide for each workflow.
10
+
11
+ ![Diagram showing how files move in and out of CE.SDK: media assets, design files converted by importer packages and native design files flow into a scene; saving produces a re-editable scene string or archive, while exporting renders flattened final output](https://img.ly/docs/cesdk/./assets/import-export-flows.svg)
12
+
13
+ Everything in CE.SDK revolves around the *scene*—the block hierarchy that describes a design. Files coming in either add content to a scene or become a scene; files going out either preserve the scene for later editing or render it into final output. In Node.js, these workflows typically run headlessly: batch pipelines that convert, modify and render designs without a UI.
14
+
15
+ ## Three Ways Files Come In
16
+
17
+ ### Media Assets
18
+
19
+ Media assets are content placed *inside* a design: images, videos, audio clips and fonts. In headless workflows you add them programmatically through the asset and block APIs.
20
+
21
+ Media assets don't change the structure of a scene—they fill blocks with content. See the [Import Media](./import-media/overview.md) section, [Asset Concepts](./import-media/concepts.md) for the underlying architecture, and [File Format Support](./import-media/file-format-support.md) for the exact format list.
22
+
23
+ ### Native Design Files
24
+
25
+ CE.SDK persists designs in its own format, which loads back with full editability. Native files come in two variants:
26
+
27
+ - **Scene string** (`.scene`) — A serialized description of the block hierarchy. Assets are referenced by URL, not embedded, so the file is lightweight but depends on those URLs staying reachable.
28
+ - **Archive** (`.zip`) — A self-contained bundle of the scene file plus every referenced asset. Larger, but portable and usable offline.
29
+
30
+ The `.imgly` extension is used for both variants; the engine detects the format automatically when loading. Load native files with `engine.scene.load()` or `engine.scene.loadFromArchiveURL()`. See [Load a Scene](./open-the-editor/load-scene.md), [Import a Design](./open-the-editor/import-design.md) and [Import from Archive](./open-the-editor/import-design/from-archive.md).
31
+
32
+ ### Design Files From Other Tools
33
+
34
+ Files created in other design applications—Photoshop, InDesign, PowerPoint or PDF-producing tools—are not media assets. Instead, dedicated importer packages *convert* them into native CE.SDK scenes, preserving text, images, vector paths, positioning and colors as editable blocks:
35
+
36
+ | Source format | Package |
37
+ | --------------------- | ----------------------- |
38
+ | Photoshop (`.psd`) | `@imgly/psd-importer` |
39
+ | InDesign (`.idml`) | `@imgly/idml-importer` |
40
+ | PDF (`.pdf`) | `@imgly/pdf-importer` |
41
+ | PowerPoint (`.pptx`) | `@imgly/pptx-importer` |
42
+
43
+ The importers run in Node.js, which makes them a natural fit for server-side conversion pipelines—for example, converting uploaded files into scenes before handing them to an editor frontend. See [From InDesign](./open-the-editor/import-design/from-indesign.md) and [From Photoshop](./open-the-editor/import-design/from-photoshop.md) for integration guides.
44
+
45
+ #### Importer Features and Limitations
46
+
47
+ Each importer translates a subset of its source format, so review converted scenes—especially complex documents—before publishing. Where a feature can't be mapped one-to-one, the importers degrade gracefully. Typical examples:
48
+
49
+ - Linked, non-embedded images aren't resolved and import as placeholders (IDML, PDF).
50
+ - Mixing multiple fonts or font sizes within a single Photoshop text layer isn't supported, and unavailable fonts are substituted depending on the configured font strategy.
51
+ - PowerPoint tables, charts, SmartArt, animations and slide masters are skipped.
52
+
53
+ The npm page of each package maintains the up-to-date list of supported features and limitations: [`@imgly/psd-importer`](https://www.npmjs.com/package/@imgly/psd-importer), [`@imgly/idml-importer`](https://www.npmjs.com/package/@imgly/idml-importer), [`@imgly/pdf-importer`](https://www.npmjs.com/package/@imgly/pdf-importer) and [`@imgly/pptx-importer`](https://www.npmjs.com/package/@imgly/pptx-importer).
54
+
55
+ For any format without a ready-made importer, you can build your own converter with the scene and block APIs—see [Create From Scratch](./create-templates/from-scratch.md) for building a design programmatically.
56
+
57
+ ## Two Ways Files Go Out
58
+
59
+ ### Saving a Design
60
+
61
+ Saving preserves the scene for later editing. `engine.scene.saveToString()` produces a scene string with assets referenced by URL; `engine.scene.saveToArchive()` produces a self-contained archive with assets embedded. Both round-trip losslessly—loading a saved file restores the design exactly, with full editability.
62
+
63
+ A saved file is not viewable output: it only renders inside CE.SDK. To show a preview of a saved design elsewhere, export a thumbnail alongside it. See [Save](./export-save-publish/save.md) and [Create Thumbnail](./export-save-publish/create-thumbnail.md).
64
+
65
+ ### Exporting Final Output
66
+
67
+ Exporting renders the scene into a finished file for use outside CE.SDK. Export the whole scene, a single page or any individual block with `engine.block.export()`. Output covers images, vector graphics, print-ready PDF, audio, and raw pixel data—[File Format Support](./file-format-support.md) lists the exact formats in Node.js. Each output has a focused guide: [To PNG](./export-save-publish/export/to-png.md), [To JPEG](./export-save-publish/export/to-jpeg.md), [To WebP](./export-save-publish/export/to-webp.md), [To PDF](./export-save-publish/export/to-pdf.md) (including [print-ready output](./export-save-publish/for-printing.md) with underlayers and spot colors), [audio](./export-save-publish/export/audio.md) and [raw RGBA buffers](./export-save-publish/export/to-raw-data.md).
68
+
69
+ Video export to MP4 isn't available in the Node.js engine—render video in a browser environment instead.
70
+
71
+ Exports are flattened: text becomes pixels or paths, and the block structure is gone. An exported file can't be turned back into the original editable design. See [Export Options](./export-save-publish/export/overview.md) for configuration, plus [Partial Export](./export-save-publish/export/partial-export.md), [Pre-Export Validation](./export-save-publish/pre-export-validation.md), [Export for Social Media](./export-save-publish/for-social-media.md) and [Size Limits](./export-save-publish/export/size-limits.md).
72
+
73
+ ## Save vs. Export
74
+
75
+ The most common point of confusion is the difference between saving and exporting:
76
+
77
+ | | Save | Export |
78
+ | -------------- | ---------------------------------------- | --------------------------------------------- |
79
+ | Purpose | Continue editing later | Use the result outside CE.SDK |
80
+ | Output | `.scene` string, `.imgly`/`.zip` archive | Rendered files (PNG, PDF, MP4, …)|
81
+ | Re-editable | Yes, losslessly | No—content is flattened |
82
+ | Assets | Referenced by URL or embedded | Rendered into the output |
83
+ | Viewable outside CE.SDK | No | Yes |
84
+
85
+ A typical integration uses both: save the scene to your backend so users can keep editing, and export when they download or publish the result.
86
+
87
+ ## Common Questions
88
+
89
+ - **Can users upload a PDF or Photoshop file like an image?** Not as a media asset—the media path accepts images, video and audio only. PDF, PSD, IDML and PPTX files go through the importer packages, which convert them into editable scenes.
90
+ - **Why isn't my exported PDF editable when I import it back?** Exporting flattens the design. The PDF importer reconstructs an editable scene from any PDF, but it's a conversion, not a lossless round trip. To preserve editability, save the scene alongside the export.
91
+ - **What's the difference between `.scene`, `.imgly` and `.zip`?** `.scene` is always a scene string, `.zip` is always an archive, and `.imgly` is the recommended extension for either—the engine detects which one it is when loading.
92
+ - **Does a saved scene contain its images?** A scene string references assets by URL, so the design breaks if those URLs go away. An archive embeds all assets and is fully self-contained.
93
+
94
+ ## Format Support Reference
95
+
96
+ For the authoritative format tables—including codec details, size limits and known limitations—see [File Format Support](./file-format-support.md).
97
+
98
+ ## API Reference
99
+
100
+ | Method | Category | Purpose |
101
+ | ------------------------------ | -------- | ---------------------------------------------------------------- |
102
+ | `engine.scene.load()` | Import | Load a scene string, with automatic format detection |
103
+ | `engine.scene.loadFromArchiveURL()` | Import | Load a self-contained scene archive from a URL |
104
+ | `engine.scene.saveToString()` | Save | Serialize the scene to a string with assets referenced by URL |
105
+ | `engine.scene.saveToArchive()` | Save | Bundle the scene and all assets into a self-contained archive |
106
+ | `engine.block.export()` | Export | Render a block, page or scene to a final output format |
107
+
108
+ ## Next Steps
109
+
110
+ - [Import Media](./import-media/overview.md) — Bring images, video, audio and fonts into designs
111
+ - [Import a Design](./open-the-editor/import-design.md) — Load saved scenes and archives
112
+ - [Import Templates](./create-templates/import.md) — Load templates from URLs, archives and strings
113
+ - [Save](./export-save-publish/save.md) — Persist designs for later editing
114
+ - [Export Options](./export-save-publish/export/overview.md) — Configure output formats and quality
115
+
116
+
117
+
118
+ ---
119
+
120
+ ## More Resources
121
+
122
+ - **[Node.js Documentation Index](https://img.ly/docs/cesdk/node.md)** - Browse all Node.js documentation
123
+ - **[Complete Documentation](./llms-full.txt.md)** - Full documentation in one file (for LLMs)
124
+ - **[Web Documentation](./node.md)** - Interactive documentation with examples
125
+ - **[Support](mailto:support@img.ly)** - Contact IMG.LY support
@@ -0,0 +1,187 @@
1
+ > This is one page of the CE.SDK Node.js documentation. For a complete overview, see the [Node.js Documentation Index](https://img.ly/docs/cesdk/node.md). For all docs in one file, see [llms-full.txt](./llms-full.txt.md).
2
+
3
+ **Navigation:** [Concepts](./concepts.md) > [Plugin Architecture](./concepts/plugin-architecture.md)
4
+
5
+ ---
6
+
7
+ Understand which parts of CE.SDK's plugin system apply in headless
8
+ server-side setups and how to run an engine plugin without any editor UI.
9
+
10
+ > **Reading time:** 4 minutes
11
+ >
12
+ > **Resources:**
13
+ >
14
+ > - [Download examples](https://github.com/imgly/cesdk-web-examples/archive/refs/heads/main.zip)
15
+ >
16
+ > - [View source on GitHub](https://github.com/imgly/cesdk-web-examples/tree/main/guides-concepts-plugin-architecture-server-js)
17
+ >
18
+ > - [Open in StackBlitz](https://stackblitz.com/github/imgly/cesdk-web-examples/tree/v$UBQ_VERSION$/guides-concepts-plugin-architecture-server-js)
19
+
20
+ A plugin is a self-contained unit that packages engine behavior—asset sources, settings, callbacks—and attaches to an existing engine. CE.SDK for Web distinguishes two plugin layers: engine plugins, which only need the engine, and editor plugins, which extend the editor UI. Only the first layer applies on the server, where no editor exists.
21
+
22
+ ```typescript file=@cesdk_web_examples/guides-concepts-plugin-architecture-server-js/server-js.ts reference-only
23
+ import CreativeEngine, { EnginePlugin, EnginePluginContext } from '@cesdk/node';
24
+ import { config } from 'dotenv';
25
+
26
+ // Load environment variables from .env file
27
+ config();
28
+
29
+ /**
30
+ * CE.SDK Server Example: Plugin Architecture Guide
31
+ *
32
+ * Demonstrates that engine plugins run headless:
33
+ * - Defining an EnginePlugin
34
+ * - Applying it to the headless engine
35
+ * - Using the capability it added without any editor UI
36
+ */
37
+
38
+ // The same engine plugin shape as in the browser: only the engine
39
+ // is available in its context, so it runs anywhere the engine runs.
40
+ class BrandAssetsPlugin implements EnginePlugin {
41
+ name = 'brand-assets';
42
+
43
+ version = '1.0.0';
44
+
45
+ initialize({ engine }: EnginePluginContext): void {
46
+ engine.asset.addLocalSource('brand-assets');
47
+ engine.asset.addAssetToSource('brand-assets', {
48
+ id: 'brand-sticker',
49
+ label: { en: 'Brand Sticker' },
50
+ meta: {
51
+ uri: 'https://cdn.img.ly/assets/v3/ly.img.sticker/images/emoticons/imgly_sticker_emoticons_star.svg',
52
+ thumbUri:
53
+ 'https://cdn.img.ly/assets/v3/ly.img.sticker/images/emoticons/imgly_sticker_emoticons_star.svg',
54
+ blockType: '//ly.img.ubq/graphic',
55
+ fillType: '//ly.img.ubq/fill/image',
56
+ mimeType: 'image/svg+xml'
57
+ }
58
+ });
59
+ }
60
+ }
61
+
62
+ async function main(): Promise<void> {
63
+ // Initialize the headless Creative Engine
64
+ const engine = await CreativeEngine.init({
65
+ baseURL: process.env.IMGLY_LOCAL_ASSETS_URL
66
+ // license: process.env.CESDK_LICENSE,
67
+ });
68
+
69
+ try {
70
+ // @cesdk/node has no addPlugin() method — apply the plugin by
71
+ // invoking its initialize with the engine context
72
+ new BrandAssetsPlugin().initialize({ engine });
73
+
74
+ // The asset source registered by the plugin is available immediately
75
+ const result = await engine.asset.findAssets('brand-assets', {
76
+ page: 0,
77
+ perPage: 10
78
+ });
79
+ console.log(`brand-assets provides ${result.total} asset(s)`);
80
+
81
+ } finally {
82
+ // Always dispose the engine to free resources
83
+ engine.dispose();
84
+ }
85
+ }
86
+
87
+ main().catch((error) => {
88
+ // eslint-disable-next-line no-console
89
+ console.error('Example failed:', error);
90
+ process.exit(1);
91
+ });
92
+ ```
93
+
94
+ This guide covers the engine plugin contract, how to apply an engine plugin in Node.js, and why editor plugins don't run headless.
95
+
96
+ ## Engine Plugins Run Headless
97
+
98
+ An engine plugin implements `EnginePlugin` (`name`, `version`, `initialize(context)`). Its context contains only the `engine`, so the same plugin class runs in the browser, in headless browser setups, and in Node.js. This one registers an asset source:
99
+
100
+ ```typescript highlight-engine-plugin
101
+ // The same engine plugin shape as in the browser: only the engine
102
+ // is available in its context, so it runs anywhere the engine runs.
103
+ class BrandAssetsPlugin implements EnginePlugin {
104
+ name = 'brand-assets';
105
+
106
+ version = '1.0.0';
107
+
108
+ initialize({ engine }: EnginePluginContext): void {
109
+ engine.asset.addLocalSource('brand-assets');
110
+ engine.asset.addAssetToSource('brand-assets', {
111
+ id: 'brand-sticker',
112
+ label: { en: 'Brand Sticker' },
113
+ meta: {
114
+ uri: 'https://cdn.img.ly/assets/v3/ly.img.sticker/images/emoticons/imgly_sticker_emoticons_star.svg',
115
+ thumbUri:
116
+ 'https://cdn.img.ly/assets/v3/ly.img.sticker/images/emoticons/imgly_sticker_emoticons_star.svg',
117
+ blockType: '//ly.img.ubq/graphic',
118
+ fillType: '//ly.img.ubq/fill/image',
119
+ mimeType: 'image/svg+xml'
120
+ }
121
+ });
122
+ }
123
+ }
124
+ ```
125
+
126
+ ### Applying the Plugin
127
+
128
+ In the browser, both `engine.addPlugin()` and `cesdk.addPlugin()` exist. `@cesdk/node` has no `addPlugin()` method, so we apply the plugin by invoking its `initialize` with the engine context:
129
+
130
+ ```typescript highlight-register-engine-plugin
131
+ // @cesdk/node has no addPlugin() method — apply the plugin by
132
+ // invoking its initialize with the engine context
133
+ new BrandAssetsPlugin().initialize({ engine });
134
+ ```
135
+
136
+ ### Using What the Plugin Added
137
+
138
+ The asset source registered by the plugin is available like any other:
139
+
140
+ ```typescript highlight-verify-source
141
+ // The asset source registered by the plugin is available immediately
142
+ const result = await engine.asset.findAssets('brand-assets', {
143
+ page: 0,
144
+ perPage: 10
145
+ });
146
+ console.log(`brand-assets provides ${result.total} asset(s)`);
147
+ ```
148
+
149
+ ### Cleaning Up
150
+
151
+ As in every server-side example, dispose the engine when you're done:
152
+
153
+ ```typescript highlight-cleanup
154
+ } finally {
155
+ // Always dispose the engine to free resources
156
+ engine.dispose();
157
+ }
158
+ ```
159
+
160
+ ## Editor Plugins Need the Editor
161
+
162
+ The second plugin layer—editor plugins implementing `EditorPlugin`—receives a `cesdk` instance in its context and extends the editor UI: dock entries, panels, translations. Since no editor exists on the server, these plugins can't run here. Most official `@imgly/plugin-*` packages are editor plugins; check each plugin's docs page for whether it supports headless use.
163
+
164
+ If a plugin mixes engine work with UI work, split the engine part into its own `EnginePlugin` so it stays usable in server-side pipelines.
165
+
166
+ ## Troubleshooting
167
+
168
+ - **A plugin fails in Node.js with a missing `cesdk`**: The plugin is an editor plugin and depends on the editor UI context. Use an engine plugin, or run it only where the editor exists.
169
+ - **`engine.addPlugin` is not a function**: `@cesdk/node` doesn't provide `addPlugin()`. Invoke the plugin's `initialize({ engine })` directly.
170
+ - **A format conversion package is "not working as a plugin"**: Importers and exporters are standalone packages, not plugins. Use the package's own API.
171
+
172
+ ## Next Steps
173
+
174
+ - [Headless Mode](./concepts/headless-mode.md) - Running the engine without UI
175
+ - [Architecture](./concepts/architecture.md) - How the CreativeEngine is structured
176
+ - [Print-Ready PDF](./plugins/print-ready-pdf.md) - An official plugin with server-side docs
177
+
178
+
179
+
180
+ ---
181
+
182
+ ## More Resources
183
+
184
+ - **[Node.js Documentation Index](https://img.ly/docs/cesdk/node.md)** - Browse all Node.js documentation
185
+ - **[Complete Documentation](./llms-full.txt.md)** - Full documentation in one file (for LLMs)
186
+ - **[Web Documentation](./node.md)** - Interactive documentation with examples
187
+ - **[Support](mailto:support@img.ly)** - Contact IMG.LY support
@@ -15,6 +15,7 @@ Key Concepts and principles of CE.SDK.
15
15
  - [Key Concepts](./key-concepts.md) - Explore CE.SDK’s key features—manual editing, automation, templates, AI tools, and full UI and API control.
16
16
  - [Key Capabilities](./key-capabilities.md) - Explore CE.SDK’s key features—manual editing, automation, templates, AI tools, and full UI and API control.
17
17
  - [Architecture](./concepts/architecture.md) - Understand how CE.SDK is structured around the CreativeEngine—the core runtime with six APIs for scenes, blocks, assets, events, variables, and editor state.
18
+ - [Plugin Architecture](./concepts/plugin-architecture.md) - Understand how CE.SDK plugins fit together—what a plugin is, how it attaches to the editor or engine, and which extension surfaces it can reach.
18
19
  - [Terminology](./concepts/terminology.md) - Definitions for the core terms and concepts used throughout CE.SDK documentation, including Engine, Scene, Block, Fill, Shape, Effect, and more.
19
20
  - [Editing Workflow](./concepts/editing-workflow.md) - Control editing access with Creator, Adopter, Viewer, and Presenter roles using global and block-level scopes for tailored permissions.
20
21
  - [Blocks](./concepts/blocks.md) - Learn how blocks define elements in a scene and how to structure them for rendering in CE.SDK.
@@ -22,6 +23,7 @@ Key Concepts and principles of CE.SDK.
22
23
  - [Pages](./concepts/pages.md) - Pages structure scenes in CE.SDK and must share the same dimensions to ensure consistent rendering.
23
24
  - [Assets](./concepts/assets.md) - Learn how assets provide external content to CE.SDK designs and how asset sources make them available programmatically.
24
25
  - [Templating](./concepts/templating.md) - Templates enable dynamic, reusable designs with text variables and placeholder media. Learn to create, load, and personalize templates programmatically.
26
+ - [Import and Export](./concepts/import-export.md) - Understand every way files move in and out of CE.SDK—importing media and design files, loading and saving native scenes, and exporting finished output.
25
27
  - [Events](./concepts/events.md) - Subscribe to block creation, update, and deletion events to track changes in your CE.SDK scene.
26
28
  - [Buffers](./concepts/buffers.md) - Use buffers to store temporary, non-serializable data in CE.SDK via the CreativeEngine API.
27
29
  - [Resources](./concepts/resources.md) - Learn how CE.SDK loads and manages external media files, including preloading for performance, handling transient data, and relocating resources when URLs change.
@@ -92,6 +92,7 @@ The `exportPdfWithHighCompatibility` flag significantly impacts PDF export perfo
92
92
  **When `false` (faster but needs testing):**
93
93
 
94
94
  - Embeds images and gradients directly as native PDF objects
95
+ - Embeds unmodified JPEG images with their original data, so photos are neither decoded nor encoded again
95
96
  - 6-15x faster export performance for high-DPI content
96
97
  - Smaller file sizes (typically 30-40% reduction)
97
98
  - May have rendering issues in Safari/macOS Preview with gradients that use transparency
@@ -179,6 +179,7 @@ All image exports support these compression-related options:
179
179
  | `pngCompressionLevel` | `number` | `5` | PNG compression level 0-9. Higher values produce smaller files but take longer. Quality is unaffected. |
180
180
  | `jpegQuality` | `number` | `0.9` | JPEG quality from >0 to 1. Higher values preserve more detail. |
181
181
  | `webpQuality` | `number` | `1.0` | WebP quality from >0 to 1. Value of 1.0 enables lossless mode. |
182
+ | `pdfImageQuality` | `number` | `1.0` | Quality from >0 to 1 for images that have to be rasterized during PDF export. Value of 1.0 keeps lossless encoding, lower values use lossy JPEG. |
182
183
  | `targetWidth` | `number` | — | Target output width in pixels. Must be used with `targetHeight`. |
183
184
  | `targetHeight` | `number` | — | Target output height in pixels. Must be used with `targetWidth`. |
184
185
  | `abortSignal` | `AbortSignal` | — | Signal to cancel the export operation. |
@@ -206,11 +206,14 @@ CE.SDK supports exporting scenes, pages, groups, or individual blocks in these f
206
206
  | JPEG | `image/jpeg` | No | Photographs, web images |
207
207
  | WebP | `image/webp` | Yes (lossless) | Web delivery, smaller files |
208
208
  | SVG | `image/svg+xml` | Yes | Scalable graphics, web embedding, post-processing |
209
+ | TGA | `image/x-tga` | Yes | Image pipelines that require TGA files |
209
210
  | PDF | `application/pdf` | Partial | Print, documents |
210
211
  | Binary | `application/octet-stream` | Yes | Raw data processing |
211
212
 
212
213
  Each format serves different purposes. PNG preserves transparency and works well for graphics with sharp edges or text. JPEG compresses photographs efficiently but drops transparency. WebP provides excellent compression with optional lossless mode. SVG produces scalable vector output ideal for web embedding and post-processing with standard SVG tooling. PDF preserves vector information for print workflows.
213
214
 
215
+ For the complete format compatibility matrix, including codecs and size limits, see [File Format Support](./file-format-support.md).
216
+
214
217
  ## Export Images
215
218
 
216
219
  ### Export to PNG
@@ -301,7 +304,7 @@ const pdfBlob = await engine.block.export(page, {
301
304
  });
302
305
  ```
303
306
 
304
- When `exportPdfWithHighCompatibility` is `true` (the default), images and effects are rasterized according to the scene's DPI setting. Set it to `false` for faster exports, though gradients with transparency may not render correctly in some PDF viewers.
307
+ When `exportPdfWithHighCompatibility` is `true` (the default), images and effects are rasterized according to the scene's DPI setting. Set it to `false` for faster exports, though gradients with transparency may not render correctly in some PDF viewers. With high compatibility disabled, CE.SDK embeds unmodified JPEG images with their original data, which keeps photo-heavy exports small. Use `pdfImageQuality` to encode the images that CE.SDK still has to rasterize as lossy JPEG.
305
308
 
306
309
  The underlayer options are useful for print workflows where you need a solid base layer (often white ink) beneath the design elements. The `underlayerSpotColorName` should match a spot color defined in your print workflow.
307
310
 
@@ -311,6 +314,7 @@ The underlayer options are useful for print workflows where you need a solid bas
311
314
  | ------ | ---- | ------- | ----------- |
312
315
  | `mimeType` | `string` | - | Must be `'application/pdf'` |
313
316
  | `exportPdfWithHighCompatibility` | `boolean` | `true` | Rasterize images and effects (like gradients) according to the scene's DPI setting for broader viewer support |
317
+ | `pdfImageQuality` | `number` | `1.0` | Encoding quality for images that have to be rasterized; values below `1.0` encode them as lossy JPEG |
314
318
  | `exportPdfWithUnderlayer` | `boolean` | `false` | Add an underlayer behind existing elements matching the shape of page content |
315
319
  | `underlayerSpotColorName` | `string` | `''` | Spot color name for the underlayer fill (used with print workflows) |
316
320
  | `underlayerOffset` | `number` | `0` | Size adjustment for the underlayer shape in design units |
@@ -136,7 +136,7 @@ try {
136
136
  }
137
137
  ```
138
138
 
139
- This guide covers exporting designs to PDF format, configuring high compatibility mode, generating underlayers with spot colors, and controlling output dimensions.
139
+ This guide covers exporting designs to PDF format, configuring high compatibility mode, controlling the quality of rasterized images, generating underlayers with spot colors, and controlling output dimensions.
140
140
 
141
141
  ## Export to PDF
142
142
 
@@ -171,6 +171,21 @@ Use high compatibility mode when:
171
171
 
172
172
  High compatibility mode increases file size because complex elements are converted to raster images rather than remaining as vectors.
173
173
 
174
+ ## Control the Size of Rasterized Images
175
+
176
+ When `exportPdfWithHighCompatibility` is `false`, CE.SDK embeds the original data of unmodified JPEG images directly into the PDF. This keeps exports of photo-heavy documents such as photo books fast and small, because the photos are not decoded and encoded again.
177
+
178
+ CE.SDK must rasterize images that it cannot embed directly, for example images with effects or blurs applied, or every bitmap image when high compatibility mode is enabled. By default these images are encoded losslessly. Set `pdfImageQuality` to a value below `1.0` to encode them as lossy JPEG instead, which produces much smaller files.
179
+
180
+ ```typescript
181
+ const pdfBlob = await engine.block.export(page, {
182
+ mimeType: 'application/pdf',
183
+ pdfImageQuality: 0.85
184
+ });
185
+ ```
186
+
187
+ Valid values are greater than `0` and at most `1.0`. The default of `1.0` keeps the lossless encoding, in the same way as `webpQuality`. Images that are embedded as their original JPEG data are never encoded again, so this option does not change them.
188
+
174
189
  ## Generate Underlayers for Special Media
175
190
 
176
191
  Underlayers provide a base ink layer (typically white) for printing on transparent or non-white substrates like fabric, glass, or acrylic. The underlayer sits behind your design elements and provides opacity on transparent materials.
@@ -226,6 +241,7 @@ For print output, calculate the target dimensions based on your desired DPI:
226
241
  | ------ | ----------- |
227
242
  | `mimeType` | Output format. Must be `'application/pdf'`. |
228
243
  | `exportPdfWithHighCompatibility` | Rasterize complex elements at scene DPI for consistent rendering. Defaults to `true`. |
244
+ | `pdfImageQuality` | Encoding quality for images that CE.SDK has to rasterize. Values below the default of `1.0` encode them as lossy JPEG. |
229
245
  | `exportPdfWithUnderlayer` | Generate an underlayer from design contours. Defaults to `false`. |
230
246
  | `underlayerSpotColorName` | Spot color name for the underlayer ink. Required when `exportPdfWithUnderlayer` is true. |
231
247
  | `underlayerOffset` | Size adjustment in design units. Negative values shrink the underlayer inward. |
@@ -200,6 +200,10 @@ const standardPdf = await engine.block.export(page, {
200
200
  });
201
201
  ```
202
202
 
203
+ In this mode CE.SDK embeds unmodified JPEG images with their original data instead of rasterizing them, which strongly reduces export time and file size for photo-heavy documents such as photo books.
204
+
205
+ Print jobs usually keep the default `pdfImageQuality` of `1.0`, which encodes the images that still have to be rasterized losslessly. Lower the value only when a smaller file matters more than print fidelity.
206
+
203
207
  ## Underlayers for Special Media
204
208
 
205
209
  Underlayers provide a base ink layer (typically white) for printing on:
@@ -301,6 +305,7 @@ Increase the negative `underlayerOffset` value to shrink the underlayer further
301
305
  | `targetWidth` | Target width for exported PDF in pixels |
302
306
  | `targetHeight` | Target height for exported PDF in pixels |
303
307
  | `exportPdfWithHighCompatibility` | Rasterize bitmap images and gradients at scene DPI (default: `true`) |
308
+ | `pdfImageQuality` | Encoding quality for rasterized images; values below `1.0` use lossy JPEG (default: `1.0`) |
304
309
  | `exportPdfWithUnderlayer` | Generate underlayer from contours (default: `false`) |
305
310
  | `underlayerSpotColorName` | Spot color name for underlayer ink |
306
311
  | `underlayerOffset` | Size adjustment in design units (negative shrinks) |
@@ -16,6 +16,9 @@ This guide outlines supported formats and known limitations across media types.
16
16
 
17
17
  ## Importing Templates
18
18
 
19
+ See [Import and Export](./concepts/import-export.md) for
20
+ how these import and export workflows fit together.
21
+
19
22
  ## Font Formats
20
23
 
21
24
  ## Size Limits