@custom-js/n8n-nodes-pdf-toolkit-v2 0.2.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 +139 -0
- package/credentials/CustomJsApi.credentials.ts +48 -0
- package/dist/credentials/CustomJsApi.credentials.js +45 -0
- package/dist/nodes/PdfToolkit/PdfToolkit.node.js +725 -0
- package/dist/nodes/PdfToolkit/customJs.svg +24 -0
- package/dist/nodes/PdfToolkit/modules/ApiHelper.js +28 -0
- package/dist/nodes/PdfToolkit/modules/Convert/HtmlToDocx.js +24 -0
- package/dist/nodes/PdfToolkit/modules/Convert/HtmlToPdf.js +24 -0
- package/dist/nodes/PdfToolkit/modules/Convert/JsonToToon.js +15 -0
- package/dist/nodes/PdfToolkit/modules/Convert/MarkdownToHtml.js +15 -0
- package/dist/nodes/PdfToolkit/modules/Convert/PdfToPng.js +38 -0
- package/dist/nodes/PdfToolkit/modules/Convert/PdfToText.js +29 -0
- package/dist/nodes/PdfToolkit/modules/Convert/ToonToJson.js +15 -0
- package/dist/nodes/PdfToolkit/modules/Convert/index.js +31 -0
- package/dist/nodes/PdfToolkit/modules/Data/JsonSelect.js +16 -0
- package/dist/nodes/PdfToolkit/modules/Data/Regex.js +19 -0
- package/dist/nodes/PdfToolkit/modules/Data/index.js +16 -0
- package/dist/nodes/PdfToolkit/modules/PDF/Compress.js +38 -0
- package/dist/nodes/PdfToolkit/modules/PDF/ExtractPages.js +39 -0
- package/dist/nodes/PdfToolkit/modules/PDF/FillForm.js +33 -0
- package/dist/nodes/PdfToolkit/modules/PDF/GenerateInvoice.js +36 -0
- package/dist/nodes/PdfToolkit/modules/PDF/GetFormFields.js +22 -0
- package/dist/nodes/PdfToolkit/modules/PDF/Merge.js +47 -0
- package/dist/nodes/PdfToolkit/modules/PDF/index.js +28 -0
- package/dist/nodes/PdfToolkit/modules/Web/Scrape.js +32 -0
- package/dist/nodes/PdfToolkit/modules/Web/Screenshot.js +24 -0
- package/dist/nodes/PdfToolkit/modules/Web/SslCheck.js +15 -0
- package/dist/nodes/PdfToolkit/modules/Web/index.js +19 -0
- package/package.json +49 -0
package/README.md
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+

