Fix: Prevent table overflow in PDF templates - #1
Open
code-sharad wants to merge 1 commit into
Open
code-sharad wants to merge 1 commit into
code-sharad wants to merge 1 commit into
Conversation
Addresses an issue in the Minimal and Classic PDF templates where the products table could unnecessarily move to the next page or break awkwardly.
Modifications:
1. **MinimalInvoicePDF.tsx**: I wrapped the main content sections (including the items table, billing info, summary, and terms) in a parent `<View>`. I applied a `marginBottom: 72` to this wrapper. This reserves space for the fixed footer, improving the PDF rendering engine's page break decisions and preventing content-footer overlap.
2. **ClassicInviocePDF.tsx**: I added the `minPresenceAhead={25}` prop to the main `<View>` component representing the items table. This encourages the renderer to keep at least a small part of the table (approx. one row height) on the current page if it starts rendering there, preventing scenarios where the table header might be orphaned or only a tiny fraction of the table appears before a page break. This template already had a bottom margin for the footer.
These changes ensure that the tables in both templates handle page breaks more gracefully, making better use of available page space and avoiding awkward breaks.
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Addresses an issue in the Minimal and Classic PDF templates where the products table could unnecessarily move to the next page or break awkwardly.
Modifications:
MinimalInvoicePDF.tsx: I wrapped the main content sections (including the items table, billing info, summary, and terms) in a parent
<View>. I applied amarginBottom: 72to this wrapper. This reserves space for the fixed footer, improving the PDF rendering engine's page break decisions and preventing content-footer overlap.ClassicInviocePDF.tsx: I added the
minPresenceAhead={25}prop to the main<View>component representing the items table. This encourages the renderer to keep at least a small part of the table (approx. one row height) on the current page if it starts rendering there, preventing scenarios where the table header might be orphaned or only a tiny fraction of the table appears before a page break. This template already had a bottom margin for the footer.These changes ensure that the tables in both templates handle page breaks more gracefully, making better use of available page space and avoiding awkward breaks.