n8n-nodes-pdfops 0.4.0 → 0.6.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 +27 -11
- package/dist/nodes/Pdfops/Pdfops.node.js +1097 -17
- package/dist/nodes/Pdfops/Pdfops.node.js.map +1 -1
- package/dist/nodes/Pdfops/Pdfops.node.json +28 -1
- package/dist/nodes/Pdfops/decodeApiError.d.ts +1 -0
- package/dist/nodes/Pdfops/decodeApiError.js +18 -0
- package/dist/nodes/Pdfops/decodeApiError.js.map +1 -1
- package/dist/package.json +2 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
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,21 +21,24 @@ from **Settings → Community Nodes → Install** → `n8n-nodes-pdfops`.
|
|
|
19
21
|
|
|
20
22
|
## Operations
|
|
21
23
|
|
|
22
|
-
|
|
24
|
+
Operations are grouped by resource: **Form** (Add Fields, Detect Fields, Fill, Inspect Fields, Make Fillable), **Document**
|
|
23
25
|
(Delete Pages, Extract Pages, Merge, Rotate Pages, Split PDF), **Stamp** (Add Page Numbers, Add
|
|
24
|
-
Watermark), **
|
|
25
|
-
|
|
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.
|
|
26
30
|
|
|
27
31
|
Every PDF operation reads the input PDF from a binary field (default `data`).
|
|
28
32
|
Operations that return a PDF write it to an output binary field (default `data`)
|
|
29
|
-
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.
|
|
30
35
|
|
|
31
36
|
| Resource → Operation | What it does | Key parameters |
|
|
32
37
|
| --- | --- | --- |
|
|
33
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 |
|
|
34
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 |
|
|
35
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 |
|
|
36
|
-
| **Invoice → Generate** | Turns structured JSON (from, to, items, tax, currency…) into a US-Letter invoice PDF, no template needed. | Invoice (JSON) |
|
|
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) |
|
|
37
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-` |
|
|
38
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-` |
|
|
39
44
|
| **Document → Rotate Pages** | Rotates all or selected pages. | Degrees (90, 180, 270, -90), Pages (empty = all) |
|
|
@@ -45,11 +50,22 @@ and set `fileName` on the item JSON.
|
|
|
45
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 |
|
|
46
51
|
| **Metadata → Set** | Sets title, author, subject, keywords or creator and outputs the updated PDF. | Metadata fields (at least one) |
|
|
47
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
|
+
| **Form → Detect Fields** | Suggests text and checkbox fields for a flat PDF (no form fields yet) and returns them as JSON: `count`, `truncated`, `nextPages` and `fields` (type, name from the nearest printed label, page, x, y, width, height, label, confidence). Detects fields drawn as lines, boxes, underscores and checkboxes; review the result. The PDF is not changed. | Pages; options: Max Pages (default 40), Min Confidence (default 0.4), Input PDF Password |
|
|
55
|
+
| **Form → Make Fillable (Detect Fields)** | Detects the fields and adds them in one call: outputs the fillable PDF as binary data, and the item JSON carries `fields_count`, `field_names`, `truncated`, `next_pages`, `pages_skipped` and `warning` when they apply. Nothing found is the error `no_fields`. Long documents are handled for you: the node sends the result back with the pages not done (up to 25 calls per item), continues past `no_fields` while pages are left, and reports `pages_skipped` and the first `warning`. When the loop ends early you get a partial result (the PDF so far with `truncated` true, `next_pages`, `stopped_by` = `{code, message}` and a `message`; code is `stalled`, `max_rounds` or the API error code of the failed call) only if at least one field was added, so you can resume; otherwise the item fails with an error that carries the stop code and the pages left. Review the result. | Pages; options: Max Pages, Min Confidence; Input PDF Password, Output Binary Field, Output File Name |
|
|
56
|
+
| **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 |
|
|
57
|
+
| **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) |
|
|
58
|
+
| **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 |
|
|
59
|
+
| **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 |
|
|
60
|
+
| **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 |
|
|
61
|
+
| **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 |
|
|
62
|
+
| **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 |
|
|
48
63
|
|
|
49
64
|
Page specs are 1-based: comma-separated pages and ranges, `8-` meaning page 8
|
|
50
|
-
to the end. All operations
|
|
51
|
-
|
|
52
|
-
|
|
65
|
+
to the end. All operations that read a PDF accept an **Input PDF Password** for inputs that need one to open.
|
|
66
|
+
Output is deterministic (the same input gives a byte-identical PDF) for every PDF-producing
|
|
67
|
+
operation except Security → Protect (salted encryption) and Convert → HTML to PDF (rendered by a
|
|
68
|
+
browser, so two renders can differ in bytes). Extract Text, Find Text and Detect Fields only read.
|
|
53
69
|
|
|
54
70
|
Errors carry the API's own message (for example which AcroForm field name was
|
|
55
71
|
wrong). With **Continue on Fail** a failing item becomes `{ error, message }`
|