79462230

Date: 2025-02-24 00:56:36
Score: 0.5
Natty:
Report link

from reportlab.lib.pagesizes import A4

from reportlab.pdfgen import canvas

from reportlab.lib.colors import HexColor

Définition des couleurs

title_color = HexColor("#785D42")  # Marron doré

text_color = HexColor("#000000")   # Noir

Création du fichier PDF

pdf_output_path = "/mnt/data/carte_remerciement.pdf"

c = canvas.Canvas(pdf_output_path, pagesize=A4)

width, height = A4

Ajout du titre

c.setFont("Helvetica-Bold", 20)

c.setFillColor(title_color)

c.drawCentredString(width / 2, height - 100, "Marhba bikoum")

Texte principal

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"

]

Position du texte

y_position = height - 150

for line in text:

c.drawCentredString(width / 2, y_position, line)

y_position -= 25

Sauvegarde du PDF

c.save()

Retourner le fichier généré

pdf_output_path

Reasons:
  • Long answer (-1):
  • No code block (0.5):
  • Low reputation (1):
Posted by: Meriem Benaissa