2015-04-05 10:46:24 +00:00
|
|
|
from orchestra.utils.sys import run
|
2014-09-03 22:01:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
def html_to_pdf(html):
|
|
|
|
""" converts HTL to PDF using wkhtmltopdf """
|
2014-10-16 15:11:52 +00:00
|
|
|
return run(
|
|
|
|
'PATH=$PATH:/usr/local/bin/\n'
|
|
|
|
'xvfb-run -a -s "-screen 0 640x4800x16" '
|
2015-04-21 13:12:48 +00:00
|
|
|
'wkhtmltopdf -q --footer-center "Page [page] of [topage]" '
|
|
|
|
' --footer-font-size 9 --margin-bottom 20 --margin-top 20 - -',
|
2015-04-20 14:23:10 +00:00
|
|
|
stdin=html.encode('utf-8')
|
2015-02-24 09:34:26 +00:00
|
|
|
).stdout
|