Co-authored-by: renee-png <262607627+renee-png@users.noreply.github.com>
This commit is contained in:
gpt-engineer-app[bot]
2026-04-19 20:30:59 +00:00
co-authored by renee-png
parent b00a41269b
commit 73b48c1b08
+6 -1
View File
@@ -400,7 +400,12 @@ export async function downloadInvoicePdf(input: InvoicePdfInput, filename: strin
const drawItem = (item: InvoiceLineItem) => {
const isNonBillable = item.billable === false;
const descMaxW = colQtyR - colDescX - 14;
// Reserve generous padding before the QTY column so wrapped text never
// collides with the right-aligned numeric columns. Measure with the same
// font (incl. italic for non-billable rows) that will render the text,
// since italic glyphs are slightly wider than upright ones.
const descMaxW = colQtyR - colDescX - 24;
setFont(pdf, { size: 9, color: isNonBillable ? MUTED : TEXT, italic: isNonBillable });
const descLines = wrap(pdf, item.description || (item.kind === "expense" ? "Expense" : ""), descMaxW);
const lineHeight = 12;
const blockH = Math.max(lineHeight * descLines.length + 14, item.user_initials ? 32 : 26);