From 5a787ab2c591bdf48397246cd42f56e9d9fafd8a Mon Sep 17 00:00:00 2001 From: "Timothy J. Baek" Date: Sat, 6 Apr 2024 02:04:28 -0700 Subject: [PATCH] refac: pdf styling --- backend/apps/web/routers/utils.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/apps/web/routers/utils.py b/backend/apps/web/routers/utils.py index 4f6cdfc..0ee75cf 100644 --- a/backend/apps/web/routers/utils.py +++ b/backend/apps/web/routers/utils.py @@ -71,13 +71,13 @@ async def download_chat_as_pdf( for message in form_data.messages: role = message["role"] content = message["content"] - pdf.set_font("NotoSans", "B", size=12) # Bold for the role + pdf.set_font("NotoSans", "B", size=14) # Bold for the role pdf.multi_cell(effective_page_width, 10, f"{role.upper()}", 0, "L") pdf.ln(1) # Extra space between messages pdf.set_font("NotoSans", size=10) # Regular for content - pdf.multi_cell(effective_page_width, 10, content, 0, "L") - pdf.ln(1) # Extra space between messages + pdf.multi_cell(effective_page_width, 6, content, 0, "L") + pdf.ln(1.5) # Extra space between messages # Save the pdf with name .pdf pdf_bytes = pdf.output()