A Docker image for converting HTML to PDF using wkhtmltopdf
-
docker-compose build
-
docker-compose up
-
POST
tolocalhost:5000
with following form-data body:file
: required HTML binary file for conversion to PDFtoc
: optional true | false bool indicating whether to include a Table of Contents - defaultfalse
pagenumbers
: optional true | false bool indicating whether to include page numbers - defaultfalse
cover
: optional HTML binary file for cover page - defaultNone
filename
: optional Filename for the converted PDF - defaulttmp.pdf
- install virtualenvwrapper
mkvirtualenv football
workon football
pip install -r requirements.txt
python app.py
- Input validation
- Avoid writing
cover
to temp file - Use a production server instead of Flask's dev server
- More pythonic code 🚀