Update app.py
Browse files
app.py
CHANGED
|
@@ -269,11 +269,29 @@ def create_pdf(summary_text, original_filename, summary_type):
|
|
| 269 |
|
| 270 |
# 1. Définir des styles de paragraphes personnalisés
|
| 271 |
styles = getSampleStyleSheet()
|
| 272 |
-
|
| 273 |
-
|
| 274 |
-
|
| 275 |
-
|
| 276 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 277 |
|
| 278 |
story = []
|
| 279 |
|
|
|
|
| 269 |
|
| 270 |
# 1. Définir des styles de paragraphes personnalisés
|
| 271 |
styles = getSampleStyleSheet()
|
| 272 |
+
|
| 273 |
+
# Check if styles already exist before adding them
|
| 274 |
+
if 'MainTitle' not in styles:
|
| 275 |
+
styles.add(ParagraphStyle(name='MainTitle', parent=styles['h1'],
|
| 276 |
+
fontSize=18, spaceAfter=16, textColor=black,
|
| 277 |
+
fontName='Helvetica-Bold'))
|
| 278 |
+
|
| 279 |
+
if 'SectionTitle' not in styles:
|
| 280 |
+
styles.add(ParagraphStyle(name='SectionTitle', parent=styles['h2'],
|
| 281 |
+
fontSize=14, spaceAfter=12, textColor=navy,
|
| 282 |
+
fontName='Helvetica-Bold'))
|
| 283 |
+
|
| 284 |
+
if 'SubSectionTitle' not in styles:
|
| 285 |
+
styles.add(ParagraphStyle(name='SubSectionTitle', parent=styles['Normal'],
|
| 286 |
+
spaceAfter=10, fontName='Helvetica-Bold'))
|
| 287 |
+
|
| 288 |
+
if 'BodyText' not in styles:
|
| 289 |
+
styles.add(ParagraphStyle(name='BodyText', parent=styles['Normal'],
|
| 290 |
+
spaceAfter=10, leading=14, alignment=4)) # Justifié
|
| 291 |
+
|
| 292 |
+
if 'ListItem' not in styles:
|
| 293 |
+
styles.add(ParagraphStyle(name='ListItem', parent=styles['Normal'],
|
| 294 |
+
leftIndent=20, spaceAfter=5, leading=14))
|
| 295 |
|
| 296 |
story = []
|
| 297 |
|