polotno-node 2.0.7 → 2.1.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 +16 -0
- package/dist/{client.51dfa0bd.js → client.7c21efff.js} +448 -762
- package/dist/client.html +1 -1
- package/index.js +12 -4
- package/instance.js +2 -1
- package/package.json +10 -5
package/README.md
CHANGED
|
@@ -131,6 +131,22 @@ const url = await instance.jsonToPDFDataURL(json);
|
|
|
131
131
|
res.json({ url });
|
|
132
132
|
```
|
|
133
133
|
|
|
134
|
+
### `attrs` usage
|
|
135
|
+
|
|
136
|
+
**NOTE: all export API will pass `attrs` object into relevant export function from `store`.**
|
|
137
|
+
|
|
138
|
+
```js
|
|
139
|
+
const url = await instance.jsonToDataURL(json, { pixelRatio: 0.2 });
|
|
140
|
+
// under the hood it will call:
|
|
141
|
+
// const url = await store.toDataURL({ pixelRatio: 0.2 });
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
In addition to that you can pass `assetLoadTimeout` attribute to `attrs` object. It will be used to set timeout for loading assets (images, fonts, etc). By default it is 30000ms.
|
|
145
|
+
|
|
146
|
+
```js
|
|
147
|
+
const url = await instance.jsonToPDFDataURL(json, { assetLoadTimeout: 60000 });
|
|
148
|
+
```
|
|
149
|
+
|
|
134
150
|
### `instance.run()`
|
|
135
151
|
|
|
136
152
|
Run any Polotno store API directly inside web-page context.
|