https://github.com/20tab/mutant
Mutant is a django application to transform your html template or external link in a pdf file in a simple way.
https://github.com/20tab/mutant
Last synced: about 1 year ago
JSON representation
Mutant is a django application to transform your html template or external link in a pdf file in a simple way.
- Host: GitHub
- URL: https://github.com/20tab/mutant
- Owner: 20tab
- License: other
- Created: 2012-07-19T10:09:14.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2012-10-10T10:35:00.000Z (over 13 years ago)
- Last Synced: 2025-04-13T16:13:05.476Z (about 1 year ago)
- Language: Python
- Homepage:
- Size: 212 KB
- Stars: 6
- Watchers: 5
- Forks: 2
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
mutant
=============
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:
1) You have to install wkhtmltopdf. You can find it at: http://code.google.com/p/wkhtmltopdf/
2) You have to install pyzmq. For more informations look at: https://github.com/zeromq/pyzmq
3) It works only with uWSGI application server and its documentation is here: http://projects.unbit.it/uwsgi/
4) 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">
## Usage
First af all you have to configure config.py in mutant package.
Then, set uwsgi parameters in your ini configuration:
``` ini
import = mutant
mule = 1
```
``` py
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)
```