@custom-js/n8n-nodes-pdf-toolkit 1.38.0 → 1.39.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/dist/nodes/CompressPDF/CompressPDF.node.js +3 -3
- package/dist/nodes/ExtractPages/ExtractPages.node.js +3 -3
- package/dist/nodes/Html2Docx/Html2Docx.node.js +3 -3
- package/dist/nodes/Html2Pdf/Html2Pdf.node.js +3 -3
- package/dist/nodes/InvoiceGenerator/InvoiceGenerator.node.js +3 -4
- package/dist/nodes/MergePdfs/MergePdfs.node.js +3 -3
- package/dist/nodes/PdfFormFill/PdfFormFill.node.js +3 -3
- package/dist/nodes/PdfToPng/PdfToPng.node.js +3 -3
- package/dist/nodes/Scraper/Scraper.node.js +3 -3
- package/dist/nodes/WebsiteScreenshot/WebsiteScreenshot.node.js +3 -3
- package/package.json +1 -1
|
@@ -76,16 +76,16 @@ class CompressPDF {
|
|
|
76
76
|
headers: {
|
|
77
77
|
"customjs-origin": "n8n/compressPdf",
|
|
78
78
|
"x-api-key": credentials.apiKey,
|
|
79
|
+
"Content-Type": "application/json",
|
|
79
80
|
},
|
|
80
|
-
body: {
|
|
81
|
+
body: JSON.stringify({
|
|
81
82
|
input: isBinary ? { file: file } : { urls: field_name },
|
|
82
83
|
code: `
|
|
83
84
|
const { PDF_COMPRESS } = require('./utils');
|
|
84
85
|
input = input.file || input.urls;
|
|
85
86
|
return PDF_COMPRESS(input);`,
|
|
86
87
|
returnBinary: "true",
|
|
87
|
-
},
|
|
88
|
-
json: true,
|
|
88
|
+
}),
|
|
89
89
|
returnFullResponse: true,
|
|
90
90
|
responseType: 'arraybuffer',
|
|
91
91
|
};
|
|
@@ -84,8 +84,9 @@ class ExtractPages {
|
|
|
84
84
|
headers: {
|
|
85
85
|
"customjs-origin": "n8n/extractPages",
|
|
86
86
|
"x-api-key": credentials.apiKey,
|
|
87
|
+
"Content-Type": "application/json",
|
|
87
88
|
},
|
|
88
|
-
body: {
|
|
89
|
+
body: JSON.stringify({
|
|
89
90
|
input: isBinary
|
|
90
91
|
? { file: file, pageRange }
|
|
91
92
|
: { urls: field_name, pageRange },
|
|
@@ -94,8 +95,7 @@ class ExtractPages {
|
|
|
94
95
|
const pdfBuffer = input.file ? Buffer.from(input.file, 'base64') : input.urls;
|
|
95
96
|
return EXTRACT_PAGES_FROM_PDF(pdfBuffer, input.pageRange);`,
|
|
96
97
|
returnBinary: "true",
|
|
97
|
-
},
|
|
98
|
-
json: true,
|
|
98
|
+
}),
|
|
99
99
|
returnFullResponse: true,
|
|
100
100
|
responseType: 'arraybuffer',
|
|
101
101
|
};
|
|
@@ -48,13 +48,13 @@ class Html2Docx {
|
|
|
48
48
|
headers: {
|
|
49
49
|
"customjs-origin": "n8n/html2Docx",
|
|
50
50
|
"x-api-key": credentials.apiKey,
|
|
51
|
+
"Content-Type": "application/json",
|
|
51
52
|
},
|
|
52
|
-
body: {
|
|
53
|
+
body: JSON.stringify({
|
|
53
54
|
input: htmlInput,
|
|
54
55
|
code: "const { HTML2DOCX } = require('./utils'); return HTML2DOCX(input)",
|
|
55
56
|
returnBinary: "true",
|
|
56
|
-
},
|
|
57
|
-
json: true,
|
|
57
|
+
}),
|
|
58
58
|
returnFullResponse: true,
|
|
59
59
|
responseType: 'arraybuffer',
|
|
60
60
|
};
|
|
@@ -48,13 +48,13 @@ class Html2Pdf {
|
|
|
48
48
|
headers: {
|
|
49
49
|
"customjs-origin": "n8n/generatePDF",
|
|
50
50
|
"x-api-key": credentials.apiKey,
|
|
51
|
+
"Content-Type": "application/json",
|
|
51
52
|
},
|
|
52
|
-
body: {
|
|
53
|
+
body: JSON.stringify({
|
|
53
54
|
input: htmlInput,
|
|
54
55
|
code: "const { HTML2PDF } = require('./utils'); return HTML2PDF(input)",
|
|
55
56
|
returnBinary: "true",
|
|
56
|
-
},
|
|
57
|
-
json: true,
|
|
57
|
+
}),
|
|
58
58
|
returnFullResponse: true,
|
|
59
59
|
responseType: 'arraybuffer',
|
|
60
60
|
};
|
|
@@ -254,20 +254,19 @@ class InvoiceGenerator {
|
|
|
254
254
|
headers: {
|
|
255
255
|
'customjs-origin': 'n8n/invoice-generator',
|
|
256
256
|
'x-api-key': credentials.apiKey,
|
|
257
|
+
'Content-Type': 'application/json',
|
|
257
258
|
},
|
|
258
|
-
body: {
|
|
259
|
+
body: JSON.stringify({
|
|
259
260
|
input: invoiceData,
|
|
260
261
|
code: code,
|
|
261
262
|
returnBinary: 'true',
|
|
262
|
-
},
|
|
263
|
-
json: true,
|
|
263
|
+
}),
|
|
264
264
|
returnFullResponse: true,
|
|
265
265
|
responseType: 'arraybuffer',
|
|
266
266
|
};
|
|
267
267
|
const responseData = await this.helpers.httpRequest(options);
|
|
268
268
|
const response = responseData.body;
|
|
269
269
|
if (!response || (Buffer.isBuffer(response) && response.length === 0)) {
|
|
270
|
-
// No binary data returned; emit only JSON without a binary property
|
|
271
270
|
returnData.push({
|
|
272
271
|
json: items[i].json,
|
|
273
272
|
});
|
|
@@ -68,16 +68,16 @@ class MergePdfs {
|
|
|
68
68
|
headers: {
|
|
69
69
|
"customjs-origin": "n8n/mergePDFs",
|
|
70
70
|
"x-api-key": credentials.apiKey,
|
|
71
|
+
"Content-Type": "application/json",
|
|
71
72
|
},
|
|
72
|
-
body: {
|
|
73
|
+
body: JSON.stringify({
|
|
73
74
|
input: isBinary ? { files } : { urls },
|
|
74
75
|
code: `
|
|
75
76
|
const { PDF_MERGE } = require('./utils');
|
|
76
77
|
input = [...input.files || [],...input.urls || []].filter(i => i);
|
|
77
78
|
return PDF_MERGE(input);`,
|
|
78
79
|
returnBinary: "true",
|
|
79
|
-
},
|
|
80
|
-
json: true,
|
|
80
|
+
}),
|
|
81
81
|
returnFullResponse: true,
|
|
82
82
|
responseType: 'arraybuffer',
|
|
83
83
|
};
|
|
@@ -103,8 +103,9 @@ class PdfFormFill {
|
|
|
103
103
|
headers: {
|
|
104
104
|
"customjs-origin": "n8n/pdfFormFill",
|
|
105
105
|
"x-api-key": credentials.apiKey,
|
|
106
|
+
"Content-Type": "application/json",
|
|
106
107
|
},
|
|
107
|
-
body: {
|
|
108
|
+
body: JSON.stringify({
|
|
108
109
|
input: {
|
|
109
110
|
file: file,
|
|
110
111
|
// n8n fixedCollection with multipleValues returns an object like { field: [{ name, value }, ...] }
|
|
@@ -116,8 +117,7 @@ class PdfFormFill {
|
|
|
116
117
|
const fieldValues = Object.fromEntries((input.fields || []).map(x => [x.name, x.value]));
|
|
117
118
|
return PDF_FILL_FORM(pdfInput, fieldValues);`,
|
|
118
119
|
returnBinary: "true",
|
|
119
|
-
},
|
|
120
|
-
json: true,
|
|
120
|
+
}),
|
|
121
121
|
returnFullResponse: true,
|
|
122
122
|
responseType: 'arraybuffer',
|
|
123
123
|
};
|
|
@@ -76,16 +76,16 @@ class PdfToPng {
|
|
|
76
76
|
headers: {
|
|
77
77
|
"customjs-origin": "n8n/pdfToPng",
|
|
78
78
|
"x-api-key": credentials.apiKey,
|
|
79
|
+
"Content-Type": "application/json",
|
|
79
80
|
},
|
|
80
|
-
body: {
|
|
81
|
+
body: JSON.stringify({
|
|
81
82
|
input: isBinary ? { file: file } : { urls: field_name },
|
|
82
83
|
code: `
|
|
83
84
|
const { PDF2PNG } = require('./utils');
|
|
84
85
|
input = input.file || input.urls;
|
|
85
86
|
return PDF2PNG(input);`,
|
|
86
87
|
returnBinary: "true",
|
|
87
|
-
},
|
|
88
|
-
json: true,
|
|
88
|
+
}),
|
|
89
89
|
returnFullResponse: true,
|
|
90
90
|
responseType: 'arraybuffer',
|
|
91
91
|
};
|
|
@@ -137,15 +137,15 @@ class Scraper {
|
|
|
137
137
|
headers: {
|
|
138
138
|
"customjs-origin": "n8n/scraper",
|
|
139
139
|
"x-api-key": credentials.apiKey,
|
|
140
|
+
"Content-Type": "application/json",
|
|
140
141
|
},
|
|
141
|
-
body: {
|
|
142
|
+
body: JSON.stringify({
|
|
142
143
|
input: JSON.stringify(payload),
|
|
143
144
|
code: `const { SCRAPER } = require('./utils'); ` +
|
|
144
145
|
`const payload = input; ` +
|
|
145
146
|
`return SCRAPER(payload.url, payload.commands || [], "${returnValueType === "binary" ? "image" : "html"}", ${debug ? "true" : "false"});`,
|
|
146
147
|
returnBinary: returnValueType === "binary" ? "true" : "false",
|
|
147
|
-
},
|
|
148
|
-
json: true,
|
|
148
|
+
}),
|
|
149
149
|
returnFullResponse: returnValueType === "binary",
|
|
150
150
|
responseType: returnValueType === "binary" ? 'arraybuffer' : undefined,
|
|
151
151
|
};
|
|
@@ -45,13 +45,13 @@ class WebsiteScreenshot {
|
|
|
45
45
|
headers: {
|
|
46
46
|
"customjs-origin": "n8n/screenshot",
|
|
47
47
|
"x-api-key": credentials.apiKey,
|
|
48
|
+
"Content-Type": "application/json",
|
|
48
49
|
},
|
|
49
|
-
body: {
|
|
50
|
+
body: JSON.stringify({
|
|
50
51
|
input: urlInput,
|
|
51
52
|
code: "const { SCREENSHOT } = require('./utils'); return SCREENSHOT(input);",
|
|
52
53
|
returnBinary: "true",
|
|
53
|
-
},
|
|
54
|
-
json: true,
|
|
54
|
+
}),
|
|
55
55
|
returnFullResponse: true,
|
|
56
56
|
responseType: 'arraybuffer',
|
|
57
57
|
};
|