|
|
2
|
+
|
|
3
|
+
# @custom-js/n8n-nodes-pdf-toolkit
|
|
4
|
+
|
|
5
|
+
This is an n8n community node. It lets interact with official API of [customJS API](https://www.customjs.space/)
|
|
6
|
+
|
|
7
|
+
This package contains nodes to help you generate PDF from HTML, merge multiple PDF files, take a screenshot of specific website using URL, convert PDF to PNG, convert PDF to Text and extract pages from PDF.
|
|
8
|
+
|
|
9
|
+
[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform.
|
|
10
|
+
|
|
11
|
+
- [Installation](#installation)
|
|
12
|
+
- [Credentials](#credentials)
|
|
13
|
+
- [Usage](#usage)
|
|
14
|
+
- [Resources](#resources)
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n community nodes documentation.
|
|
19
|
+
|
|
20
|
+
Use the package at [here](https://www.npmjs.com/package/@custom-js/n8n-nodes-pdf-toolkit).
|
|
21
|
+
|
|
22
|
+
## Credentials
|
|
23
|
+
|
|
24
|
+
Add your Api Key and store securely
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
|
|
29
|
+
### "HTML to PDF" node
|
|
30
|
+
|
|
31
|
+
- Add the HTML to PDF node to your workflow
|
|
32
|
+
- Configure your CustomJS API credentials
|
|
33
|
+
- Input your HTML content
|
|
34
|
+
- Execute the workflow to generate PDF
|
|
35
|
+
|
|
36
|
+
### "Merge PDFs" node
|
|
37
|
+
|
|
38
|
+
- Add the Merge PDFs node to your workflow
|
|
39
|
+
- Configure your CustomJS API credentials
|
|
40
|
+
- Input PDF files as an array with the same field name to merge.
|
|
41
|
+
- If total size of files exceeds 6MB, pass it as an array of URL seperated by comma.
|
|
42
|
+
- Execute the workflow to get merged PDF file.
|
|
43
|
+
|
|
44
|
+
### "Website Screenshot" node
|
|
45
|
+
|
|
46
|
+
- Add the Website Screenshot node to your workflow
|
|
47
|
+
- Configure your CustomJS API credentials
|
|
48
|
+
- Input your URL of website to take screenshot
|
|
49
|
+
- Execute the workflow to take a screenshot of that website
|
|
50
|
+
|
|
51
|
+
### "Compress PDF" node
|
|
52
|
+
|
|
53
|
+
- Add the Compress PDF node to your workflow
|
|
54
|
+
- Configure your CustomJS API credentials
|
|
55
|
+
- Input Binary PDF file for compression to compress
|
|
56
|
+
- If size of the binary file exceeds 6MB, pass it as URL.
|
|
57
|
+
- Execute the workflow to get a compression of PDF file.
|
|
58
|
+
|
|
59
|
+
### "PDF To PNG" node
|
|
60
|
+
|
|
61
|
+
- Add the PDF To PNG node to your workflow
|
|
62
|
+
- Configure your CustomJS API credentials
|
|
63
|
+
- Input Binary PDF file for conversion
|
|
64
|
+
- If size of the binary file exceeds 6MB, pass it as URL.
|
|
65
|
+
- Execute the workflow to get converted PNG file.
|
|
66
|
+
|
|
67
|
+
### "PDF To Text" node
|
|
68
|
+
|
|
69
|
+
- Add the PDF To Text node to your workflow
|
|
70
|
+
- Configure your CustomJS API credentials
|
|
71
|
+
- Input Binary PDF file for conversion
|
|
72
|
+
- If size of the binary file exceeds 6MB, pass it as URL.
|
|
73
|
+
- Execute the workflow to get converted Text file.
|
|
74
|
+
|
|
75
|
+
### "Extract Pages From PDF" node
|
|
76
|
+
|
|
77
|
+
- Add the Extract Pages From PDF node to your workflow
|
|
78
|
+
- Configure your CustomJS API credentials
|
|
79
|
+
- Input Binary PDF file for conversion
|
|
80
|
+
- If size of the binary file exceeds 6MB, pass it as URL.
|
|
81
|
+
- Execute the workflow to get converted Pages from PDF file.
|
|
82
|
+
|
|
83
|
+
### "SSL Checker" node
|
|
84
|
+
|
|
85
|
+
- Add the **SSL Checker** node to your workflow.
|
|
86
|
+
- Configure your CustomJS API credentials.
|
|
87
|
+
- Input the domain you want to check (e.g., `example.com`).
|
|
88
|
+
- Execute the workflow to get information about the SSL certificate, including the expiration date.
|
|
89
|
+
|
|
90
|
+
### "Scraper" node
|
|
91
|
+
|
|
92
|
+
- Add the **Scraper** node to your workflow.
|
|
93
|
+
- Configure your CustomJS API credentials.
|
|
94
|
+
- Input the website URL you want to scrape (must start with `https://`).
|
|
95
|
+
- Optionally, define user actions (click, type, wait) to interact with page elements using selectors.
|
|
96
|
+
- Choose the return type:
|
|
97
|
+
- **Raw HTML**: Get the HTML content of the page.
|
|
98
|
+
- **Screenshot (PNG)**: Get a screenshot of the page.
|
|
99
|
+
- Enable or disable debug mode to control error handling for missing elements.
|
|
100
|
+
- Execute the workflow to scrape the website and receive the desired output.
|
|
101
|
+
|
|
102
|
+
### "Markdown to HTML" node
|
|
103
|
+
|
|
104
|
+
- Add the **Markdown to HTML** node to your workflow.
|
|
105
|
+
- Configure your CustomJS API credentials.
|
|
106
|
+
- Input the Markdown content you want to convert to HTML.
|
|
107
|
+
- Execute the workflow to get the converted HTML content.
|
|
108
|
+
|
|
109
|
+
### "HTML to Docx (Word)" node
|
|
110
|
+
|
|
111
|
+
- Add the **HTML to Docx (Word)** node to your workflow.
|
|
112
|
+
- Configure your CustomJS API credentials.
|
|
113
|
+
- Input the HTML content you want to convert to Docx (Word).
|
|
114
|
+
- Execute the workflow to get the converted Docx (Word) file.
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
### "PDF Form Fill" node
|
|
118
|
+
|
|
119
|
+
- Add the **PDF Form Fill** node to your workflow.
|
|
120
|
+
- Configure your CustomJS API credentials.
|
|
121
|
+
- Input the PDF file you want to fill out.
|
|
122
|
+
- Define the form fields and their values.
|
|
123
|
+
- Execute the workflow to get the filled-out PDF file.
|
|
124
|
+
|
|
125
|
+
### "Get PDF Form Field Names" node
|
|
126
|
+
|
|
127
|
+
- Add the **Get PDF Form Field Names** node to your workflow.
|
|
128
|
+
- Configure your CustomJS API credentials.
|
|
129
|
+
- Input the PDF file you want to get form field names from.
|
|
130
|
+
- Execute the workflow to get the form field names.
|
|
131
|
+
|
|
132
|
+
### "Invoice Generator" node
|
|
133
|
+
|
|
134
|
+
- Add the **Invoice Generator** node to your workflow.
|
|
135
|
+
- Configure your CustomJS API credentials.
|
|
136
|
+
- Select a PDF template.
|
|
137
|
+
- Fill in the issuer, payment, recipient, and billing information.
|
|
138
|
+
- Add items to the invoice.
|
|
139
|
+
- Execute the workflow to generate the PDF invoice.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import {
|
|
2
|
+
IAuthenticateGeneric,
|
|
3
|
+
ICredentialTestRequest,
|
|
4
|
+
ICredentialType,
|
|
5
|
+
INodeProperties,
|
|
6
|
+
} from "n8n-workflow";
|
|
7
|
+
|
|
8
|
+
export class CustomJsApi implements ICredentialType {
|
|
9
|
+
name = "customJsApi";
|
|
10
|
+
displayName = "CustomJS API";
|
|
11
|
+
documentationUrl = "https://www.customjs.space/";
|
|
12
|
+
properties: INodeProperties[] = [
|
|
13
|
+
{
|
|
14
|
+
displayName: "API Key",
|
|
15
|
+
name: "apiKey",
|
|
16
|
+
type: "string",
|
|
17
|
+
typeOptions: { password: true },
|
|
18
|
+
default: "",
|
|
19
|
+
description: "You can get API Key for CustomJS from https://www.customjs.space/",
|
|
20
|
+
required: true,
|
|
21
|
+
},
|
|
22
|
+
];
|
|
23
|
+
|
|
24
|
+
authenticate: IAuthenticateGeneric = {
|
|
25
|
+
type: "generic",
|
|
26
|
+
properties: {
|
|
27
|
+
headers: {
|
|
28
|
+
"x-api-key": "={{$credentials.apiKey}}",
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
test: ICredentialTestRequest = {
|
|
34
|
+
request: {
|
|
35
|
+
baseURL: "https://e.customjs.io",
|
|
36
|
+
url: "=/__js1-{{$credentials.apiKey}}",
|
|
37
|
+
method: "POST",
|
|
38
|
+
headers: {
|
|
39
|
+
"customjs-origin": "n8n/credential-test",
|
|
40
|
+
},
|
|
41
|
+
body: {
|
|
42
|
+
input: "test",
|
|
43
|
+
code: "return 'ok'",
|
|
44
|
+
returnBinary: "false",
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CustomJsApi = void 0;
|
|
4
|
+
class CustomJsApi {
|
|
5
|
+
constructor() {
|
|
6
|
+
this.name = "customJsApi";
|
|
7
|
+
this.displayName = "CustomJS API";
|
|
8
|
+
this.documentationUrl = "https://www.customjs.space/";
|
|
9
|
+
this.properties = [
|
|
10
|
+
{
|
|
11
|
+
displayName: "API Key",
|
|
12
|
+
name: "apiKey",
|
|
13
|
+
type: "string",
|
|
14
|
+
typeOptions: { password: true },
|
|
15
|
+
default: "",
|
|
16
|
+
description: "You can get API Key for CustomJS from https://www.customjs.space/",
|
|
17
|
+
required: true,
|
|
18
|
+
},
|
|
19
|
+
];
|
|
20
|
+
this.authenticate = {
|
|
21
|
+
type: "generic",
|
|
22
|
+
properties: {
|
|
23
|
+
headers: {
|
|
24
|
+
"x-api-key": "={{$credentials.apiKey}}",
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
this.test = {
|
|
29
|
+
request: {
|
|
30
|
+
baseURL: "https://e.customjs.io",
|
|
31
|
+
url: "=/__js1-{{$credentials.apiKey}}",
|
|
32
|
+
method: "POST",
|
|
33
|
+
headers: {
|
|
34
|
+
"customjs-origin": "n8n/credential-test",
|
|
35
|
+
},
|
|
36
|
+
body: {
|
|
37
|
+
input: "test",
|
|
38
|
+
code: "return 'ok'",
|
|
39
|
+
returnBinary: "false",
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.CustomJsApi = CustomJsApi;
|