You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PDF Toolkit is a Python application that provides a graphical user interface (GUI) for performing various operations on PDF files, such as editing metadata, extracting pages, and extracting images. The application is built using `tkinter` for the GUI and `PyPDF2` for PDF operations.
5
+
PDF Toolkit is a Python application that provides both a graphical user interface (GUI) and a command-line interface (CLI) for performing various operations on PDF files. These operations include editing metadata, extracting pages and images, merging PDFs, and creating PDFs from images.
6
6
7
7
## Features
8
8
@@ -11,31 +11,86 @@ PDF Toolkit is a Python application that provides a graphical user interface (GU
11
11
-**Save and Load Metadata**: Save metadata to a JSON file and load metadata from a JSON file.
12
12
-**Page Operations**: Extract specific pages from a PDF file and save them as a new PDF.
13
13
-**Image Operations**: Extract images from a PDF file and save them to a specified directory.
14
+
-**PDF Merging**: Combine multiple PDF files into a single document.
15
+
-**Image to PDF Conversion**: Convert image files to PDF with customizable page settings.
14
16
-**Drag and Drop**: Drag and drop PDF files directly into the application for easy loading.
15
17
-**Window Centering**: The application window opens centered on the screen.
18
+
-**CLI Interface**: Use all features via command-line for batch operations.
16
19
17
20
## Requirements
18
21
19
22
- Python 3.7+
20
23
-`PyPDF2` library
21
24
-`tkinterdnd2` library
25
+
-`pillow` library
22
26
23
27
You can install the required library using the following command:
24
28
25
-
```sh
29
+
```
26
30
pip install -r requirements.txt
27
31
```
28
32
29
33
## Usage
30
-
**Running the Application**
34
+
### **Running the Application (GUI)**
31
35
32
-
To run the application, execute the following command:
33
-
```bash
36
+
To launch the graphical user interface, execute the following command:
37
+
```
34
38
python pdftoolkit.py
35
39
```
36
40
37
-
### User Interface
41
+
### **Command-Line Interface (CLI)**
42
+
43
+
The PDF Toolkit CLI supports various operations on PDF files. Below are some usage examples:
44
+
#### Read PDF Metadata
45
+
```
46
+
pdftoolkit_cli.py read example.pdf
47
+
```
48
+
This command reads the metadata of the specified PDF file.
49
+
#### Validate a PDF File
50
+
```
51
+
pdftoolkit_cli.py validate example.pdf
52
+
```
53
+
This command checks whether the provided PDF file is valid.
Default margin values (left, right, top, bottom) are 10.
80
+
81
+
The ```--scaling``` option accepts both text values (e.g., "scale to fit", "stretch to fit", "actual size", "stretch to fill") and integer values (1-4) mapping to these options.
82
+
83
+
84
+
## User Interface
38
85
39
86
The following image shows the graphical user interface of the PDF Toolkit:
0 commit comments