This is a Flask web application that allows users to upload PDF files and convert each page into JPEG images. It also includes basic pages such as "About" and "Contact," with a contact form that stores submissions in an SQLite database.
- Upload multiple PDF files and convert them into images.
- View and download the converted images.
- Contact form with data storage using SQLite.
- Includes "Home," "About," "Contact," and result pages.
.
├── static
│ ├── outputs # Folder for storing converted images
│ └── uploads # Folder for storing uploaded PDF files
├── templates # HTML templates for the web pages
│ ├── about.html
│ ├── base.html
│ ├── contact.html
│ ├── duplicate.html
│ ├── home.html
│ ├── result.html
│ └── submit.html
├── .gitignore # Specifies files/folders to be ignored by Git
├── app.py # Main Flask application file
├── database.db # SQLite database for contact form submissions
└── requirements.txt # List of Python dependenciesEnsure the following are installed:
- Python 3.x
- Flask
- pdf2image library
- SQLite
-
Clone the repository: git clone https://github.com/DevMohammad-SA/EasyPDFtoJPG cd [repository-directory]
-
Create a virtual environment and activate it:
python -m venv venv source venv/bin/activate # Linux/macOS venv\Scripts\activate # Windows
-
Install dependencies:
pip install -r requirements.txt
-
Ensure directories for uploads and outputs:
mkdir -p static/uploads static/outputs
-
Run the Flask application:
python app.py
-
Open the application in your browser:
/- Home page for uploading PDFs./about- About page./contact- Contact form page./submit- Handles contact form submissions./static/outputs/<filename>- Serves converted images.
The contacts table in database.db stores contact form submissions:
CREATE TABLE IF NOT EXISTS contacts (
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT,
email TEXT UNIQUE,
message TEXT,
date_created TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);The .gitignore file should exclude the following:
.DS_Store
*.pyc
__pycache__/
instance/
.env
database.db
static/uploads/
static/outputs/This project is open-source. Feel free to modify and distribute it.