Open adiptamartulandi opened 2 years ago
I had the same issue. Having rummaged in the library, I found that, when using the --quiet flag, apparently, wkhtmltopdf passes the same thing to the stder as to the stdout, that is, a byte string with a picture. However, in the library, the stder stream is decoded to utf-8, which causes the error. Until the bug is fixed, it can be bypassed as follows:
try:
jpeg = imgkit.from_string(html_string, False, options={'quiet': ''})
except UnicodeDecodeError as err:
jpeg = err.args[1]
iam using macbook air m1 python 3.7 imgkit==1.2.2 wkhtmltopdf==0.2 wkhtmltoimage 0.12.6
hello i want to read html code but getting error utf-8' codec can't decode byte 0xff in position 0: invalid start byte
here is my code