-
Notifications
You must be signed in to change notification settings - Fork 614
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
When converting HTML to PDF, background color is not applied #1061
Comments
Please take a look at flyingsaucer: https://github.com/flyingsaucerproject/flyingsaucer |
Pull request are welcome. |
Regarding https://github.com/flyingsaucerproject/flyingsaucer, this is something I've not heard of before. It appears to take XML or XHTML + CSS on input and produce PDF output. However, in my project I need to generate PDF programmatically combining various elements (plain text, tables, images) using database as a the data source, and the HTML needs to be rendered in some particular area on a page (e.g. in a column or in a paragraph, or in a table cell). So I don't think I can use flyingsaucer to do that (to accept a string containing HTML and return PDF elements that I could add to a PDF document). |
I'll try to fix it |
Release is coming |
Describe the bug
When converting HTML to PDF, using
HTMLWorker.parseToList
, background color is not applied. I tried 2 ways of setting the background color - one was produced by CK Editor, the other one I'm not sure, perhaps Word. Maybe there are other ways, I'm not an HTML expert.To Reproduce
Expected behavior
Background color should be properly interpreted and shown approximately the same as the HTML in a browser.
Screenshots
![image](https://private-user-images.githubusercontent.com/120576514/306284928-c6ead467-ae77-401d-8b11-78bbf6516e4e.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxNTAzMDIsIm5iZiI6MTczOTE1MDAwMiwicGF0aCI6Ii8xMjA1NzY1MTQvMzA2Mjg0OTI4LWM2ZWFkNDY3LWFlNzctNDAxZC04YjExLTc4YmJmNjUxNmU0ZS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjEwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxMFQwMTEzMjJaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT0xOGIzYzllYzg3NGE3NTRlMDZlY2YwZTdhNjE1MWEyNjgwOTk5YmU2MmY2NTU5Njg0YWQ2OTU1Y2ZiZjM0YWE1JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.mKUbYQW7DSh2-hbP6gyElcQPWW04osJvGWuShx95pjo)
![image](https://private-user-images.githubusercontent.com/120576514/306285018-47468e3d-8ed6-4546-8907-1686209b53bf.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkxNTAzMDIsIm5iZiI6MTczOTE1MDAwMiwicGF0aCI6Ii8xMjA1NzY1MTQvMzA2Mjg1MDE4LTQ3NDY4ZTNkLThlZDYtNDU0Ni04OTA3LTE2ODYyMDliNTNiZi5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjEwJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxMFQwMTEzMjJaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT04MjQ5MDE4MDQ4Y2I3NTE4MDFkZThkMjhhM2MzMGUyNTA5YzI5NTQyMmFmYmIxNTkxMGYwNjEwNGMwNjE4MDA3JlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.vpnTDKSu7iEbfn9URUX-CHWu2yErRx6lXJXJrpKvRk4)
HTML in browser:
Generated PDF:
System:
The text was updated successfully, but these errors were encountered: