-
Notifications
You must be signed in to change notification settings - Fork 74
Open
Labels
Description
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
import imgkit
import base64
from IPython.display import display, HTML
body = '''
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="" xml:lang="">
<head>
<meta charset="utf-8" />
<meta name="generator" content="pandoc" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<title>equations</title>
<style type="text/css">
code{white-space: pre-wrap;}
span.smallcaps{font-variant: small-caps;}
span.underline{text-decoration: underline;}
div.column{display: inline-block; vertical-align: top; width: 50%;}
</style>
</head>
<body>
<p>Professional Format</p>
<meta charset="utf-8" />
<p><math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><msubsup><mo>∫</mo><mn>0</mn><mn>1</mn></msubsup><mi>x</mi></mrow><annotation encoding="application/x-tex">\int_{0}^{1}x</annotation></semantics></math></p>
<p>Linear Format</p>
<p><math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>∖</mo><mi>i</mi><mi>n</mi><mi>t</mi><mi>_</mi><mo stretchy="false" form="prefix">{</mo><mn>0</mn><mo stretchy="false" form="postfix">}</mo><mover><mrow></mrow><mo accent="true">̂</mo></mover><mo stretchy="false" form="prefix">{</mo><mn>1</mn><mo stretchy="false" form="postfix">}</mo><mi>x</mi></mrow><annotation encoding="application/x-tex">\backslash int\_\{ 0\}\hat{}\{ 1\} x</annotation></semantics></math></p>
<p>Linear Format with lt</p>
<p><math display="block" xmlns="http://www.w3.org/1998/Math/MathML"><semantics><mrow><mo>∖</mo><mi>i</mi><mi>n</mi><msub><mi>t</mi><mrow><mo stretchy="true" form="prefix">{</mo><mn>0</mn><mo stretchy="true" form="postfix">}</mo></mrow></msub><mo><</mo><mrow><mo stretchy="true" form="prefix">{</mo><mn>1</mn><mo stretchy="true" form="postfix">}</mo></mrow><mi>x</mi><mo><</mo><mn>5</mn></mrow><annotation encoding="application/x-tex">\backslash int_{\left\{ 0 \right\}} < \left\{ 1 \right\} x < 5</annotation></semantics></math></p>
</body>
</html>
'''
options = {
"quiet": ""
}
img = imgkit.from_string(body, False, options=options)