From bb99809b4fb48d6d00141b23a57f182a6083ea69 Mon Sep 17 00:00:00 2001 From: Sean O'Connor Date: Fri, 1 Aug 2025 03:48:02 -0400 Subject: [PATCH] Fix PDF pagination and logo rendering issues Keep content from breaking across pages and adjust logo display in the invoice footer. Make height calculations more conservative to avoid content overlapping. --- src/lib/pdf-export.tsx | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/lib/pdf-export.tsx b/src/lib/pdf-export.tsx index 0628b1c..5148a89 100644 --- a/src/lib/pdf-export.tsx +++ b/src/lib/pdf-export.tsx @@ -3,6 +3,7 @@ import { Page, Text, View, + Image, StyleSheet, pdf, } from "@react-pdf/renderer"; @@ -388,12 +389,14 @@ const styles = StyleSheet.create({ totalsContainer: { width: 240, + break: false, }, totalsBox: { width: "100%", padding: 12, backgroundColor: "#f9fafb", + break: false, }, totalRow: { @@ -457,7 +460,7 @@ const styles = StyleSheet.create({ footerLogo: { flexDirection: "row", - alignItems: "baseline", + alignItems: "center", gap: 4, }, @@ -589,10 +592,10 @@ function calculateItemsForPage( if (hasNotes) { // Last page needs space for totals and notes - availableHeight -= 100; // Totals + notes space (reduced) + availableHeight -= 200; // Totals + notes space (much more conservative) } else { // Regular page just needs totals space - availableHeight -= 65; // Totals space only (reduced) + availableHeight -= 150; // Totals space only (much more conservative) } // Table header takes space @@ -641,10 +644,10 @@ function calculateItemsPerPage( if (hasNotes) { // Last page needs space for totals and notes - availableHeight -= 100; // Totals + notes space (reduced) + availableHeight -= 200; // Totals + notes space (much more conservative) } else { // Regular page just needs totals space - availableHeight -= 65; // Totals space only (reduced) + availableHeight -= 150; // Totals space only (much more conservative) } // Table header takes space @@ -862,15 +865,14 @@ const NotesSection: React.FC<{ invoice: InvoiceData }> = ({ invoice }) => { const Footer: React.FC = () => ( - - beenvoice - + />