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

#1061 When converting HTML to PDF, background color is not applied #1075

Conversation

RadekWikturna
Copy link
Contributor

Description of the new Feature/Bugfix

Added support for background color specified in the CCS "style" attribute.

I have made a few changes in FactoryProperties - I've added support for "background" and "background-color" and simplified the code for "color" (this change is also covered by a test).

I've renamed the test FontSizeTest to StylesTest and refactored it to eliminate code duplicity. The source HTML is now stored in resources as files, which is easier to extend it and also makes it possible to view it in a browser and then compare it with generated PDF.

Related Issue: #1061

Unit-Tests for the new Feature/Bugfix

  • Unit-Tests added to reproduce the bug

Compatibilities Issues

None

Testing details

Run the StylesTest.testBackgroundColor. See also the generated 'Background Color.pdf'

@RadekWikturna
Copy link
Contributor Author

The pull request if for the 1.3-java8 branch because right now we need to use Java 8. But eventually, the same fix should go to the main branch.

Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@asturio asturio merged commit c574e18 into LibrePDF:1.3-java8 Feb 23, 2024
3 checks passed
@asturio asturio linked an issue Feb 23, 2024 that may be closed by this pull request
@asturio asturio self-requested a review February 23, 2024 17:01
@asturio asturio self-assigned this Feb 23, 2024
asturio pushed a commit that referenced this pull request Feb 23, 2024
…1075)

* #1061 When converting HTML to PDF, background color is not applied

---------

Co-authored-by: Radek Wikturna <radek.wikturna@usu.com>
asturio pushed a commit that referenced this pull request Feb 23, 2024
…1075)

* #1061 When converting HTML to PDF, background color is not applied

---------

Co-authored-by: Radek Wikturna <radek.wikturna@usu.com>
@RadekWikturna RadekWikturna deleted the #1061_When_converting_HTML_to_PDF,_background_color_is_not_applied_1.3 branch February 26, 2024 07:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

When converting HTML to PDF, background color is not applied
2 participants