@aaqu/node-red-aaqu-pdf 0.1.0 → 0.1.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.
Files changed (2) hide show
  1. package/README.md +66 -4
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,7 +1,69 @@
1
- # aaqu-pdf
1
+ # node-red-contrib-aaqu-pdf
2
2
 
3
- pdf creator
3
+ A [Node-RED](https://nodered.org/) node for extracting a single page from a PDF document.
4
4
 
5
- # current
5
+ This module provides a custom Node-RED node that takes a **PDF buffer** as input and outputs a **new PDF buffer** containing only the specified page.
6
6
 
7
- pdf-get-page
7
+ ---
8
+
9
+ ## Features
10
+
11
+ - Accepts a PDF document as a `Buffer` in `msg.payload`.
12
+ - Page number can be set either in the **node configuration** or dynamically via `msg.pdfPage`.
13
+ - Outputs a new `Buffer` containing a PDF with only the selected page.
14
+ - Simple integration with existing Node-RED flows.
15
+
16
+ ---
17
+
18
+ ## Installation
19
+
20
+ Run the following command inside your Node-RED user directory (typically `~/.node-red`):
21
+
22
+ ```bash
23
+ npm install node-red-contrib-aaqu-pdf
24
+ ```
25
+
26
+ Then restart Node-RED and the new node will appear in the editor palette.
27
+
28
+ ---
29
+
30
+ ## Usage
31
+
32
+ 1. Provide a PDF file (e.g., using the **file in** node).
33
+ 2. Pass the PDF buffer to the **aaqu-pdf** node.
34
+ 3. Configure the page number in the node’s settings, or pass it dynamically using `msg.pdfPage`.
35
+ > **Note:** Page numbering starts from `1`.
36
+ 4. The node will return a new PDF buffer containing only the requested page.
37
+
38
+ ### Example Flow
39
+
40
+ ```text
41
+ [file in] → [aaqu-pdf] → [file out]
42
+ ```
43
+
44
+ Where:
45
+ - **file in** reads the original PDF into `msg.payload` (as a buffer).
46
+ - **aaqu-pdf** extracts the configured page (or the page defined in `msg.pdfPage`).
47
+ - **file out** writes the single-page PDF back to disk.
48
+
49
+ ---
50
+
51
+ ## Configuration
52
+
53
+ - **msg.payload** - pdf buffer
54
+ - **msg.pdfPage** – optional runtime override for the page number (starting at `1`).
55
+
56
+ ---
57
+
58
+ ## Use cases
59
+
60
+ - Extracting pages from automatically generated reports.
61
+ - Preparing single-page documents for downstream processing.
62
+ - Splitting large PDFs into smaller parts.
63
+ - Creating lightweight attachments for email or APIs.
64
+
65
+ ---
66
+
67
+ ## License
68
+
69
+ Apache-2.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aaqu/node-red-aaqu-pdf",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "node-red pdf creator",
5
5
  "main": "index.js",
6
6
  "scripts": {