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

Facing difficulties with the flexbox #2351

Open
harkishankhuva opened this issue Jan 16, 2025 · 1 comment
Open

Facing difficulties with the flexbox #2351

harkishankhuva opened this issue Jan 16, 2025 · 1 comment
Labels
bug Existing features not working as expected

Comments

@harkishankhuva
Copy link

Hello, so I'm trying to create a PDF from HTML that has flexbox in it, below is the code for the stylesheet and the HTML file

Stylesheet:

body {
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-direction: column;
}
@page{
    size: "A4";
}

HTML

<html>
  <head>
    <link rel="stylesheet" href="style.css">
  </head>
  <body>
    <div class="head_text">
      <p>
        Head text
      </p>
    </div>
    <div class="bottom_text">
      <p>
        bottom text
      </p>
    </div>
  </body>
</html>

This is the image what I see in the browser:
Image

But in the PDF it becomes like this:
Image

Since I didn't find any working solution other than generating the PDF with the headless browser, my last hope is using the weasyprint.

@liZe
Copy link
Member

liZe commented Jan 16, 2025

Hi!

Thanks for the report, this is unfortunately another bug with WeasyPrint’s flex layout.

WeasyPrint’s flex layout is known to be buggy, a lot of issues are already open. Good news: we’ll work seriously on it really soon. 😄

@liZe liZe added the bug Existing features not working as expected label Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Existing features not working as expected
Projects
None yet
Development

No branches or pull requests

2 participants