Skip to content
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

Decoding problem with CSS File #6

Closed
guillermomarco opened this issue Dec 31, 2013 · 1 comment
Closed

Decoding problem with CSS File #6

guillermomarco opened this issue Dec 31, 2013 · 1 comment

Comments

@guillermomarco
Copy link

I'm getting error when trying to use CSS. I'm using webkit wkhtmltopdf 0.10.0 rc2

/usr/bin/python2.7 report/html_to_pdf.py
Traceback (most recent call last):
  File "report/html_to_pdf.py", line 7, in <module>
    pdfkit.from_file('results_report.html', 'results_report.pdf', css=css)
  File "/usr/local/lib/python2.7/dist-packages/pdfkit/api.py", line 46, in from_file
    return r.to_pdf(output_path)
  File "/usr/local/lib/python2.7/dist-packages/pdfkit/pdfkit.py", line 101, in to_pdf
    input = self.source.to_s().encode('utf-8')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xce in position 2149: ordinal not in range(128)

My code is:

import pdfkit

css = 'report.css'

pdfkit.from_file('results_report.html', 'results_report.pdf', css=css)
@JazzCore
Copy link
Owner

Should be fixed now

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants