11PDF-Helper
22==========
33
4- A simple python script that helps with doing simple stuff with PDFs. It is going to
5- become a simple python package after ` main.py ` reaches 1000 lines of code.
4+ A simple python package that helps with doing simple stuff with PDFs.
65
76Features
87--------
@@ -27,103 +26,115 @@ after adding your contribution.
2726Usage
2827-----
2928
30- ### Install requirements
29+ ### Installation
3130
32- + Install Python for your operating system. Visit [ python.org ] ( https://python.org )
31+ You can install PDF-Helper via pip:
3332
34- + Clone the repo:
33+ ``` bash
34+ pip install pdf-helper
35+ ```
36+
37+ And run it using the command line:
38+
39+ ``` bash
40+ pdf-helper < command> [options]
41+ ```
42+
43+ Or you can use uvx to run the package without installing it in a specific python environment:
3544
3645``` bash
37- git clone https://GitHub.com/MPCodeWriter21/PDF-Helper
46+ uvx pdf-helper < command > [options]
3847```
3948
40- + Use pip to install the dependencies :
49+ You can also clone the repository and use ` uv run ` :
4150
4251``` bash
43- pip install -r requirements.txt
52+ git clone https://github.com/MPCodeWriter21/PDF-Helper.git
53+ cd PDF-Helper
54+ uv run pdf-helper < command> [options]
4455```
4556
4657### Merge PDFs
4758
4859Merge multiple PDFs into one PDF:
4960
5061``` bash
51- python3 main.py merge -i < input_file_1> < input_file_2> ... < input_file_n> -o < output_file>
62+ pdf-helper merge -i < input_file_1> < input_file_2> ... < input_file_n> -o < output_file>
5263
5364# E.g. Merge PDFs 1, 2 and 3 into a new PDF
54- python3 main.py merge -i 1.pdf 2.pdf 3.pdf -o new.pdf
65+ pdf-helper merge -i 1.pdf 2.pdf 3.pdf -o new.pdf
5566```
5667
5768### Split PDFs
5869
5970Split a PDF into multiple PDFs, each containing a range of pages:
6071
6172``` bash
62- python3 main.py split -i < input_file> -o < output_folder> -s < split_point_1> ,< split_point_2>
73+ pdf-helper split -i < input_file> -o < output_folder> -s < split_point_1> ,< split_point_2>
6374
6475# E.g. Split a PDF into three PDFs, one with pages 1-10, the second with pages 11-20 and
6576# the third with pages 21-end
66- python3 main.py split -i my-pdf.pdf -o my-split-pdfs -s 10,20
77+ pdf-helper split -i my-pdf.pdf -o my-split-pdfs -s 10,20
6778
6879# E.g. Split a PDF into PDFs each containing one page
69- python3 main.py split -i my-pdf.pdf -o my-split-pdfs # No need to specify split points
80+ pdf-helper split -i my-pdf.pdf -o my-split-pdfs # No need to specify split points
7081```
7182
7283### Export PDF pages as image files
7384
7485Export PDF pages as image files:
7586
7687``` bash
77- python3 main.py to-image -i < input_file> -o < output_folder> \
88+ pdf-helper to-image -i < input_file> -o < output_folder> \
7889 -p < page_number_1> ,< page_number_2> ,...,< page_number_n> -s < scale_factor>
7990
8091# E.g. Export pages 1, 2, 3 and 6 from a PDF with scale factor 1
81- python3 main.py to-image -i 1.pdf -o images -p 1-3,6 -s 1
92+ pdf-helper to-image -i 1.pdf -o images -p 1-3,6 -s 1
8293
8394# E.g. Export all pages from a PDF with scale 2
84- python3 main.py to-image -i my-pdf.pdf -o my-images
95+ pdf-helper to-image -i my-pdf.pdf -o my-images
8596```
8697
8798### Remove pages from a PDF
8899
89100Remove pages from a PDF:
90101
91102``` bash
92- python3 main.py remove-pages -i < input_file> -o < output_file> -p < page_number_1> ,< page_number_2> ,...,< page_number_n>
103+ pdf-helper remove-pages -i < input_file> -o < output_file> -p < page_number_1> ,< page_number_2> ,...,< page_number_n>
93104
94105# E.g. Remove pages 1, 2, 3 and 6 from a PDF
95- python3 main.py remove-pages -i 1.pdf -o new.pdf -p 1-3,6
106+ pdf-helper remove-pages -i 1.pdf -o new.pdf -p 1-3,6
96107```
97108
98109### Export text from a PDF
99110
100111To extract text from a PDF file and export them to text files you can do as follows:
101112
102113``` bash
103- python3 main.py extract-text -i < input_file> -o < output_file_name>
114+ pdf-helper extract-text -i < input_file> -o < output_file_name>
104115
105116# E.g. Extract text from a PDF named my-pdf.pdf and save it to my-text.txt
106- python3 main.py extract-text -i my-pdf.pdf -o my-text.txt
117+ pdf-helper extract-text -i my-pdf.pdf -o my-text.txt
107118```
108119
109120### Export one or multiple images as a PDF file
110121
111122You simply provide the script with your images, and it will create a PDF file with them:
112123
113124``` bash
114- python3 main.py image-to-pdf -i < image_1> < image_2> < image_3> ... -o < output_file>
125+ pdf-helper image-to-pdf -i < image_1> < image_2> < image_3> ... -o < output_file>
115126
116127# E.g. Take 1.png, 2.jpg, and 3.png and create a PDF named 123.pdf and override
117128# if already exists
118- python3 main.py image-to-pdf -i 1.png 2.jpg 3.png -o 123.pdf -f
129+ pdf-helper image-to-pdf -i 1.png 2.jpg 3.png -o 123.pdf -f
119130```
120131
121132About
122133-----
123134
124135Author: [ CodeWriter21] ( https://github.com/MPCodeWriter21 )
125136
126- GitHub: [ MPCodeWriter21/PDF-To-Image ] ( https://github.com/MPCodeWriter21/PDF-To-Image )
137+ GitHub: [ MPCodeWriter21/PDF-Helper ] ( https://github.com/MPCodeWriter21/PDF-Helper )
127138
128139Donations
129140---------
0 commit comments