Update pdf_generator.py
Browse files- pdf_generator.py +8 -0
pdf_generator.py
CHANGED
|
@@ -12,6 +12,8 @@ from reportlab.pdfbase import pdfform
|
|
| 12 |
from reportlab.lib.colors import black
|
| 13 |
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
|
| 14 |
from reportlab.lib.enums import TA_CENTER, TA_JUSTIFY
|
|
|
|
|
|
|
| 15 |
import time
|
| 16 |
|
| 17 |
from config import PDF_CONFIG
|
|
@@ -19,6 +21,12 @@ from contract_builder import ContractBuilder
|
|
| 19 |
from utils import create_temp_file, ensure_default_supports
|
| 20 |
|
| 21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
def generate_pdf(contract_type, is_free, author_type, author_info,
|
| 23 |
work_description, image_description, supports,
|
| 24 |
additional_rights, remuneration, is_exclusive):
|
|
|
|
| 12 |
from reportlab.lib.colors import black
|
| 13 |
from reportlab.lib.styles import getSampleStyleSheet, ParagraphStyle
|
| 14 |
from reportlab.lib.enums import TA_CENTER, TA_JUSTIFY
|
| 15 |
+
from reportlab.pdfbase import pdfmetrics
|
| 16 |
+
from reportlab.pdfbase.ttfonts import TTFont
|
| 17 |
import time
|
| 18 |
|
| 19 |
from config import PDF_CONFIG
|
|
|
|
| 21 |
from utils import create_temp_file, ensure_default_supports
|
| 22 |
|
| 23 |
|
| 24 |
+
# Enregistrement des polices pour les caractères accentués
|
| 25 |
+
# Utiliser les polices standard de ReportLab qui supportent les caractères UTF-8
|
| 26 |
+
pdfmetrics.registerFont(TTFont('Helvetica', 'Helvetica.ttf'))
|
| 27 |
+
pdfmetrics.registerFont(TTFont('Helvetica-Bold', 'Helvetica-Bold.ttf'))
|
| 28 |
+
|
| 29 |
+
|
| 30 |
def generate_pdf(contract_type, is_free, author_type, author_info,
|
| 31 |
work_description, image_description, supports,
|
| 32 |
additional_rights, remuneration, is_exclusive):
|