@k-dang/pdf-tools 0.1.2 → 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 +20 -15
- package/dist/cli.js +32 -30
- package/dist/tui.js +53 -0
- package/package.json +8 -3
package/README.md
CHANGED
|
@@ -7,6 +7,7 @@ A fast CLI tool to extract specific pages from PDF files and merge multiple PDFs
|
|
|
7
7
|
- Extract single pages or page ranges from PDFs
|
|
8
8
|
- Support for complex page specifications (e.g., `"1,3,5-8"`)
|
|
9
9
|
- Merge multiple PDFs into a single file
|
|
10
|
+
- Interactive TUI for visual file selection and page picking
|
|
10
11
|
- Fast file operations using Bun runtime
|
|
11
12
|
- Built with TypeScript for type safety
|
|
12
13
|
|
|
@@ -20,6 +21,12 @@ bun install -g @k-dang/pdf-tools
|
|
|
20
21
|
|
|
21
22
|
## Usage
|
|
22
23
|
|
|
24
|
+
```bash
|
|
25
|
+
pdf-tools split <input-file> --pages <pages> [--output <output-file>]
|
|
26
|
+
pdf-tools merge <file1.pdf> <file2.pdf> [file3.pdf ...] [--output <output-file>]
|
|
27
|
+
pdf-tools tui
|
|
28
|
+
```
|
|
29
|
+
|
|
23
30
|
### Extract Pages
|
|
24
31
|
|
|
25
32
|
```bash
|
|
@@ -75,24 +82,22 @@ Merge multiple PDFs with custom output:
|
|
|
75
82
|
pdf-tools merge file1.pdf file2.pdf file3.pdf --output combined.pdf
|
|
76
83
|
```
|
|
77
84
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
- Single page: `"6"`
|
|
81
|
-
- Page range: `"6-8"` (includes pages 6, 7, and 8)
|
|
82
|
-
- Multiple pages/ranges: `"1,3,5-8"` (pages 1, 3, 5, 6, 7, 8)
|
|
83
|
-
|
|
84
|
-
## Development
|
|
85
|
-
|
|
86
|
-
### Prerequisites
|
|
85
|
+
### Interactive TUI
|
|
87
86
|
|
|
88
|
-
|
|
87
|
+
Launch the interactive terminal UI for visual file browsing and page selection:
|
|
89
88
|
|
|
90
89
|
```bash
|
|
91
|
-
|
|
90
|
+
pdf-tools tui
|
|
92
91
|
```
|
|
93
92
|
|
|
94
|
-
|
|
93
|
+
The TUI provides:
|
|
95
94
|
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
95
|
+
- File browser for selecting PDFs
|
|
96
|
+
- Visual page picker for split operations
|
|
97
|
+
- Multi-file selection for merge operations
|
|
98
|
+
|
|
99
|
+
## Page Range Format
|
|
100
|
+
|
|
101
|
+
- Single page: `"6"`
|
|
102
|
+
- Page range: `"6-8"` (includes pages 6, 7, and 8)
|
|
103
|
+
- Multiple pages/ranges: `"1,3,5-8"` (pages 1, 3, 5, 6, 7, 8)
|