Mutant is a django application to transform your html template or external link in a pdf file in a simple way.
Mutant has some dependences:
- You have to install wkhtmltopdf. You can find it at: http://code.google.com/p/wkhtmltopdf/
- You have to install pyzmq. For more informations look at: https://github.com/zeromq/pyzmq
- It works only with uWSGI application server and its documentation is here: http://projects.unbit.it/uwsgi/
- Obviously it's a django application, so...
Remember: to use special characters you must include in your template following meta information:
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
First af all you have to configure config.py in mutant package.
Then, set uwsgi parameters in your ini configuration:
import = mutant
mule = 1
from mutant.views import pdf_to_response
def myview(request):
html= "template_name.html" #or external link like 'www.google.com'. In this case you have to set ext_url = True in pdf_to_response
dest = "/path_to_destination_file/filename.pdf"
return pdf_to_response(request,html,dest)