Skip to content

Fix: Prevent table overflow in PDF templates - #1

Open
code-sharad wants to merge 1 commit into
mainfrom
fix/pdf-table-overflow
Open

code-sharad wants to merge 1 commit into
mainfrom
fix/pdf-table-overflow

Conversation

@code-sharad

Copy link
Copy Markdown
Owner

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.

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.
@vercel

vercel Bot commented May 31, 2025

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
inventory-management ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 31, 2025 7:38pm

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.

1 participant