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

Incorrect rendering of basic CSS float rules #3416

Open
t-a-r-d opened this issue Mar 14, 2024 · 3 comments
Open

Incorrect rendering of basic CSS float rules #3416

t-a-r-d opened this issue Mar 14, 2024 · 3 comments
Milestone

Comments

@t-a-r-d
Copy link

t-a-r-d commented Mar 14, 2024

It is rendering the html as collapsed in the top left corner. I have made a post on stack overflow containg all the code used in the process.

https://stackoverflow.com/questions/78148574/dompdf-script-to-convert-html-to-pdf-using-dompdf-library

@bsweeney bsweeney added this to the 3.0.1 milestone Mar 14, 2024
@bsweeney
Copy link
Member

This does appear to be the case. I'll need to review in more detail before I can provide any guidance.

@t-a-r-d
Copy link
Author

t-a-r-d commented Mar 14, 2024

Thanks Brian, that's brilliant mate

@bsweeney
Copy link
Member

The prime issue appears to be that Dompdf is having trouble recognizing that there are elements that take space when they're all floats. I was able to sort of work around that issue by using the following styling:

div::after { 
    content: " ";
    clear: both;
}
div::before { 
    content: " ";
    clear: both;
}

but the result still has significant problems.

In the end Dompdf won't be able to handle a document that uses floats this extensively with current levels of support. There are a lot of unresolved float issues, as well as some issues around paged content, that impact this render.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants