n8n-nodes-htmlcsstopdf 3.1.9 → 3.2.1
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 +145 -11
- package/dist/nodes/HtmlCsstopdf/Htmlcsstopdf.node.js +64 -34
- package/dist/nodes/HtmlCsstopdf/Htmlcsstopdf.node.js.map +1 -1
- package/dist/nodes/HtmlCsstopdf/Htmlcsstopdf.node.json +59 -0
- package/dist/package.json +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -19,14 +19,18 @@ An n8n community node for creating PDFs from HTML/CSS or URLs, manipulating PDFs
|
|
|
19
19
|
- **Output Filename**: Set the resulting PDF filename
|
|
20
20
|
- **Configurable Timeout**: Increase timeouts for large/slow renders
|
|
21
21
|
- **PDF Manipulation**
|
|
22
|
-
- **Merge PDFs**: Merge 2–15 PDFs from URLs
|
|
22
|
+
- **Merge PDFs**: Merge 2–15 PDFs from URLs or multiple binary PDF inputs
|
|
23
23
|
- **Split PDF**: Extract specific pages, split each page, or split into chunks
|
|
24
24
|
- **Compress PDF**: Reduce file size with selectable compression levels
|
|
25
|
+
- **Watermark PDF**: Add text watermark with angle/opacity/font controls
|
|
26
|
+
- **Convert PDF to Image**: Convert selected pages to PNG/JPG/JPEG/WEBP
|
|
27
|
+
- **Convert Image to PDF**: Merge one or multiple images into a PDF
|
|
25
28
|
- **PDF Security**
|
|
26
|
-
- **Lock PDF**: Add password protection (optionally provide input password for already-encrypted PDFs)
|
|
27
|
-
- **Unlock PDF**: Remove password protection
|
|
29
|
+
- **Lock PDF**: Add password protection (optionally provide input password for already-encrypted PDFs), via URL or file input
|
|
30
|
+
- **Unlock PDF**: Remove password protection, via URL or file input
|
|
28
31
|
- **PDF Extraction & Parsing**
|
|
29
|
-
- **Parse PDF to JSON**: Extract text/layout/tables/full extraction with page selection
|
|
32
|
+
- **Parse PDF to JSON**: Extract text/layout/tables/full extraction with page selection, via URL or file input
|
|
33
|
+
- **Parse PDF with OCR**: OCR parse scanned PDFs with language/PSM/OEM settings
|
|
30
34
|
|
|
31
35
|
## Installation
|
|
32
36
|
|
|
@@ -115,17 +119,21 @@ Generate a PDF from a website URL.
|
|
|
115
119
|
### PDF Manipulation
|
|
116
120
|
|
|
117
121
|
#### Merge PDFs
|
|
118
|
-
Merge multiple
|
|
122
|
+
Merge multiple PDFs into one document.
|
|
119
123
|
|
|
120
124
|
**Parameters:**
|
|
121
|
-
- **
|
|
125
|
+
- **Input Type** (`merge_input_type`: `url` or `file`)
|
|
126
|
+
- **PDF URLs** (`pdf_urls`, comma-separated; minimum 2, maximum 15; URL mode)
|
|
127
|
+
- **File Binary Property Name (CSV)** (`merge_file_binary_properties`, file mode)
|
|
122
128
|
- **Output Type** (`merge_output`: `url`, `file`, or `base64`)
|
|
123
129
|
|
|
124
130
|
#### Split PDF
|
|
125
131
|
Split or extract pages from a PDF.
|
|
126
132
|
|
|
127
133
|
**Parameters:**
|
|
128
|
-
- **
|
|
134
|
+
- **Input Type** (`split_input_type`: `url` or `file`)
|
|
135
|
+
- **PDF URL** (`split_url`, URL mode)
|
|
136
|
+
- **File Binary Property** (`split_file_binary_property`, file mode)
|
|
129
137
|
- **Split Mode** (`split_mode`)
|
|
130
138
|
- `pages`: extract a page range/list via **Page Range** (`pages`)
|
|
131
139
|
- `each`: split each page into its own PDF
|
|
@@ -136,18 +144,57 @@ Split or extract pages from a PDF.
|
|
|
136
144
|
Compress a PDF to reduce file size.
|
|
137
145
|
|
|
138
146
|
**Parameters:**
|
|
139
|
-
- **
|
|
147
|
+
- **Input Type** (`compress_input_type`: `url` or `file`)
|
|
148
|
+
- **PDF URL** (`compress_url`, max 10MB, URL mode)
|
|
149
|
+
- **File Binary Property** (`compress_file_binary_property`, file mode)
|
|
140
150
|
- **Compression Level** (`compression`: `low`, `medium`, `high`, `max`)
|
|
141
151
|
- **Output Type** (`compress_output`: `url`, `file`, or `base64`)
|
|
142
152
|
- **Output Filename** (`compress_output_name`, e.g. `compressed.pdf`)
|
|
143
153
|
|
|
154
|
+
#### Watermark PDF
|
|
155
|
+
Add text watermark to a PDF.
|
|
156
|
+
|
|
157
|
+
**Parameters:**
|
|
158
|
+
- **Input Type** (`watermark_input_type`: `url` or `file`)
|
|
159
|
+
- **PDF URL** (`watermark_file_url`, URL mode)
|
|
160
|
+
- **File Binary Property** (`watermark_file_binary_property`, file mode)
|
|
161
|
+
- **Output Format** (`watermark_output_format`: `file`, `url`, `base64`, or `both`)
|
|
162
|
+
- **Watermark Text** (`watermark_text`)
|
|
163
|
+
- **Opacity** (`watermark_opacity`)
|
|
164
|
+
- **Angle** (`watermark_angle`)
|
|
165
|
+
- **Font Size** (`watermark_font_size`, optional)
|
|
166
|
+
|
|
167
|
+
#### Convert PDF to Image
|
|
168
|
+
Convert one or more PDF pages to images.
|
|
169
|
+
|
|
170
|
+
**Parameters:**
|
|
171
|
+
- **Input Type** (`convert_pdf_image_input_type`: `url` or `file`)
|
|
172
|
+
- **PDF URL** (`convert_pdf_image_url`, URL mode)
|
|
173
|
+
- **File Binary Property** (`convert_pdf_image_file_binary_property`, file mode)
|
|
174
|
+
- **Page** (`convert_pdf_image_page`, used when `Pages` is empty)
|
|
175
|
+
- **Pages** (`convert_pdf_image_pages`, e.g. `1-3` or `1,3,5`)
|
|
176
|
+
- **Image Format** (`convert_pdf_image_format`: `png`, `jpg`, `jpeg`, `webp`)
|
|
177
|
+
- **DPI** (`convert_pdf_image_dpi`)
|
|
178
|
+
- **Quality** (`convert_pdf_image_quality`)
|
|
179
|
+
- **Output Type** (`convert_pdf_image_output`: `url`, `base64`, `both`, or `file`)
|
|
180
|
+
|
|
181
|
+
#### Convert Image to PDF
|
|
182
|
+
Convert one or multiple image URLs into a PDF.
|
|
183
|
+
|
|
184
|
+
**Parameters:**
|
|
185
|
+
- **Image URLs** (`convert_image_pdf_urls`, comma-separated)
|
|
186
|
+
- **Output Type** (`convert_image_pdf_output`: `url`, `base64`, `both`, or `file`)
|
|
187
|
+
- **Output Filename** (`convert_image_pdf_filename`)
|
|
188
|
+
|
|
144
189
|
### PDF Security
|
|
145
190
|
|
|
146
191
|
#### Lock PDF
|
|
147
192
|
Add password protection to a PDF.
|
|
148
193
|
|
|
149
194
|
**Parameters:**
|
|
150
|
-
- **
|
|
195
|
+
- **Input Type** (`lock_input_type`: `url` or `file`)
|
|
196
|
+
- **PDF URL** (`lock_url`, max 10MB, URL mode)
|
|
197
|
+
- **File Binary Property** (`lock_file_binary_property`, file mode)
|
|
151
198
|
- **Password** (`lock_password`)
|
|
152
199
|
- **Input Password** (`lock_input_password`, optional)
|
|
153
200
|
- **Output Type** (`lock_output`: `url`, `file`, or `base64`)
|
|
@@ -157,7 +204,9 @@ Add password protection to a PDF.
|
|
|
157
204
|
Remove password protection from a PDF.
|
|
158
205
|
|
|
159
206
|
**Parameters:**
|
|
160
|
-
- **
|
|
207
|
+
- **Input Type** (`unlock_input_type`: `url` or `file`)
|
|
208
|
+
- **PDF URL** (`unlock_url`, max 10MB, URL mode)
|
|
209
|
+
- **File Binary Property** (`unlock_file_binary_property`, file mode)
|
|
161
210
|
- **Password** (`unlock_password`)
|
|
162
211
|
- **Output Type** (`unlock_output`: `url`, `file`, or `base64`)
|
|
163
212
|
- **Output Filename** (`unlock_output_name`, e.g. `unlocked.pdf`)
|
|
@@ -168,10 +217,25 @@ Remove password protection from a PDF.
|
|
|
168
217
|
Parse a PDF into structured JSON.
|
|
169
218
|
|
|
170
219
|
**Parameters:**
|
|
171
|
-
- **
|
|
220
|
+
- **Input Type** (`parse_input_type`: `url` or `file`)
|
|
221
|
+
- **PDF URL** (`parse_url`, URL mode)
|
|
222
|
+
- **File Binary Property** (`parse_file_binary_property`, file mode)
|
|
172
223
|
- **Parse Mode** (`parse_mode`: `text`, `layout`, `tables`, `full`)
|
|
173
224
|
- **Pages** (`parse_pages`: `all` or ranges like `1-3`)
|
|
174
225
|
|
|
226
|
+
#### Parse PDF with OCR
|
|
227
|
+
Parse scanned PDFs using OCR.
|
|
228
|
+
|
|
229
|
+
**Parameters:**
|
|
230
|
+
- **Input Type** (`parse_input_type`: `url` or `file`)
|
|
231
|
+
- **PDF URL** (`parse_url`, URL mode)
|
|
232
|
+
- **File Binary Property** (`parse_file_binary_property`, file mode)
|
|
233
|
+
- **Language** (`lang`, e.g. `eng` or `eng+hin`)
|
|
234
|
+
- **Pages** (`parse_pages`: `all` or ranges like `1-3`)
|
|
235
|
+
- **DPI** (`dpi`)
|
|
236
|
+
- **PSM** (`psm`)
|
|
237
|
+
- **OEM** (`oem`)
|
|
238
|
+
|
|
175
239
|
## Usage
|
|
176
240
|
|
|
177
241
|
### Basic HTML to PDF Conversion
|
|
@@ -232,6 +296,7 @@ Parse a PDF into structured JSON.
|
|
|
232
296
|
<p>This certifies that <strong>John Doe</strong> has completed the course.</p>
|
|
233
297
|
<div class="signature">Authorized Signature</div>
|
|
234
298
|
</div>
|
|
299
|
+
```
|
|
235
300
|
|
|
236
301
|
### PDF Manipulation Examples
|
|
237
302
|
|
|
@@ -240,16 +305,29 @@ Parse a PDF into structured JSON.
|
|
|
240
305
|
{
|
|
241
306
|
"resource": "pdfManipulation",
|
|
242
307
|
"operation": "mergePdfs",
|
|
308
|
+
"merge_input_type": "url",
|
|
243
309
|
"pdf_urls": "https://example.com/a.pdf, https://example.com/b.pdf",
|
|
244
310
|
"merge_output": "url"
|
|
245
311
|
}
|
|
246
312
|
```
|
|
247
313
|
|
|
314
|
+
#### Merge PDFs (File input)
|
|
315
|
+
```json
|
|
316
|
+
{
|
|
317
|
+
"resource": "pdfManipulation",
|
|
318
|
+
"operation": "mergePdfs",
|
|
319
|
+
"merge_input_type": "file",
|
|
320
|
+
"merge_file_binary_properties": "data1,data2",
|
|
321
|
+
"merge_output": "file"
|
|
322
|
+
}
|
|
323
|
+
```
|
|
324
|
+
|
|
248
325
|
#### Split PDF (extract pages)
|
|
249
326
|
```json
|
|
250
327
|
{
|
|
251
328
|
"resource": "pdfManipulation",
|
|
252
329
|
"operation": "splitPdf",
|
|
330
|
+
"split_input_type": "url",
|
|
253
331
|
"split_url": "https://example.com/document.pdf",
|
|
254
332
|
"split_mode": "pages",
|
|
255
333
|
"pages": "1-3",
|
|
@@ -262,6 +340,7 @@ Parse a PDF into structured JSON.
|
|
|
262
340
|
{
|
|
263
341
|
"resource": "pdfManipulation",
|
|
264
342
|
"operation": "compressPdf",
|
|
343
|
+
"compress_input_type": "url",
|
|
265
344
|
"compress_url": "https://example.com/document.pdf",
|
|
266
345
|
"compression": "high",
|
|
267
346
|
"compress_output": "file",
|
|
@@ -269,6 +348,44 @@ Parse a PDF into structured JSON.
|
|
|
269
348
|
}
|
|
270
349
|
```
|
|
271
350
|
|
|
351
|
+
#### Watermark PDF
|
|
352
|
+
```json
|
|
353
|
+
{
|
|
354
|
+
"resource": "pdfManipulation",
|
|
355
|
+
"operation": "watermarkPdf",
|
|
356
|
+
"watermark_input_type": "url",
|
|
357
|
+
"watermark_file_url": "https://example.com/document.pdf",
|
|
358
|
+
"watermark_output_format": "file",
|
|
359
|
+
"watermark_text": "CONFIDENTIAL",
|
|
360
|
+
"watermark_opacity": 0.15,
|
|
361
|
+
"watermark_angle": 30
|
|
362
|
+
}
|
|
363
|
+
```
|
|
364
|
+
|
|
365
|
+
#### Convert PDF to Image
|
|
366
|
+
```json
|
|
367
|
+
{
|
|
368
|
+
"resource": "pdfManipulation",
|
|
369
|
+
"operation": "convertPdfToImage",
|
|
370
|
+
"convert_pdf_image_input_type": "url",
|
|
371
|
+
"convert_pdf_image_url": "https://example.com/document.pdf",
|
|
372
|
+
"convert_pdf_image_pages": "1-3",
|
|
373
|
+
"convert_pdf_image_format": "png",
|
|
374
|
+
"convert_pdf_image_output": "url"
|
|
375
|
+
}
|
|
376
|
+
```
|
|
377
|
+
|
|
378
|
+
#### Convert Image to PDF
|
|
379
|
+
```json
|
|
380
|
+
{
|
|
381
|
+
"resource": "pdfManipulation",
|
|
382
|
+
"operation": "convertImageToPdf",
|
|
383
|
+
"convert_image_pdf_urls": "https://example.com/a.png, https://example.com/b.jpg",
|
|
384
|
+
"convert_image_pdf_output": "file",
|
|
385
|
+
"convert_image_pdf_filename": "combined-images.pdf"
|
|
386
|
+
}
|
|
387
|
+
```
|
|
388
|
+
|
|
272
389
|
### PDF Security Examples
|
|
273
390
|
|
|
274
391
|
#### Lock PDF
|
|
@@ -276,6 +393,7 @@ Parse a PDF into structured JSON.
|
|
|
276
393
|
{
|
|
277
394
|
"resource": "pdfSecurity",
|
|
278
395
|
"operation": "lockPdf",
|
|
396
|
+
"lock_input_type": "url",
|
|
279
397
|
"lock_url": "https://example.com/document.pdf",
|
|
280
398
|
"lock_password": "your-password",
|
|
281
399
|
"lock_output": "file",
|
|
@@ -288,6 +406,7 @@ Parse a PDF into structured JSON.
|
|
|
288
406
|
{
|
|
289
407
|
"resource": "pdfSecurity",
|
|
290
408
|
"operation": "unlockPdf",
|
|
409
|
+
"unlock_input_type": "url",
|
|
291
410
|
"unlock_url": "https://example.com/locked.pdf",
|
|
292
411
|
"unlock_password": "your-password",
|
|
293
412
|
"unlock_output": "file",
|
|
@@ -302,11 +421,26 @@ Parse a PDF into structured JSON.
|
|
|
302
421
|
{
|
|
303
422
|
"resource": "pdfParsing",
|
|
304
423
|
"operation": "parsePdf",
|
|
424
|
+
"parse_input_type": "url",
|
|
305
425
|
"parse_url": "https://example.com/document.pdf",
|
|
306
426
|
"parse_mode": "full",
|
|
307
427
|
"parse_pages": "all"
|
|
308
428
|
}
|
|
309
429
|
```
|
|
430
|
+
|
|
431
|
+
#### Parse PDF with OCR
|
|
432
|
+
```json
|
|
433
|
+
{
|
|
434
|
+
"resource": "pdfParsing",
|
|
435
|
+
"operation": "parsePdfOcr",
|
|
436
|
+
"parse_input_type": "url",
|
|
437
|
+
"parse_url": "https://example.com/scanned.pdf",
|
|
438
|
+
"lang": "eng",
|
|
439
|
+
"parse_pages": "all",
|
|
440
|
+
"dpi": 200,
|
|
441
|
+
"psm": 3,
|
|
442
|
+
"oem": 3
|
|
443
|
+
}
|
|
310
444
|
```
|
|
311
445
|
|
|
312
446
|
## Use Cases
|
|
@@ -185,7 +185,8 @@ class Htmlcsstopdf {
|
|
|
185
185
|
displayName: 'HTML Content',
|
|
186
186
|
name: 'html_content',
|
|
187
187
|
type: 'string',
|
|
188
|
-
default: '',
|
|
188
|
+
default: '<html>Hello HTML</html>',
|
|
189
|
+
placeholder: '<html>Hello HTML</html>',
|
|
189
190
|
description: 'HTML content to render in the document',
|
|
190
191
|
displayOptions: {
|
|
191
192
|
show: {
|
|
@@ -249,7 +250,8 @@ class Htmlcsstopdf {
|
|
|
249
250
|
displayName: 'URL',
|
|
250
251
|
name: 'url',
|
|
251
252
|
type: 'string',
|
|
252
|
-
default: '',
|
|
253
|
+
default: 'https://example.com',
|
|
254
|
+
placeholder: 'https://example.com',
|
|
253
255
|
description: 'The URL of the website to capture',
|
|
254
256
|
displayOptions: {
|
|
255
257
|
show: {
|
|
@@ -362,7 +364,8 @@ class Htmlcsstopdf {
|
|
|
362
364
|
displayName: 'PDF URLs',
|
|
363
365
|
name: 'pdf_urls',
|
|
364
366
|
type: 'string',
|
|
365
|
-
default: '',
|
|
367
|
+
default: 'https://pdfmunk.com/sample.pdf, https://pdfmunk.com/sample1.pdf',
|
|
368
|
+
placeholder: 'https://pdfmunk.com/sample.pdf, https://pdfmunk.com/sample1.pdf',
|
|
366
369
|
description: 'Comma-separated list of PDF URLs to merge (minimum 2, maximum 15)',
|
|
367
370
|
displayOptions: {
|
|
368
371
|
show: {
|
|
@@ -372,10 +375,11 @@ class Htmlcsstopdf {
|
|
|
372
375
|
},
|
|
373
376
|
},
|
|
374
377
|
{
|
|
375
|
-
displayName: 'File Binary
|
|
378
|
+
displayName: 'File Binary Property Name (CSV)',
|
|
376
379
|
name: 'merge_file_binary_properties',
|
|
377
380
|
type: 'string',
|
|
378
|
-
default: 'data',
|
|
381
|
+
default: 'data,data',
|
|
382
|
+
placeholder: 'data,data',
|
|
379
383
|
description: 'Comma-separated binary property names to merge (minimum 2), for example data1,data2',
|
|
380
384
|
displayOptions: {
|
|
381
385
|
show: {
|
|
@@ -421,7 +425,8 @@ class Htmlcsstopdf {
|
|
|
421
425
|
displayName: 'PDF URL',
|
|
422
426
|
name: 'split_url',
|
|
423
427
|
type: 'string',
|
|
424
|
-
default: '',
|
|
428
|
+
default: 'https://pdfmunk.com/sample1.pdf',
|
|
429
|
+
placeholder: 'https://pdfmunk.com/sample1.pdf',
|
|
425
430
|
description: 'URL of the PDF to split',
|
|
426
431
|
displayOptions: {
|
|
427
432
|
show: {
|
|
@@ -464,7 +469,8 @@ class Htmlcsstopdf {
|
|
|
464
469
|
displayName: 'Page Range',
|
|
465
470
|
name: 'pages',
|
|
466
471
|
type: 'string',
|
|
467
|
-
default: '1-
|
|
472
|
+
default: '1-3',
|
|
473
|
+
placeholder: '1-3',
|
|
468
474
|
description: 'Page range (e.g., "1-5", "1,3,5", "10-")',
|
|
469
475
|
displayOptions: {
|
|
470
476
|
show: {
|
|
@@ -612,7 +618,8 @@ class Htmlcsstopdf {
|
|
|
612
618
|
displayName: 'PDF URL',
|
|
613
619
|
name: 'watermark_file_url',
|
|
614
620
|
type: 'string',
|
|
615
|
-
default: '',
|
|
621
|
+
default: 'https://pdfmunk.com/sample.pdf',
|
|
622
|
+
placeholder: 'https://pdfmunk.com/sample.pdf',
|
|
616
623
|
description: 'Public URL of the PDF to watermark',
|
|
617
624
|
displayOptions: {
|
|
618
625
|
show: {
|
|
@@ -720,7 +727,8 @@ class Htmlcsstopdf {
|
|
|
720
727
|
displayName: 'PDF URL',
|
|
721
728
|
name: 'convert_pdf_image_url',
|
|
722
729
|
type: 'string',
|
|
723
|
-
default: '',
|
|
730
|
+
default: 'https://pdfmunk.com/sample.pdf',
|
|
731
|
+
placeholder: 'https://pdfmunk.com/sample.pdf',
|
|
724
732
|
description: 'Public URL of the PDF to convert',
|
|
725
733
|
displayOptions: {
|
|
726
734
|
show: {
|
|
@@ -758,7 +766,8 @@ class Htmlcsstopdf {
|
|
|
758
766
|
displayName: 'Pages',
|
|
759
767
|
name: 'convert_pdf_image_pages',
|
|
760
768
|
type: 'string',
|
|
761
|
-
default: '',
|
|
769
|
+
default: '1',
|
|
770
|
+
placeholder: '1',
|
|
762
771
|
description: 'Optional pages selection, for example 1-3 or 1,3,5',
|
|
763
772
|
displayOptions: {
|
|
764
773
|
show: {
|
|
@@ -1179,7 +1188,7 @@ class Htmlcsstopdf {
|
|
|
1179
1188
|
};
|
|
1180
1189
|
}
|
|
1181
1190
|
async execute() {
|
|
1182
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
|
|
1191
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
1183
1192
|
const items = this.getInputData();
|
|
1184
1193
|
const returnData = [];
|
|
1185
1194
|
const toJsonObject = (body) => {
|
|
@@ -1329,7 +1338,7 @@ class Htmlcsstopdf {
|
|
|
1329
1338
|
body.output_format = outputFormat;
|
|
1330
1339
|
}
|
|
1331
1340
|
if (outputFormat === 'file') {
|
|
1332
|
-
|
|
1341
|
+
let responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'htmlcsstopdfApi', {
|
|
1333
1342
|
method: 'POST',
|
|
1334
1343
|
url: 'https://pdfmunk.com/api/v1/generatePdf',
|
|
1335
1344
|
body,
|
|
@@ -1337,8 +1346,25 @@ class Htmlcsstopdf {
|
|
|
1337
1346
|
encoding: 'arraybuffer',
|
|
1338
1347
|
returnFullResponse: true,
|
|
1339
1348
|
timeout,
|
|
1340
|
-
});
|
|
1341
|
-
|
|
1349
|
+
}));
|
|
1350
|
+
let statusCode = (_b = responseData.statusCode) !== null && _b !== void 0 ? _b : 0;
|
|
1351
|
+
if (statusCode >= 400 && operation === 'urlToPdf') {
|
|
1352
|
+
const fallbackBody = {
|
|
1353
|
+
...body,
|
|
1354
|
+
output: 'file',
|
|
1355
|
+
};
|
|
1356
|
+
delete fallbackBody.output_format;
|
|
1357
|
+
responseData = (await this.helpers.httpRequestWithAuthentication.call(this, 'htmlcsstopdfApi', {
|
|
1358
|
+
method: 'POST',
|
|
1359
|
+
url: 'https://pdfmunk.com/api/v1/generatePdf',
|
|
1360
|
+
body: fallbackBody,
|
|
1361
|
+
json: true,
|
|
1362
|
+
encoding: 'arraybuffer',
|
|
1363
|
+
returnFullResponse: true,
|
|
1364
|
+
timeout,
|
|
1365
|
+
}));
|
|
1366
|
+
statusCode = (_c = responseData.statusCode) !== null && _c !== void 0 ? _c : 0;
|
|
1367
|
+
}
|
|
1342
1368
|
if (statusCode >= 400) {
|
|
1343
1369
|
const errorBody = parseArrayBufferBody(responseData.body);
|
|
1344
1370
|
returnData.push({
|
|
@@ -1358,7 +1384,7 @@ class Htmlcsstopdf {
|
|
|
1358
1384
|
returnFullResponse: true,
|
|
1359
1385
|
timeout,
|
|
1360
1386
|
});
|
|
1361
|
-
const statusCode = (
|
|
1387
|
+
const statusCode = (_d = responseData.statusCode) !== null && _d !== void 0 ? _d : 0;
|
|
1362
1388
|
const bodyData = toJsonObject(responseData.body);
|
|
1363
1389
|
returnData.push({
|
|
1364
1390
|
json: statusCode >= 400 ? { ...bodyData, statusCode } : bodyData,
|
|
@@ -1401,7 +1427,7 @@ class Htmlcsstopdf {
|
|
|
1401
1427
|
encoding: 'arraybuffer',
|
|
1402
1428
|
returnFullResponse: true,
|
|
1403
1429
|
});
|
|
1404
|
-
const statusCode = (
|
|
1430
|
+
const statusCode = (_e = responseData.statusCode) !== null && _e !== void 0 ? _e : 0;
|
|
1405
1431
|
if (statusCode >= 400) {
|
|
1406
1432
|
const errorBody = parseArrayBufferBody(responseData.body);
|
|
1407
1433
|
returnData.push({
|
|
@@ -1419,7 +1445,7 @@ class Htmlcsstopdf {
|
|
|
1419
1445
|
...requestOptions,
|
|
1420
1446
|
returnFullResponse: true,
|
|
1421
1447
|
});
|
|
1422
|
-
const statusCode = (
|
|
1448
|
+
const statusCode = (_f = responseData.statusCode) !== null && _f !== void 0 ? _f : 0;
|
|
1423
1449
|
const bodyData = toJsonObject(responseData.body);
|
|
1424
1450
|
returnData.push({
|
|
1425
1451
|
json: statusCode >= 400 ? { ...bodyData, statusCode } : bodyData,
|
|
@@ -1457,7 +1483,7 @@ class Htmlcsstopdf {
|
|
|
1457
1483
|
encoding: 'arraybuffer',
|
|
1458
1484
|
returnFullResponse: true,
|
|
1459
1485
|
});
|
|
1460
|
-
const statusCode = (
|
|
1486
|
+
const statusCode = (_g = responseData.statusCode) !== null && _g !== void 0 ? _g : 0;
|
|
1461
1487
|
if (statusCode >= 400) {
|
|
1462
1488
|
const errorBody = parseArrayBufferBody(responseData.body);
|
|
1463
1489
|
returnData.push({
|
|
@@ -1475,7 +1501,7 @@ class Htmlcsstopdf {
|
|
|
1475
1501
|
...requestOptions,
|
|
1476
1502
|
returnFullResponse: true,
|
|
1477
1503
|
});
|
|
1478
|
-
const statusCode = (
|
|
1504
|
+
const statusCode = (_h = responseData.statusCode) !== null && _h !== void 0 ? _h : 0;
|
|
1479
1505
|
const bodyData = toJsonObject(responseData.body);
|
|
1480
1506
|
returnData.push({
|
|
1481
1507
|
json: statusCode >= 400 ? { ...bodyData, statusCode } : bodyData,
|
|
@@ -1507,7 +1533,7 @@ class Htmlcsstopdf {
|
|
|
1507
1533
|
encoding: 'arraybuffer',
|
|
1508
1534
|
returnFullResponse: true,
|
|
1509
1535
|
});
|
|
1510
|
-
const statusCode = (
|
|
1536
|
+
const statusCode = (_j = responseData.statusCode) !== null && _j !== void 0 ? _j : 0;
|
|
1511
1537
|
if (statusCode >= 400) {
|
|
1512
1538
|
const errorBody = parseArrayBufferBody(responseData.body);
|
|
1513
1539
|
returnData.push({
|
|
@@ -1525,7 +1551,7 @@ class Htmlcsstopdf {
|
|
|
1525
1551
|
...requestOptions,
|
|
1526
1552
|
returnFullResponse: true,
|
|
1527
1553
|
});
|
|
1528
|
-
const statusCode = (
|
|
1554
|
+
const statusCode = (_k = responseData.statusCode) !== null && _k !== void 0 ? _k : 0;
|
|
1529
1555
|
const bodyData = toJsonObject(responseData.body);
|
|
1530
1556
|
returnData.push({
|
|
1531
1557
|
json: statusCode >= 400 ? { ...bodyData, statusCode } : bodyData,
|
|
@@ -1541,13 +1567,17 @@ class Htmlcsstopdf {
|
|
|
1541
1567
|
const angle = this.getNodeParameter('watermark_angle', i);
|
|
1542
1568
|
const fontSize = this.getNodeParameter('watermark_font_size', i);
|
|
1543
1569
|
const body = {
|
|
1570
|
+
output: outputFormat,
|
|
1544
1571
|
output_format: outputFormat,
|
|
1545
1572
|
text,
|
|
1573
|
+
watermark_text: text,
|
|
1546
1574
|
opacity,
|
|
1547
1575
|
angle,
|
|
1548
1576
|
};
|
|
1549
1577
|
if (watermarkInputType === 'url') {
|
|
1550
|
-
|
|
1578
|
+
const watermarkUrl = this.getNodeParameter('watermark_file_url', i);
|
|
1579
|
+
body.file_url = watermarkUrl;
|
|
1580
|
+
body.url = watermarkUrl;
|
|
1551
1581
|
}
|
|
1552
1582
|
if (fontSize > 0) {
|
|
1553
1583
|
body.font_size = fontSize;
|
|
@@ -1563,7 +1593,7 @@ class Htmlcsstopdf {
|
|
|
1563
1593
|
encoding: 'arraybuffer',
|
|
1564
1594
|
returnFullResponse: true,
|
|
1565
1595
|
});
|
|
1566
|
-
const statusCode = (
|
|
1596
|
+
const statusCode = (_l = responseData.statusCode) !== null && _l !== void 0 ? _l : 0;
|
|
1567
1597
|
if (statusCode >= 400) {
|
|
1568
1598
|
const errorBody = parseArrayBufferBody(responseData.body);
|
|
1569
1599
|
returnData.push({
|
|
@@ -1581,7 +1611,7 @@ class Htmlcsstopdf {
|
|
|
1581
1611
|
...requestOptions,
|
|
1582
1612
|
returnFullResponse: true,
|
|
1583
1613
|
});
|
|
1584
|
-
const statusCode = (
|
|
1614
|
+
const statusCode = (_m = responseData.statusCode) !== null && _m !== void 0 ? _m : 0;
|
|
1585
1615
|
const bodyData = toJsonObject(responseData.body);
|
|
1586
1616
|
returnData.push({
|
|
1587
1617
|
json: statusCode >= 400 ? { ...bodyData, statusCode } : bodyData,
|
|
@@ -1623,7 +1653,7 @@ class Htmlcsstopdf {
|
|
|
1623
1653
|
encoding: 'arraybuffer',
|
|
1624
1654
|
returnFullResponse: true,
|
|
1625
1655
|
});
|
|
1626
|
-
const statusCode = (
|
|
1656
|
+
const statusCode = (_o = responseData.statusCode) !== null && _o !== void 0 ? _o : 0;
|
|
1627
1657
|
if (statusCode >= 400) {
|
|
1628
1658
|
const errorBody = parseArrayBufferBody(responseData.body);
|
|
1629
1659
|
returnData.push({
|
|
@@ -1641,7 +1671,7 @@ class Htmlcsstopdf {
|
|
|
1641
1671
|
...requestOptions,
|
|
1642
1672
|
returnFullResponse: true,
|
|
1643
1673
|
});
|
|
1644
|
-
const statusCode = (
|
|
1674
|
+
const statusCode = (_p = responseData.statusCode) !== null && _p !== void 0 ? _p : 0;
|
|
1645
1675
|
const bodyData = toJsonObject(responseData.body);
|
|
1646
1676
|
returnData.push({
|
|
1647
1677
|
json: statusCode >= 400 ? { ...bodyData, statusCode } : bodyData,
|
|
@@ -1686,7 +1716,7 @@ class Htmlcsstopdf {
|
|
|
1686
1716
|
encoding: 'arraybuffer',
|
|
1687
1717
|
returnFullResponse: true,
|
|
1688
1718
|
});
|
|
1689
|
-
const statusCode = (
|
|
1719
|
+
const statusCode = (_q = responseData.statusCode) !== null && _q !== void 0 ? _q : 0;
|
|
1690
1720
|
if (statusCode >= 400) {
|
|
1691
1721
|
const errorBody = parseArrayBufferBody(responseData.body);
|
|
1692
1722
|
returnData.push({
|
|
@@ -1705,7 +1735,7 @@ class Htmlcsstopdf {
|
|
|
1705
1735
|
json: true,
|
|
1706
1736
|
returnFullResponse: true,
|
|
1707
1737
|
});
|
|
1708
|
-
const statusCode = (
|
|
1738
|
+
const statusCode = (_r = responseData.statusCode) !== null && _r !== void 0 ? _r : 0;
|
|
1709
1739
|
const bodyData = toJsonObject(responseData.body);
|
|
1710
1740
|
returnData.push({
|
|
1711
1741
|
json: statusCode >= 400 ? { ...bodyData, statusCode } : bodyData,
|
|
@@ -1743,7 +1773,7 @@ class Htmlcsstopdf {
|
|
|
1743
1773
|
encoding: 'arraybuffer',
|
|
1744
1774
|
returnFullResponse: true,
|
|
1745
1775
|
});
|
|
1746
|
-
const statusCode = (
|
|
1776
|
+
const statusCode = (_s = responseData.statusCode) !== null && _s !== void 0 ? _s : 0;
|
|
1747
1777
|
if (statusCode >= 400) {
|
|
1748
1778
|
const errorBody = parseArrayBufferBody(responseData.body);
|
|
1749
1779
|
returnData.push({
|
|
@@ -1761,7 +1791,7 @@ class Htmlcsstopdf {
|
|
|
1761
1791
|
...requestOptions,
|
|
1762
1792
|
returnFullResponse: true,
|
|
1763
1793
|
});
|
|
1764
|
-
const statusCode = (
|
|
1794
|
+
const statusCode = (_t = responseData.statusCode) !== null && _t !== void 0 ? _t : 0;
|
|
1765
1795
|
const bodyData = toJsonObject(responseData.body);
|
|
1766
1796
|
returnData.push({
|
|
1767
1797
|
json: statusCode >= 400 ? { ...bodyData, statusCode } : bodyData,
|
|
@@ -1793,7 +1823,7 @@ class Htmlcsstopdf {
|
|
|
1793
1823
|
encoding: 'arraybuffer',
|
|
1794
1824
|
returnFullResponse: true,
|
|
1795
1825
|
});
|
|
1796
|
-
const statusCode = (
|
|
1826
|
+
const statusCode = (_u = responseData.statusCode) !== null && _u !== void 0 ? _u : 0;
|
|
1797
1827
|
if (statusCode >= 400) {
|
|
1798
1828
|
const errorBody = parseArrayBufferBody(responseData.body);
|
|
1799
1829
|
returnData.push({
|
|
@@ -1811,7 +1841,7 @@ class Htmlcsstopdf {
|
|
|
1811
1841
|
...requestOptions,
|
|
1812
1842
|
returnFullResponse: true,
|
|
1813
1843
|
});
|
|
1814
|
-
const statusCode = (
|
|
1844
|
+
const statusCode = (_v = responseData.statusCode) !== null && _v !== void 0 ? _v : 0;
|
|
1815
1845
|
const bodyData = toJsonObject(responseData.body);
|
|
1816
1846
|
returnData.push({
|
|
1817
1847
|
json: statusCode >= 400 ? { ...bodyData, statusCode } : bodyData,
|
|
@@ -1841,7 +1871,7 @@ class Htmlcsstopdf {
|
|
|
1841
1871
|
...requestOptions,
|
|
1842
1872
|
returnFullResponse: true,
|
|
1843
1873
|
});
|
|
1844
|
-
const statusCode = (
|
|
1874
|
+
const statusCode = (_w = responseData.statusCode) !== null && _w !== void 0 ? _w : 0;
|
|
1845
1875
|
const bodyData = toJsonObject(responseData.body);
|
|
1846
1876
|
returnData.push({
|
|
1847
1877
|
json: statusCode >= 400 ? { ...bodyData, statusCode } : bodyData,
|
|
@@ -1874,7 +1904,7 @@ class Htmlcsstopdf {
|
|
|
1874
1904
|
...requestOptions,
|
|
1875
1905
|
returnFullResponse: true,
|
|
1876
1906
|
});
|
|
1877
|
-
const statusCode = (
|
|
1907
|
+
const statusCode = (_x = responseData.statusCode) !== null && _x !== void 0 ? _x : 0;
|
|
1878
1908
|
const bodyData = toJsonObject(responseData.body);
|
|
1879
1909
|
returnData.push({
|
|
1880
1910
|
json: statusCode >= 400 ? { ...bodyData, statusCode } : bodyData,
|