-
-
Notifications
You must be signed in to change notification settings - Fork 693
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
Long rendering times when grid items span #2336
Comments
Hi!
Then you could probably benefit from our professional support. 😄
Removing
You’re welcome. ❤ |
The problem comes from: WeasyPrint/weasyprint/layout/grid.py Lines 270 to 271 in 603d87c
Calling The overall |
That’s actually extremely long because you use A possible workaround is to use (I’ve also found a typo, and fixing it makes the grid layout go… even slower 😒. Note that the problem only happens when cells span, ie. when they take multiple rows or columns.) (And it looks like
There’s a short list of best practices in the documentation, we could add grid and flex layouts to tables in the list of possibly long renderings. |
Hi team, I was wondering if there are some best practices/recommendations that one should keep in mind to while generating large PDF documents to optimize the generation time? I have gone through the documentation and couldn't find anything related.
In our app we generate HTML reports which sometimes result in upto 100MB+ of html files. Now few of the users are asking for report in PDF format. Since we already have system in place to generate HTML reports, we thought of using WeasyPrint to convert these HTMLs to PDFs.
I tried converting 1 HTML to PDF using WeasyPrint, but it is taking too long to generate PDF. It took around 40 minutes for converting a 50MB HTML to PDF and this generation time shoots upto 2.25 Hours for a 100MB HTML.
I tried using it via command line, like this
So I'll really appreciate if some one can guide me to some sort of checklist/best practice like keeping DOM tree to certain limit or any specific CSS properties to use or not use, or anything in general which can help reducing the PDF generation time.
By the way our HTML and CSS structure is pretty basic (using CSS Grid though). Here is a sample of the html/css code.
Aside form the questions, thanks a lot for the great tool. ❤
The text was updated successfully, but these errors were encountered: