Uses wkhtmltopdf as backend. Only works with python 3.5 or greater.
Enspired by: https://github.com/openlabs/docker-wkhtmltopdf and https://github.com/incuna/django-wkhtmltopdf.
pip install plankton
- download and install wkhtmltopdf http://wkhtmltopdf.org/downloads.html.
- Run server
plankton-server
If you want to run in docker container:
- Clone repo
git clone git@github.com:django-stars/plankton.git
cd plankton
- Build docker image
docker build -t plankton .
- Run container
docker run -p 9003:8080 plankton
.
You can specify wkhtmltopdf command and port:
plankton-server --wkhtmltopdf_command '/usr/local/bin/wkhtmltopdf' --port 9000
POST http://127.0.0.1:9003/html-to-pdf/
DATA {"page": "http://google.com.ua"}
You can provide wkhtmltopdf options:
DATA {"page": "http://google.com.ua", "options": {"javascript-delay": 2000, "cookie": [["key1","val1"], ["key2", "val2"]]}}
Project currently under developing and there are lot of things to do:
- debug mode
- HTTP OPTIONS
- logging
- security
- ...