from reportlab.lib.pagesizes import A4
from reportlab.pdfgen import canvas
from reportlab.lib.colors import HexColor
title_color = HexColor("#785D42") # Marron doré
text_color = HexColor("#000000") # Noir
pdf_output_path = "/mnt/data/carte_remerciement.pdf"
c = canvas.Canvas(pdf_output_path, pagesize=A4)
width, height = A4
c.setFont("Helvetica-Bold", 20)
c.setFillColor(title_color)
c.drawCentredString(width / 2, height - 100, "Marhba bikoum")
c.setFont("Helvetica", 14)
c.setFillColor(text_color)
text = [
"La pièce embaumée par l'odeur du henné,",
"le cœur bercé par les chants traditionnels",
"",
"Les yeux inondés par l'émotion",
"et vous auprès de moi pour célébrer ce moment",
"",
"Merci de votre présence",
"",
"Meriem",
"mercredi 23 avril 2025"
]
y_position = height - 150
for line in text:
c.drawCentredString(width / 2, y_position, line)
y_position -= 25
c.save()
pdf_output_path