Spaces:
Sleeping
Sleeping
EL GHAFRAOUI AYOUB commited on
Commit ·
98db01d
1
Parent(s): 6ea4d16
Files changed (3)
287 unmodified lines2882892902912922932942952962972982993003013023031 unmodified line305306307308309310311312313287 unmodified linespdf.setFillColorRGB(*BLACK)pdf.rect(20, current_y - nb_box_height, nb_box_width, nb_box_height, stroke=1)# Remove the separate NB: label and directly start with the textpdf.setFont("Helvetica", STANDARD_FONT_SIZE)nb_text = "NB: Toute modification apportée aux plans BA initialement fournis, entraine automatiquement la modification de ce devis."words = nb_text.split()lines = []current_line = []for word in words:current_line.append(word)if pdf.stringWidth(' '.join(current_line), "Helvetica", STANDARD_FONT_SIZE) > nb_box_width - 20:current_line.pop()lines.append(' '.join(current_line))current_line = [word]1 unmodified lineif current_line:lines.append(' '.join(current_line))# Adjust starting position since we removed the separate NB: labelfor i, line in enumerate(lines):pdf.drawString(30, current_y - nb_box_height + 60 - (i * 10), line)# ADD text after the NB boxpdf.setFont("Helvetica-Bold", 9)287 unmodified lines2882892902912922932942952962972982993003013023033043053063071 unmodified line309310311312313314315316317287 unmodified linespdf.setFillColorRGB(*BLACK)pdf.rect(20, current_y - nb_box_height, nb_box_width, nb_box_height, stroke=1)# Split the text into "NB:" and the restpdf.setFont("Helvetica-Bold", STANDARD_FONT_SIZE)pdf.drawString(30, current_y - nb_box_height + 60, "NB:")# Continue with regular font for the rest of the textpdf.setFont("Helvetica", STANDARD_FONT_SIZE)nb_text = "Toute modification apportée aux plans BA initialement fournis, entraine automatiquement la modification de ce devis."words = nb_text.split()lines = []current_line = []for word in words:current_line.append(word)if pdf.stringWidth(' '.join(current_line), "Helvetica", STANDARD_FONT_SIZE) > nb_box_width - 40: # Adjusted width to account for "NB:"current_line.pop()lines.append(' '.join(current_line))current_line = [word]1 unmodified lineif current_line:lines.append(' '.join(current_line))# Draw the text lines after "NB:"for i, line in enumerate(lines):pdf.drawString(55, current_y - nb_box_height + 60 - (i * 10), line) # Adjusted x position to account for "NB:"# ADD text after the NB boxpdf.setFont("Helvetica-Bold", 9)
app/services/__pycache__/invoice_service.cpython-312.pyc
app/services/invoice_service.py+9-5
sql_app.db