@imgly/plugin-print-ready-pdfs-web 0.1.0-rc.1 → 1.0.0
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/README.md +33 -33
- package/package.json +4 -7
package/README.md
CHANGED
|
@@ -62,42 +62,42 @@ import { convertToPDFX3 } from '@imgly/plugin-print-ready-pdfs-web';
|
|
|
62
62
|
|
|
63
63
|
const config = {
|
|
64
64
|
license: 'your-cesdk-license',
|
|
65
|
-
ui: {
|
|
66
|
-
elements: {
|
|
67
|
-
navigation: {
|
|
68
|
-
action: {
|
|
69
|
-
custom: [
|
|
70
|
-
{
|
|
71
|
-
label: 'Export Print-Ready PDF',
|
|
72
|
-
iconName: '@imgly/icons/Essentials/Download',
|
|
73
|
-
callback: async () => {
|
|
74
|
-
const sceneId = cesdk.engine.scene.get();
|
|
75
|
-
const pdfBlob = await cesdk.engine.block.export(
|
|
76
|
-
sceneId,
|
|
77
|
-
'application/pdf'
|
|
78
|
-
);
|
|
79
|
-
const printReadyBlob = await convertToPDFX3(pdfBlob, {
|
|
80
|
-
outputProfile: 'fogra39',
|
|
81
|
-
title: 'Print-Ready Export',
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
// Download
|
|
85
|
-
const url = URL.createObjectURL(printReadyBlob);
|
|
86
|
-
const link = document.createElement('a');
|
|
87
|
-
link.href = url;
|
|
88
|
-
link.download = 'design-print-ready.pdf';
|
|
89
|
-
link.click();
|
|
90
|
-
URL.revokeObjectURL(url);
|
|
91
|
-
},
|
|
92
|
-
},
|
|
93
|
-
],
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
},
|
|
98
65
|
};
|
|
99
66
|
|
|
100
67
|
const cesdk = await CreativeEditorSDK.create('#editor', config);
|
|
68
|
+
await cesdk.createDesignScene();
|
|
69
|
+
|
|
70
|
+
// Add custom export button to the navigation bar
|
|
71
|
+
cesdk.ui.insertNavigationBarOrderComponent('last', {
|
|
72
|
+
id: 'ly.img.actions.navigationBar',
|
|
73
|
+
children: [
|
|
74
|
+
{
|
|
75
|
+
key: 'export-print-ready-pdf',
|
|
76
|
+
id: 'ly.img.action.navigationBar',
|
|
77
|
+
label: 'Export Print-Ready PDF',
|
|
78
|
+
iconName: '@imgly/Download',
|
|
79
|
+
onClick: async () => {
|
|
80
|
+
const sceneId = cesdk.engine.scene.get();
|
|
81
|
+
const pdfBlob = await cesdk.engine.block.export(
|
|
82
|
+
sceneId,
|
|
83
|
+
'application/pdf'
|
|
84
|
+
);
|
|
85
|
+
const printReadyBlob = await convertToPDFX3(pdfBlob, {
|
|
86
|
+
outputProfile: 'fogra39',
|
|
87
|
+
title: 'Print-Ready Export',
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
// Download
|
|
91
|
+
const url = URL.createObjectURL(printReadyBlob);
|
|
92
|
+
const link = document.createElement('a');
|
|
93
|
+
link.href = url;
|
|
94
|
+
link.download = 'design-print-ready.pdf';
|
|
95
|
+
link.click();
|
|
96
|
+
URL.revokeObjectURL(url);
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
],
|
|
100
|
+
});
|
|
101
101
|
```
|
|
102
102
|
|
|
103
103
|
## API Reference
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@imgly/plugin-print-ready-pdfs-web",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Print-Ready PDFs plugin for CE.SDK editor - PDF/X conversion and export functionality. Contains AGPL-3.0 licensed Ghostscript WASM.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"CE.SDK",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"src/wasm/"
|
|
41
41
|
],
|
|
42
42
|
"devDependencies": {
|
|
43
|
-
"@cesdk/cesdk-js": "~1.
|
|
44
|
-
"@cesdk/engine": "~1.
|
|
43
|
+
"@cesdk/cesdk-js": "~1.61.0",
|
|
44
|
+
"@cesdk/engine": "~1.61.0",
|
|
45
45
|
"@playwright/test": "^1.54.1",
|
|
46
46
|
"@types/emscripten": "^1.40.1",
|
|
47
47
|
"@types/node": "^20.11.0",
|
|
@@ -64,9 +64,6 @@
|
|
|
64
64
|
"injected": true
|
|
65
65
|
}
|
|
66
66
|
},
|
|
67
|
-
"peerDependencies": {
|
|
68
|
-
"@cesdk/cesdk-js": "^1.59.0"
|
|
69
|
-
},
|
|
70
67
|
"scripts": {
|
|
71
68
|
"start": "pnpm dev",
|
|
72
69
|
"clean": "pnpm exec rimraf dist",
|
|
@@ -89,7 +86,7 @@
|
|
|
89
86
|
"test:browser": "pnpm run build && playwright test test/browser-test.spec.ts",
|
|
90
87
|
"test:node": "pnpm run build && node test/node-test.mjs",
|
|
91
88
|
"test": "pnpm run test:integration",
|
|
92
|
-
"test:integration": "pnpm run build && vitest run",
|
|
89
|
+
"test:integration": "bash scripts/setup-test-tools.sh && pnpm run build && vitest run",
|
|
93
90
|
"test:profiles": "pnpm run build && vitest run profile-conversion",
|
|
94
91
|
"test:metadata": "pnpm run build && vitest run metadata-validation",
|
|
95
92
|
"test:content": "pnpm run build && vitest run content-preservation",
|