[BangPypers] Fwd: Help!!! Python/Django & WKHTMLTOPDF
Gora Mohanty
gora at mimirtech.com
Fri Jun 5 11:51:39 CEST 2015
Hi,
This is really not on-topic for this list, but the error is most
likely because wkhtmltopdf is not in your path. Try using the
WKHTMLTOPDF_CMD = '/path/to/my/wkhtmltopdf'
setting for django-wkhtmltopdf package
Regards,
Gora
On 5 June 2015 at 15:03, Sunil Gupta <sunil at planmytour.in> wrote:
> Hi All,
>
> We are facing the problem of creating the HTML to PDF in ubuntu.The package
> wkhtmltopdf is working fine on windows but when we integrated my code onto
> ubuntu its throwing errors. Any pointers would be a great help.
>
> Traceback (most recent call last):
> File "./apps/common/views.py", line 702, in get
> pdf_content = response.rendered_content
> File "/usr/local/lib/python2.7/dist-packages/wkhtmltopdf/views.py", line
> 148, in rendered_content
> footer_filename=footer_filename)
> File "/usr/local/lib/python2.7/dist-packages/wkhtmltopdf/views.py", line
> 107, in convert_to_pdf
> return wkhtmltopdf(pages=[filename], **cmd_options)
> File "/usr/local/lib/python2.7/dist-packages/wkhtmltopdf/utils.py", line
> 98, in wkhtmltopdf
> return check_output(ck_args, **ck_kwargs)
> File "/usr/lib/python2.7/subprocess.py", line 566, in check_output
> process = Popen(stdout=PIPE, *popenargs, **kwargs)
> File "/usr/lib/python2.7/subprocess.py", line 710, in __init__
> errread, errwrite)
> File "/usr/lib/python2.7/subprocess.py", line 1327, in _execute_child
> raise child_exception
> *OSError: [Errno 8] Exec format error*
>
> We installed django-wkhtmltopdf package, wkhtmltopdf executable
>
> From the command prompt when we try creating the file it works fine but in
> django project its throwing error
>
> root$wkhtmltopdf www.google.com output.pdf ----> works fine
>
> Any idea what can be the issue with
>
> Thanks
> Sunil
> _______________________________________________
> BangPypers mailing list
> BangPypers at python.org
> https://mail.python.org/mailman/listinfo/bangpypers
More information about the BangPypers
mailing list