/football

Docker image for converting HTML to PDF using wkhtmltopdf

Primary LanguagePythonMIT LicenseMIT

Football

A Docker image for converting HTML to PDF using wkhtmltopdf

Quickstart

  • docker-compose build

  • docker-compose up

  • POST to localhost:5000 with following form-data body:

    • file : required HTML binary file for conversion to PDF
    • toc : optional true | false bool indicating whether to include a Table of Contents - default false
    • pagenumbers : optional true | false bool indicating whether to include page numbers - default false
    • cover : optional HTML binary file for cover page - default None
    • filename : optional Filename for the converted PDF - default tmp.pdf

Development

  • install virtualenvwrapper
  • mkvirtualenv football
  • workon football
  • pip install -r requirements.txt
  • python app.py

TODO

  • Input validation
  • Avoid writing cover to temp file
  • Use a production server instead of Flask's dev server
  • More pythonic code 🚀