A CLI tool to process images and convert them to a PDF.
Project description
img2scan2pdf
img2scan2pdf is a Command-Line Interface (CLI) tool that processes images and converts them into a single PDF. The tool performs automatic document detection and enhancement to ensure high-quality output, making it ideal for scanning documents.
Features
- Automatic Document Detection: Identifies and extracts document regions from images.
- Perspective Correction: Fixes skewed or angled documents.
- PDF Conversion: Converts processed images into a single PDF.
- A4 Sizing: Resizes documents to fit standard A4 dimensions with optional padding.
Installation
Install img2scan2pdf using pip:
pip install img2scan2pdf
Usage
The tool can be run directly from the command line. Specify the input directory containing images and the output PDF file path.
img2scan2pdf -i <input_directory> -o <output_pdf_path>
Arguments
-i,--input_dir: Path to the directory containing images to process. Supported formats are.png,.jpg, and.jpeg.-o,--output_pdf: Path to save the resulting PDF file.
Example
img2scan2pdf -i ./scanned_images -o ./output/document.pdf
This command processes all images in the ./scanned_images directory and saves the resulting PDF as ./output/document.pdf.
Development
Cloning the Repository
Clone the repository:
git clone https://github.com/yourusername/img2scan2pdf.git
cd img2scan2pdf
Installing Dependencies
Install the required Python dependencies:
pip install -r requirements.txt
Running Locally
Run the tool locally:
python -m img2scan2pdf.cli -i <input_directory> -o <output_pdf_path>
Contributing
Contributions are welcome! Feel free to submit a pull request or open an issue to suggest improvements or report bugs.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Acknowledgments
This tool uses the following libraries:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file img2scan2pdf-0.1.0.tar.gz.
File metadata
- Download URL: img2scan2pdf-0.1.0.tar.gz
- Upload date:
- Size: 4.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f404e6ed36b6ab30cc8c02e909b0d640fb0744c590285942db6a879d26e9532a
|
|
| MD5 |
5e84a6af929cc88d99a42d4de8a8db96
|
|
| BLAKE2b-256 |
69183e0cfd398d4a6a658516b1eac591d796c370d637f10c66fb9b4834a32af1
|
File details
Details for the file img2scan2pdf-0.1.0-py3-none-any.whl.
File metadata
- Download URL: img2scan2pdf-0.1.0-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
db8892cffb298618a35c2a49990a8ee51451cae914db5c2ada9349500d63a61d
|
|
| MD5 |
87cfde05d94c30443a6ac7a66abb85c5
|
|
| BLAKE2b-256 |
f1bfc1a8fbd6d9c8bb9ea32ceb59edcc0cd3e1715789d83cd784240558e38cb6
|