From b95df7ff3086d7b841710fc044cd46c269b525e9 Mon Sep 17 00:00:00 2001 From: "Colin B. Macdonald" Date: Fri, 9 Sep 2022 16:13:20 -0700 Subject: [PATCH] Specify width and color for stamp box Width alone does not change width [1], although from looking at our other code it looks like we were already aware of this. [1] https://github.com/pymupdf/PyMuPDF/issues/1913 --- plom/create/mergeAndCodePages.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plom/create/mergeAndCodePages.py b/plom/create/mergeAndCodePages.py index 20557c14d..b58aee7ea 100644 --- a/plom/create/mergeAndCodePages.py +++ b/plom/create/mergeAndCodePages.py @@ -189,7 +189,7 @@ def pdf_page_add_labels_QRs(page, shortname, stamp, qr_code, odd=True): r = fitz.Rect( pg_width // 2 - r.width / 2, my, pg_width // 2 + r.width / 2, my + r.height ) - page.draw_rect(r) + page.draw_rect(r, color=(0, 0, 0), width=0.5) tw.write_text(page) # special code to skip staple mark and QR codes @@ -205,7 +205,7 @@ def pdf_page_add_labels_QRs(page, shortname, stamp, qr_code, odd=True): shape.draw_line(rDNW.top_right, rDNW.bottom_left) else: shape.draw_line(rDNW.top_right, rDNW.bottom_right) - shape.finish(width=0.5, color=[0, 0, 0], fill=[0.75, 0.75, 0.75]) + shape.finish(width=0.5, color=(0, 0, 0), fill=(0.75, 0.75, 0.75)) shape.commit() tw = fitz.TextWriter(page.rect)