Skip to content

Viewport is not full #185

@edyyy19

Description

@edyyy19

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),
)

<title>Document</title>
<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;
    }

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions