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

Added support for CSS page break properties + bugfixes #1209

Merged
merged 2 commits into from
Jun 18, 2024

Conversation

Lucas-C
Copy link
Member

@Lucas-C Lucas-C commented Jun 17, 2024

This PR also fixes a bug introduced in PR #1207 regarding font_size_pt set in the current graphics state when using .local_context().

Before merging this PR, this bug is visible on the master branch in the following reference files:

I did not see this regression in PR #1207 because I misread the positioning of the PDFs in the HTML page produced by scripts/compare-changed-pdfs.py: in order to avoid this to happen again, I added an explicit legend at the top of the page, explaining what are the PDFs in the left & right columns.

Finally, this PR also fixes automatic page break when an image, inserted through .write_html() without height attribute, does not have enough vertical space to be rendered on a page.

Checklist:

  • The GitHub pipeline is OK (green), meaning that both pylint (static code analyzer) and black (code formatter) are happy with the changes of this PR.

  • A unit test is covering the code added / modified by this PR

  • This PR is ready to be merged

  • In case of a new feature, docstrings have been added, with also some documentation in the docs/ folder

  • A mention of the change is present in CHANGELOG.md

By submitting this pull request, I confirm that my contribution is made under the terms of the GNU LGPL 3.0 license.

@Lucas-C Lucas-C requested a review from gmischler as a code owner June 17, 2024 14:18
@Lucas-C Lucas-C force-pushed the page-break-after-before branch 2 times, most recently from bf013d7 to 00fc1d9 Compare June 17, 2024 14:22
@Lucas-C
Copy link
Member Author

Lucas-C commented Jun 17, 2024

If you want to review this @gmischler & @andersonhc, I'll be happy to have your feedbacks 🙂

Else I'll merge this later this week.

@Lucas-C Lucas-C force-pushed the page-break-after-before branch 7 times, most recently from 9346116 to 7cc0695 Compare June 17, 2024 16:09
@Lucas-C Lucas-C changed the title Added support for CSS page breaks properties Added support for CSS page breaks properties + bugfix Jun 17, 2024
@Lucas-C Lucas-C changed the title Added support for CSS page breaks properties + bugfix Added support for CSS page break properties + bugfix Jun 17, 2024
@Lucas-C Lucas-C force-pushed the page-break-after-before branch 4 times, most recently from c18a26a to 05f02d4 Compare June 17, 2024 18:46
@Lucas-C Lucas-C changed the title Added support for CSS page break properties + bugfix Added support for CSS page break properties + bugfixes Jun 17, 2024
@Lucas-C Lucas-C force-pushed the page-break-after-before branch 2 times, most recently from ee79ee1 to 8d09425 Compare June 17, 2024 20:50
fpdf/html.py Outdated Show resolved Hide resolved
@Lucas-C Lucas-C force-pushed the page-break-after-before branch 2 times, most recently from 0efe4fb to e0a5ec2 Compare June 17, 2024 22:05
@Lucas-C
Copy link
Member Author

Lucas-C commented Jun 18, 2024

@gmischler: would you like to take the time to review this PR more in-depths?

Copy link
Collaborator

@gmischler gmischler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't spot any show-stoppers.

docs/HTML.md Outdated Show resolved Hide resolved
@Lucas-C Lucas-C merged commit ddc72ff into master Jun 18, 2024
12 checks passed
@Lucas-C Lucas-C deleted the page-break-after-before branch June 18, 2024 22:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants