A Flask web application that converts PDF files and text files to images. PDFs are converted page by page, and text files are rendered as images.
Before running this application, you need to install:
- Python 13.1 or higher
- Poppler (required for PDF conversion)
-
macOS:
brew install poppler
-
Linux:
sudo apt-get install poppler-utils
-
Clone this repository:
git clone https://github.com/bradbrok/pdf2img cd pdf2img -
Create a virtual environment (recommended):
python -m venv venv
-
Activate the virtual environment:
- Windows:
venv\Scripts\activate
- macOS/Linux:
source venv/bin/activate
- Windows:
-
Install the required packages:
pip install -r requirements.txt
-
Start the Flask server:
python app.py
-
Open your web browser and navigate to:
http://localhost:5000
.
├── app.py # Main Flask application
├── requirements.txt # Python dependencies
├── static/ # Static files (CSS, JS, etc.)
│ └── css/
│ └── style.css
├── templates/ # HTML templates
│ └── index.html
└── uploads/ # Temporary folder for file uploads
- Select one or multiple PDF or text files using the file upload form
- Adjust DPI settings if needed (for PDF conversion)
- Click "Convert" to process the files
- A zip file containing the converted images will be downloaded automatically
- The application has a file size limit of 100MB
- Uploaded files are temporarily stored and automatically deleted after processing
- PDF files are converted to JPG images, one image per page
- Text files are rendered as images with configurable font size