From 90661e195758d0187853815b531fef397c203757 Mon Sep 17 00:00:00 2001 From: pi-bot-01 Date: Sat, 21 Mar 2026 23:19:07 -0700 Subject: [PATCH] Move all text above image: title, stock/price, SKU/UPC then picture then barcode --- disco.py | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/disco.py b/disco.py index 0ef0365..0de66dd 100644 --- a/disco.py +++ b/disco.py @@ -333,27 +333,33 @@ def generate_catalog_pdf(products: list[dict]) -> Path | None: abs_bc = str(bc_path.resolve()) if bc_path else None latex_lines += [ - # Name — bold, large, above the image + # Name — bold, large r"{\Large\bfseries " + safe_title + r"}", "", + r"\vspace{0.15cm}", + "", + # Stock and price + r"{\large " + safe_stock + r" \hfill " + safe_price + r"}", + "", + r"\vspace{0.1cm}", + "", + # SKU and UPC + r"{\small SKU: \texttt{" + sku + r"} \hfill UPC: \texttt{" + upc + r"}}", + "", r"\vspace{0.3cm}", "", r"\begin{center}", # Product image — large, centered, with border - r"\fbox{\includegraphics[width=0.7\textwidth,height=0.42\textheight,keepaspectratio]{" + r"\fbox{\includegraphics[width=0.7\textwidth,height=0.40\textheight,keepaspectratio]{" + abs_img + r"}}", r"\end{center}", - r"\vspace{0.3cm}", "", - # Stock and price - r"{\large " + safe_stock + r" \hfill " + safe_price + r"}", - "", - r"\vspace{0.5cm}", + r"\vfill", "", ] - # Barcode — centered, bordered + # Barcode — centered, bordered, pushed to bottom if abs_bc: latex_lines += [ r"\begin{center}", @@ -361,17 +367,9 @@ def generate_catalog_pdf(products: list[dict]) -> Path | None: + abs_bc + r"}}", r"\end{center}", - r"\vspace{0.15cm}", "", ] - # SKU and UPC — small text - latex_lines += [ - r"{\small SKU: \texttt{" + sku + r"}}\\", - r"{\small UPC: \texttt{" + upc + r"}}", - "", - ] - # Page break between products (not after last) if i < len(products): latex_lines.append(r"\newpage")