CSS in the Story is not working properly. #3041
Replies: 2 comments
-
Story does not reproduce HTML tables in exactly the same way as a browser does. For example, you cannot control column widths or the table width. These parameters are ignored. You can still influence column width in some way by using an additional table row that contains cells with "font-size: 0;" and the desired number of In addition, table header row repeat is not supported out of the box. If you need this feature, I strongly recommend you use the reporting feature explained here. Among these examples you will also find an invoice report. Overall, Story supports large subsets of HTML4 and CSS2. Please consult chapter 16 of the book MuPDF Explored for more details. |
Beta Was this translation helpful? Give feedback.
-
Closing this now and moving your post to Discussions in case you want to dwell in one or the other aspect of this. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Description of the bug
I am trying to create a utility to convert the HTML template to PDF using the PyMuPDF library.
Python Code
HTML file
From the above CSS as far as I can see only the colors are being reflected in the generated pdf. No formatting and positioning of the elements is working.
The HTML originally renders like this in browser correctly as shown in the below screenshot.

But Generated PDF looks like this as shown in the below screenshot.

Could you please help me what exactly I am doing wrong?
How to reproduce the bug
Please use the above code to reproduce.
PyMuPDF version
1.23.12
Operating system
Linux
Python version
3.11
Beta Was this translation helpful? Give feedback.
All reactions