mcquadenc / dj-wkhtmltopdf

generate pdf from html using wkhtmltopdf, html, python and django

Home Page:http://dj-wkhtmltopdf.readthedocs.org/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PyPI version dj-wkhtmltopdf


It works on wkhtmltopdf . dj-wkhtmltopdf will allow user to organize their own pdf generator through django admin without any deployment :).

Mainly I was inspired by django-wkhtmltopdf . When I was working on Eccomerce project we generated invoice for orders using wkhtmltopdf ( pdf generator using django-wkhtmltopdf wrapper ). Every time we did some modifications on local server and push it to production we faced different design issues on production, then we resolve those issues on local and pushed it to production, but it's a painful and time consuming process so I thought of buliding this package. Requirements:


Install the wkhtmltopdf . Python 2.6+ and 3.3+ is supported. Installation:


Run pip install dj-wkhtmltopdf.

Add 'djwkhtmltopdf' to INSTALLED_APPS in your settings.py .

Then run the python manage.py syncdb .

By default it will execute the first wkhtmltopdf command found on your PATH .

If you can't add wkhtmltopdf to your PATH you can set WKHTMLTOPDF_CMD to a specific execuatable:

e.g. in settings.py:

WKHTML_TO_PDF_CMD = '/path/to/my/wkhtmltopdf'

You may also set wkhtmltopdf options through django admin or WKHTML_OPTIONS in settings.py to a dictionary of default command-line options.

Like this is: WKHTML_OPTIONS = { '--quiet': True, } Important Note:


I've tested it only on Ubuntu but haven't tested it on Mac and Windows. License:


MIT licensed. See the bundled LICENSE file for more details.

About

generate pdf from html using wkhtmltopdf, html, python and django

http://dj-wkhtmltopdf.readthedocs.org/en/latest/

License:BSD 2-Clause "Simplified" License


Languages

Language:Python 100.0%