polotno-node 2.2.1 → 2.4.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 +32 -0
- package/dist/assets/index-b2f4e4ff.js +372 -0
- package/dist/index.html +1 -1
- package/instance.js +31 -9
- package/package.json +5 -5
- package/dist/assets/index-ae105516.js +0 -370
package/README.md
CHANGED
|
@@ -131,6 +131,28 @@ const url = await instance.jsonToPDFDataURL(json);
|
|
|
131
131
|
res.json({ url });
|
|
132
132
|
```
|
|
133
133
|
|
|
134
|
+
### `instance.jsonToGIFDataURL(json, attrs)`
|
|
135
|
+
|
|
136
|
+
Export json into data url of GIF file with animations
|
|
137
|
+
|
|
138
|
+
```js
|
|
139
|
+
const json = JSON.parse(fs.readFileSync('polotno.json'));
|
|
140
|
+
|
|
141
|
+
const url = await instance.jsonToGIFDataURL(json);
|
|
142
|
+
res.json({ url });
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
### `instance.jsonToGIFBase64(json, attrs)`
|
|
146
|
+
|
|
147
|
+
Export json into data url of GIF file with animations
|
|
148
|
+
|
|
149
|
+
```js
|
|
150
|
+
const json = JSON.parse(fs.readFileSync('polotno.json'));
|
|
151
|
+
|
|
152
|
+
const base64 = await instance.jsonToGIFBase64(json);
|
|
153
|
+
fs.writeFileSync('out.gif', base64, 'base64');
|
|
154
|
+
```
|
|
155
|
+
|
|
134
156
|
### `attrs` usage
|
|
135
157
|
|
|
136
158
|
**NOTE: all export API will pass `attrs` object into relevant export function from `store`.**
|
|
@@ -159,6 +181,16 @@ const url = await instance.jsonToPDFDataURL(json, {
|
|
|
159
181
|
});
|
|
160
182
|
```
|
|
161
183
|
|
|
184
|
+
### `attrs.textVerticalResizeEnabled`
|
|
185
|
+
|
|
186
|
+
Enabled vertical text resize and align. By default it is `false`.
|
|
187
|
+
|
|
188
|
+
```js
|
|
189
|
+
const url = await instance.jsonToPDFDataURL(json, {
|
|
190
|
+
textVerticalResizeEnabled: true,
|
|
191
|
+
});
|
|
192
|
+
```
|
|
193
|
+
|
|
162
194
|
### `instance.run()`
|
|
163
195
|
|
|
164
196
|
Run any Polotno store API directly inside web-page context.
|