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,118 @@ 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+ # Or use uv to install the tool
37+ uv tool install pdf-helper
38+ ```
39+
40+ And run it using the command line:
41+
42+ ``` bash
43+ pdf-helper < command> [options]
44+ ```
45+
46+ Or you can use uvx to run the package without installing it in a specific python environment:
3547
3648``` bash
37- git clone https://GitHub.com/MPCodeWriter21/PDF-Helper
49+ uvx pdf-helper < command > [options]
3850```
3951
40- + Use pip to install the dependencies :
52+ You can also clone the repository and use ` uv run ` :
4153
4254``` bash
43- pip install -r requirements.txt
55+ git clone https://github.com/MPCodeWriter21/PDF-Helper.git
56+ cd PDF-Helper
57+ uv run pdf-helper < command> [options]
4458```
4559
4660### Merge PDFs
4761
4862Merge multiple PDFs into one PDF:
4963
5064``` bash
51- python3 main.py merge -i < input_file_1> < input_file_2> ... < input_file_n> -o < output_file>
65+ pdf-helper merge -i < input_file_1> < input_file_2> ... < input_file_n> -o < output_file>
5266
5367# 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
68+ pdf-helper merge -i 1.pdf 2.pdf 3.pdf -o new.pdf
5569```
5670
5771### Split PDFs
5872
5973Split a PDF into multiple PDFs, each containing a range of pages:
6074
6175``` bash
62- python3 main.py split -i < input_file> -o < output_folder> -s < split_point_1> ,< split_point_2>
76+ pdf-helper split -i < input_file> -o < output_folder> -s < split_point_1> ,< split_point_2>
6377
6478# E.g. Split a PDF into three PDFs, one with pages 1-10, the second with pages 11-20 and
6579# the third with pages 21-end
66- python3 main.py split -i my-pdf.pdf -o my-split-pdfs -s 10,20
80+ pdf-helper split -i my-pdf.pdf -o my-split-pdfs -s 10,20
6781
6882# 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
83+ pdf-helper split -i my-pdf.pdf -o my-split-pdfs # No need to specify split points
7084```
7185
7286### Export PDF pages as image files
7387
7488Export PDF pages as image files:
7589
7690``` bash
77- python3 main.py to-image -i < input_file> -o < output_folder> \
91+ pdf-helper to-image -i < input_file> -o < output_folder> \
7892 -p < page_number_1> ,< page_number_2> ,...,< page_number_n> -s < scale_factor>
7993
8094# 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
95+ pdf-helper to-image -i 1.pdf -o images -p 1-3,6 -s 1
8296
8397# E.g. Export all pages from a PDF with scale 2
84- python3 main.py to-image -i my-pdf.pdf -o my-images
98+ pdf-helper to-image -i my-pdf.pdf -o my-images
8599```
86100
87101### Remove pages from a PDF
88102
89103Remove pages from a PDF:
90104
91105``` bash
92- python3 main.py remove-pages -i < input_file> -o < output_file> -p < page_number_1> ,< page_number_2> ,...,< page_number_n>
106+ pdf-helper remove-pages -i < input_file> -o < output_file> -p < page_number_1> ,< page_number_2> ,...,< page_number_n>
93107
94108# 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
109+ pdf-helper remove-pages -i 1.pdf -o new.pdf -p 1-3,6
96110```
97111
98112### Export text from a PDF
99113
100114To extract text from a PDF file and export them to text files you can do as follows:
101115
102116``` bash
103- python3 main.py extract-text -i < input_file> -o < output_file_name>
117+ pdf-helper extract-text -i < input_file> -o < output_file_name>
104118
105119# 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
120+ pdf-helper extract-text -i my-pdf.pdf -o my-text.txt
107121```
108122
109123### Export one or multiple images as a PDF file
110124
111125You simply provide the script with your images, and it will create a PDF file with them:
112126
113127``` bash
114- python3 main.py image-to-pdf -i < image_1> < image_2> < image_3> ... -o < output_file>
128+ pdf-helper image-to-pdf -i < image_1> < image_2> < image_3> ... -o < output_file>
115129
116130# E.g. Take 1.png, 2.jpg, and 3.png and create a PDF named 123.pdf and override
117131# if already exists
118- python3 main.py image-to-pdf -i 1.png 2.jpg 3.png -o 123.pdf -f
132+ pdf-helper image-to-pdf -i 1.png 2.jpg 3.png -o 123.pdf -f
119133```
120134
121135About
122136-----
123137
124138Author: [ CodeWriter21] ( https://github.com/MPCodeWriter21 )
125139
126- GitHub: [ MPCodeWriter21/PDF-To-Image ] ( https://github.com/MPCodeWriter21/PDF-To-Image )
140+ GitHub: [ MPCodeWriter21/PDF-Helper ] ( https://github.com/MPCodeWriter21/PDF-Helper )
127141
128142Donations
129143---------
0 commit comments