This simple Flask application allows you to convert HTML content to PDF documents using wkhtmltopdf. It provides a web interface for users to input HTML content and generate PDF files.
- Python 3.9 or higher
- wkhtmltopdf installed on your system
- Virtual environment tool (e.g.,
venv
)
-
Clone the repository to your local machine:
git clone https://github.com/A3Brothers/html-to-pdf.git
-
Navigate to the project directory:
cd html-to-pdf
-
Create a Python virtual environment:
python -m venv venv
-
Activate the virtual environment:
-
On macOS and Linux:
source venv/bin/activate
-
On Windows (Command Prompt):
venv\Scripts\activate
-
On Windows (PowerShell):
.\venv\Scripts\Activate.ps1
-
-
Install the required Python packages:
pip install -r requirements.txt
-
Start the Flask application:
python app.py or flask run
-
Open your web browser and go to http://localhost:5000/
-
Enter your HTML content in the provided textarea.
-
Click the "Convert to PDF" button.
-
The generated PDF will be available for download.
I created this application to convert HTMLized emails to PDF format. Many free online services have limitations, and I wanted a simple and reliable tool to perform this task. I plan to continue improving this application and adding more features in the future.
Contributions from other developers are welcome through pull requests (PRs).
Feel free to use, modify, and contribute to this project as needed.
Note: This README is written by the project author and is intended to provide a straightforward setup guide. For any questions or assistance, please contact the project owner.