-
-
Notifications
You must be signed in to change notification settings - Fork 48
Description
Hi, im generating an HTML template which is the app then takes a screenshot of it and sends it into an discord embed message. The problem is that the viewport is not complete as you can see in the following image. I tried a lots of ways to repair it but i didnt succed. Some help please, thank you!
hti = Html2Image(
output_path=tempfile.gettempdir(),
browser_executable=None, # Use default browser
custom_flags=[
"--no-sandbox",
"--disable-web-security",
"--disable-features=VizDisplayCompositor",
"--disable-dev-shm-usage",
"--disable-gpu",
"--window-size=1100,680",
],
)
image_path = os.path.join(
tempfile.gettempdir(), f"final_match_{match_id.replace('#','')}.png"
)
hti.screenshot(
html_str=html_content,
save_as=os.path.basename(image_path),
size=(1100, 680),
)
<style>
* {
box-sizing: border-box;
margin: 0;
padding: 0;
}
html,
body {
width: 1100px;
height: 680px;
margin: 0;
padding: 0;
font-family: 'Industry', sans-serif;
font-weight: 400;
}
