New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

returned non-zero exit status 1 #151

Open
durdenk opened this Issue Aug 16, 2017 · 3 comments

Comments

Projects
None yet
4 participants
@durdenk

durdenk commented Aug 16, 2017

I think its possibly my mistake, this cannot be that wrong,

settings.py

WKHTMLTOPDF_CMD_OPTIONS = {
    'quiet': False,
    'disable-javascript': True
}
WKHTMLTOPDF_CMD = '/usr/bin/wkhtmltopdf'

Using:

class MyPDF(PDFTemplateView):
    filename = '/home/workspace/panda/test.pdf'
    template_name = 'pdf-text.html'
    cmd_options = {
        'margin-top': 3,
    }

I get:

**Command '['/usr/bin/wkhtmltopdf', u'--disable-javascript', '--encoding', u'utf8', u'--margin-top', u'3', u'--quiet', u'False', '/tmp/wkhtmltopdfWaFux9.html', '-']' returned non-zero exit status 1**

If I run this python code:

arg = ['/usr/bin/wkhtmltopdf','/tmp/wkhtmltopdfWaFux9.html','/home/workspace/test.pdf']
subprocess.check_output(arg)

I get the correct behaviour, since I got no permission or other errors doing check_output manually, is it possible that, this view calls wkhtmltopdf with wrong order?

Thanks

@eduardocasas

This comment has been minimized.

Show comment
Hide comment
@eduardocasas

eduardocasas Nov 22, 2017

I had the same problem. Try to add this to your settings.py file:

WKHTMLTOPDF_CMD = 'xvfb-run -a wkhtmltopdf'

eduardocasas commented Nov 22, 2017

I had the same problem. Try to add this to your settings.py file:

WKHTMLTOPDF_CMD = 'xvfb-run -a wkhtmltopdf'

@eersya

This comment has been minimized.

Show comment
Hide comment
@eersya

eersya Aug 2, 2018

Could you put the code of your template? I solve my problem eliminating my style-sheets loaded from static

eersya commented Aug 2, 2018

Could you put the code of your template? I solve my problem eliminating my style-sheets loaded from static

@jlariza

This comment has been minimized.

Show comment
Hide comment
@jlariza

jlariza Aug 3, 2018

@eduardocasas answer solved the problem for me.

jlariza commented Aug 3, 2018

@eduardocasas answer solved the problem for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment