n8n-nodes-pdfops 0.3.1 → 0.5.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 +44 -25
- package/dist/nodes/Pdfops/Pdfops.node.js +1073 -118
- package/dist/nodes/Pdfops/Pdfops.node.js.map +1 -1
- package/dist/nodes/Pdfops/Pdfops.node.json +25 -1
- package/dist/package.json +3 -3
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
# n8n-nodes-pdfops
|
|
2
2
|
|
|
3
3
|
n8n community node for the [PDFops](https://pdfops.dev) API: fill PDF forms,
|
|
4
|
-
merge, split, rotate, watermark, number, protect and unlock PDFs,
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
merge, split, rotate, watermark, number, protect and unlock PDFs, add form
|
|
5
|
+
fields, stamp text, images and barcodes, extract and find text, attach files,
|
|
6
|
+
convert HTML, text and images to PDF, read and set metadata, and generate
|
|
7
|
+
invoice PDFs (including Factur-X e-invoices). The processing runs on the hosted
|
|
8
|
+
API, so there is no native dependency to install.
|
|
7
9
|
|
|
8
10
|
**Works without an API key** (100 requests per IP per month). A free API key
|
|
9
11
|
(250 requests/month, no card) raises the quota and unlocks usage introspection:
|
|
@@ -19,32 +21,49 @@ from **Settings → Community Nodes → Install** → `n8n-nodes-pdfops`.
|
|
|
19
21
|
|
|
20
22
|
## Operations
|
|
21
23
|
|
|
24
|
+
Operations are grouped by resource: **Form** (Add Fields, Fill, Inspect Fields), **Document**
|
|
25
|
+
(Delete Pages, Extract Pages, Merge, Rotate Pages, Split PDF), **Stamp** (Add Page Numbers, Add
|
|
26
|
+
Watermark, Edit), **Text** (Extract, Find), **Attachment** (Attach), **Convert** (HTML to PDF,
|
|
27
|
+
Images to PDF, Text to PDF), **Security** (Protect, Unlock), **Metadata** (Get, Set), **Invoice**
|
|
28
|
+
(Generate) and **Account** (Get Usage). Workflows built on 0.2.x keep their original five
|
|
29
|
+
operations.
|
|
30
|
+
|
|
22
31
|
Every PDF operation reads the input PDF from a binary field (default `data`).
|
|
23
32
|
Operations that return a PDF write it to an output binary field (default `data`)
|
|
24
|
-
and set `fileName` on the item JSON.
|
|
33
|
+
and set `fileName` on the item JSON. The Convert operations other than Images to PDF take text
|
|
34
|
+
instead of a binary input.
|
|
25
35
|
|
|
26
|
-
| Operation | What it does | Key parameters |
|
|
36
|
+
| Resource → Operation | What it does | Key parameters |
|
|
27
37
|
| --- | --- | --- |
|
|
28
|
-
| **Inspect Fields** | Lists a PDF's AcroForm fields (names, types, options, current values, optional `label`) plus a paste-ready fill template. Use it first on unfamiliar PDFs. | Input Binary Field, Input PDF Password |
|
|
29
|
-
| **Fill
|
|
30
|
-
| **Merge** | Merges the PDFs from **all incoming items** (in item order) into one PDF. The Input PDF Password applies to every input. | Input Binary Field, Input PDF Password |
|
|
31
|
-
| **Generate
|
|
32
|
-
| **Extract Pages** | Keeps only the listed pages, in the order given (also reorders or duplicates pages). | Pages, e.g. `1-3,5,8-` |
|
|
33
|
-
| **Delete Pages** | Removes the listed pages; the rest stay in order. Deleting every page is an error. | Pages to Delete, e.g. `2,4-6,9-` |
|
|
34
|
-
| **Rotate Pages** | Rotates all or selected pages. | Degrees (90, 180, 270, -90), Pages (empty = all) |
|
|
35
|
-
| **Split PDF** | Splits a PDF into parts. Emits **one item per part**, each with its own PDF binary and JSON `{ pages, page_count, part }`. | Split By: Page Ranges (`1-2,3-5`) or Chunk Size (pages per part); Output File Name is the part-name prefix |
|
|
36
|
-
| **Add Watermark** | Stamps text over the pages. | Watermark Text; options: Opacity (0.05-1, default 0.15), Size, Color, Rotation (default 45), Position (center/top/bottom); Pages |
|
|
37
|
-
| **Add Page Numbers** | Stamps page numbers. | Options: Format (default `{n} / {total}`), Position (six corners/edges), Size, Start Number, Margin; Pages |
|
|
38
|
-
| **Unlock
|
|
39
|
-
| **Protect
|
|
40
|
-
| **Get
|
|
41
|
-
| **Set
|
|
42
|
-
| **Get Usage** | Returns tier, quota, used, remaining and reset date for your API key (needs a credential). | - |
|
|
38
|
+
| **Form → Inspect Fields** | Lists a PDF's AcroForm fields (names, types, options, current values, optional `label`) plus a paste-ready fill template. Use it first on unfamiliar PDFs. | Input Binary Field, Input PDF Password |
|
|
39
|
+
| **Form → Fill** | Fills AcroForm fields and outputs the filled PDF. Field names are matched forgivingly; when a key was not an exact match, the item JSON carries `field_map` (`{ "what you sent": "field it resolved to" }`). | Fields (JSON object), Flatten, Input PDF Password |
|
|
40
|
+
| **Document → Merge** | Merges the PDFs from **all incoming items** (in item order) into one PDF. The Input PDF Password applies to every input. | Input Binary Field, Input PDF Password |
|
|
41
|
+
| **Invoice → Generate** | Turns structured JSON (from, to, items, tax, currency…) into a US-Letter invoice PDF, no template needed. With **Factur-X E-Invoice** on it produces a PDF/A-3 with the invoice data embedded as `factur-x.xml` (EN 16931 profile). That mode needs invoice_number, date, currency, due or payment_terms, `from`/`to` country, the seller's vat_id, and a unit code on every item; put street, postcode, city and vat_id in the party objects of the Invoice JSON. Tested with the Mustang validator; not a statement of legal compliance, and XRechnung and Peppol output are not produced. | Invoice (JSON), Factur-X E-Invoice, E-Invoice Options (IBAN, Payment Terms, Tax Category, Tax Exemption Reason) |
|
|
42
|
+
| **Document → Extract Pages** | Keeps only the listed pages, in the order given (also reorders or duplicates pages). | Pages, e.g. `1-3,5,8-` |
|
|
43
|
+
| **Document → Delete Pages** | Removes the listed pages; the rest stay in order. Deleting every page is an error. | Pages to Delete, e.g. `2,4-6,9-` |
|
|
44
|
+
| **Document → Rotate Pages** | Rotates all or selected pages. | Degrees (90, 180, 270, -90), Pages (empty = all) |
|
|
45
|
+
| **Document → Split PDF** | Splits a PDF into parts. Emits **one item per part**, each with its own PDF binary and JSON `{ pages, page_count, part }`. | Split By: Page Ranges (`1-2,3-5`) or Chunk Size (pages per part); Output File Name is the part-name prefix |
|
|
46
|
+
| **Stamp → Add Watermark** | Stamps text over the pages. | Watermark Text; options: Opacity (0.05-1, default 0.15), Size, Color, Rotation (default 45), Position (center/top/bottom); Pages |
|
|
47
|
+
| **Stamp → Add Page Numbers** | Stamps page numbers. | Options: Format (default `{n} / {total}`), Position (six corners/edges), Size, Start Number, Margin; Pages |
|
|
48
|
+
| **Security → Unlock** | Saves a PDF without encryption and without print/copy/modify restrictions. It does not crack passwords: it opens files you can already open (give the Input PDF Password if opening needs one). `note` is set on the item when the input was not encrypted. | Input PDF Password |
|
|
49
|
+
| **Security → Protect** | Encrypts a PDF with an open password and/or an owner password, optionally limiting what viewers may do. Output is not byte-stable between calls (encryption is salted). | Open Password, Owner Password (at least one), Allowed Permissions (print, copy, modify, annotate, fill forms) |
|
|
50
|
+
| **Metadata → Get** | Returns JSON: page count, page sizes and rotation, title, author, subject, keywords, creator, producer, dates, `encrypted`, `has_form`, `form_field_count`. | Input PDF Password |
|
|
51
|
+
| **Metadata → Set** | Sets title, author, subject, keywords or creator and outputs the updated PDF. | Metadata fields (at least one) |
|
|
52
|
+
| **Account → Get Usage** | Returns tier, quota, used, remaining and reset date for your API key (needs a credential). | - |
|
|
53
|
+
| **Form → Add Fields** | Creates fillable AcroForm fields (text, multiline, checkbox, radio group, dropdown, signature box) at exact positions. The signature type is an empty field for a signing tool; nothing is signed. | Fields to Add (JSON array: type, name, page, x, y, width, height, options...), Input PDF Password |
|
|
54
|
+
| **Stamp → Edit** | Draws text, images (a logo, a signature picture), QR codes and barcodes at exact positions. x and y are PDF points from the bottom-left of the page as displayed. | Items (JSON array), Image Files (binary field plus the name Items refer to), Input PDF Password |
|
|
55
|
+
| **Text → Extract** | Reads the text layer of a born-digital PDF (no OCR; scanned pages are listed in `pagesWithoutText`). JSON with per-page text, positioned lines and tables; Plain Text returns `{ text, truncated }`; Tables As Excel Workbook returns an `.xlsx` as binary data with its own mime type (one sheet per table) and fails with `no_tables` when the pages hold none. | Result Format (JSON, Plain Text), Tables As (JSON Rows, CSV, Excel Workbook), Pages, Output Binary Field and Output File Name (workbook) |
|
|
56
|
+
| **Text → Find** | Searches the text layer for a word, phrase or regex and returns each hit with its page and box in the same coordinates Stamp → Edit uses. When `truncated` is true and `nextPage` is set, run again with Pages set to `<nextPage>-`. | Query; options: Case Sensitive, Max Hits (default 100), Regex, Whole Word; Pages |
|
|
57
|
+
| **Attachment → Attach** | Embeds files (for example an XML invoice) in a PDF with a name, MIME type, description and PDF/A-3 relationship. Up to 10 files, 3 MB combined. `attachment_keys` is set on the item. | Files to Attach (binary field, Name, MIME Type, Description, Relationship), Input PDF Password |
|
|
58
|
+
| **Convert → HTML to PDF** | Renders an HTML string with a headless browser (CSS, images and web fonts as in a browser print). HTML text only, no URL input, JavaScript off. Each call counts as 5 requests against your quota. | HTML; options: Page Size, Landscape, Margin, Print Background, Scale |
|
|
59
|
+
| **Convert → Images to PDF** | Turns the JPG or PNG images from **all incoming items** (in item order) into one PDF, one image per page. | Input Binary Field; options: Page Size (Fit to Image, A4, Letter), Orientation, Margin |
|
|
60
|
+
| **Convert → Text to PDF** | Turns Markdown, plain text or CSV into a PDF with built-in fonts, no template. Latin (WinAnsi) characters only. | Content; options: Format, Page Size, Margin, Font Size, Title, Page Numbers, Monospace |
|
|
43
61
|
|
|
44
62
|
Page specs are 1-based: comma-separated pages and ranges, `8-` meaning page 8
|
|
45
|
-
to the end. All operations
|
|
46
|
-
|
|
47
|
-
|
|
63
|
+
to the end. All operations that read a PDF accept an **Input PDF Password** for inputs that need one to open.
|
|
64
|
+
Output is deterministic (the same input gives a byte-identical PDF) for every PDF-producing
|
|
65
|
+
operation except Security → Protect (salted encryption) and Convert → HTML to PDF (rendered by a
|
|
66
|
+
browser, so two renders can differ in bytes). Extract Text and Find Text only read.
|
|
48
67
|
|
|
49
68
|
Errors carry the API's own message (for example which AcroForm field name was
|
|
50
69
|
wrong). With **Continue on Fail** a failing item becomes `{ error, message }`
|
|
@@ -53,13 +72,13 @@ and the other items still complete.
|
|
|
53
72
|
## Credentials
|
|
54
73
|
|
|
55
74
|
Create a **PDFops API** credential with your API key (sent as `X-API-Key`).
|
|
56
|
-
It is optional for every operation except **Get Usage**; without it, requests
|
|
75
|
+
It is optional for every operation except **Account → Get Usage**; without it, requests
|
|
57
76
|
count against the anonymous per-IP quota (100/month).
|
|
58
77
|
|
|
59
78
|
## Example: invoice on every Stripe payment
|
|
60
79
|
|
|
61
80
|
1. **Stripe Trigger** (`payment_intent.succeeded`)
|
|
62
|
-
2. **PDFops**: Generate
|
|
81
|
+
2. **PDFops**: Invoice → Generate, mapping customer and line items into the invoice JSON
|
|
63
82
|
3. **Write Binary File** / email / upload the resulting PDF
|
|
64
83
|
|
|
65
84
|
More workflows and recipes: [pdfops.dev/pdf-api-for-n8n](https://pdfops.dev/pdf-api-for-n8n).
|