https://github.com/imshaa/pdfmerger_image-resizer
I've made a Pdf Merger and Image resizer in Python Using Pypdf2 and OpenCv.
https://github.com/imshaa/pdfmerger_image-resizer
imageresizer opencv opencv-python pdfmerger pypdf2 python python-library python-pypdf2
Last synced: 4 months ago
JSON representation
I've made a Pdf Merger and Image resizer in Python Using Pypdf2 and OpenCv.
- Host: GitHub
- URL: https://github.com/imshaa/pdfmerger_image-resizer
- Owner: imshaa
- Created: 2025-02-23T13:28:22.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2025-02-23T13:36:04.000Z (4 months ago)
- Last Synced: 2025-03-06T03:18:30.075Z (4 months ago)
- Topics: imageresizer, opencv, opencv-python, pdfmerger, pypdf2, python, python-library, python-pypdf2
- Language: Python
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PDF Merger & Image Resizer
## Description
This Python script provides two functionalities:
1. Merging multiple PDF files into a single PDF.
2. Resizing an image by 50% and saving it with a new filename.## Features
- **PDF Merger:** Allows users to merge multiple PDFs into a single document.
- **Image Resizer:** Resizes an image to 50% of its original size.
- **User Input Friendly:** Users can choose between PDF merging and image resizing via an input prompt.## Requirements
Ensure you have the following dependencies installed before running the script:```bash
pip install PyPDF2 opencv-python
```## How to Use
1. Run the script:
```bash
python script.py
```
2. Choose an option:
- Enter `0` for image resizing.
- Enter `1` for PDF merging.
3. Follow the on-screen instructions:
- **For PDF merging:** Enter the filenames of the PDFs you want to merge (separated by space).
- **For Image resizing:** Enter the filename of the image to resize and the desired output filename.
4. **Important:** If you want to resize an image or merge PDFs, make sure to drag your file to your IDE or the folder where you are running this project. At the input prompt, enter the name of that file correctly.## Example Usage
### Merging PDFs
```bash
Enter 1 for PdfMerger: 1
Enter the PDF filenames to merge (separated by space): file1.pdf file2.pdf file3.pdf
```
_Output:_ A new file `merged.pdf` will be created.### Resizing an Image
```bash
Enter 0 for Image resizing: 0
Enter the Image name you want to resize: image.jpg
Enter the new name for image: resized_image.jpg
```
_Output:_ A new resized image `resized_image.jpg` will be saved.## License
This project is open-source and available for use under the MIT License.## Author
IMSHA NADEEM