polotno-node 2.15.19 → 3.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 +15 -15
- package/dist/assets/{html2canvas-DyNBkGVl.js → html2canvas-CfrNTgDn.js} +1 -1
- package/dist/assets/index-oYy3TsOk.js +464 -0
- package/dist/assets/{index.es-Ci1IK4T_.js → index.es-C7BBG6KT.js} +5 -5
- package/dist/assets/jspdf.es.min-D1g0nHTs.js +79 -0
- package/dist/assets/lib-U0NRl5MI.js +65 -0
- package/dist/assets/purify.es-DlxR2Lg_.js +3 -0
- package/dist/index.html +1 -1
- package/font-cache.js +109 -0
- package/index.d.ts +7 -0
- package/index.js +2 -0
- package/instance.js +205 -223
- package/package.json +20 -16
- package/dist/assets/index-zOfyRUBK.js +0 -344
- package/dist/assets/jspdf.es.min-kwORMdcW.js +0 -79
- package/dist/assets/lib-BagY_77q.js +0 -65
- package/dist/assets/purify.es-D7J7JQWp.js +0 -3
- package/video-parallel.js +0 -414
- /package/dist/assets/{typeof-DmQ5kzpc.js → typeof-B5XbjTb1.js} +0 -0
package/README.md
CHANGED
|
@@ -71,6 +71,14 @@ const instance = await createInstance({
|
|
|
71
71
|
// see "Custom Browser Arguments" section for more details
|
|
72
72
|
browserArgs: ['--custom-arg'],
|
|
73
73
|
|
|
74
|
+
// useFontCache - cache Google Fonts responses (in memory + on disk in the
|
|
75
|
+
// OS temp folder, shared across processes) and serve them to every page.
|
|
76
|
+
// Every page starts with an empty HTTP cache, so without it each render
|
|
77
|
+
// re-downloads the same fonts and bursts of parallel renders may get
|
|
78
|
+
// throttled by Google Fonts (fonts time out and text falls back to a
|
|
79
|
+
// default font). Default is true.
|
|
80
|
+
useFontCache: true,
|
|
81
|
+
|
|
74
82
|
// requestInterceptor - optional function to intercept and modify network requests
|
|
75
83
|
// Useful when you need to:
|
|
76
84
|
// - Modify headers like User-Agent to access protected image resources
|
|
@@ -283,31 +291,23 @@ Timeout for loading fonts. By default it is 6000ms.
|
|
|
283
291
|
const url = await instance.jsonToPDFDataURL(json, { fontLoadTimeout: 10000 });
|
|
284
292
|
```
|
|
285
293
|
|
|
286
|
-
### `attrs.
|
|
294
|
+
### `attrs.legacyRichTextEnabled`
|
|
287
295
|
|
|
288
|
-
|
|
296
|
+
Use the legacy (pre polotno 4) rich text renderer. By default it is `false` — the new text rendering engine is always on.
|
|
289
297
|
|
|
290
298
|
```js
|
|
291
299
|
const url = await instance.jsonToPDFDataURL(json, {
|
|
292
|
-
|
|
300
|
+
legacyRichTextEnabled: true,
|
|
293
301
|
});
|
|
294
302
|
```
|
|
295
303
|
|
|
296
|
-
### `attrs.
|
|
304
|
+
### `attrs.richTextEnabled` (deprecated)
|
|
297
305
|
|
|
298
|
-
⚠️ **Deprecated:**
|
|
306
|
+
⚠️ **Deprecated:** No-op since polotno 4 — the new text rendering engine is always enabled. The option is still accepted, but it does nothing. Use `legacyRichTextEnabled` if you need the old renderer.
|
|
299
307
|
|
|
300
|
-
|
|
301
|
-
// Old (deprecated)
|
|
302
|
-
const url = await instance.jsonToPDFDataURL(json, {
|
|
303
|
-
htmlTextRenderEnabled: true,
|
|
304
|
-
});
|
|
308
|
+
### `attrs.htmlTextRenderEnabled` (deprecated)
|
|
305
309
|
|
|
306
|
-
|
|
307
|
-
const url = await instance.jsonToPDFDataURL(json, {
|
|
308
|
-
richTextEnabled: true,
|
|
309
|
-
});
|
|
310
|
-
```
|
|
310
|
+
⚠️ **Deprecated:** No-op since polotno 4, same as `richTextEnabled`.
|
|
311
311
|
|
|
312
312
|
### `attrs.textVerticalResizeEnabled`
|
|
313
313
|
|