Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -381,12 +381,14 @@ def generate_document(task_description, md_content, user_name = 'jayw', bucket_n
|
|
| 381 |
local_filename = f"{truncated_hash}.pdf" # Use the truncated hash as the local file name
|
| 382 |
pdf = FPDF()
|
| 383 |
pdf.add_page()
|
| 384 |
-
|
|
|
|
|
|
|
| 385 |
|
| 386 |
# Process dictionary and render content
|
| 387 |
for key, value in md_content.items():
|
| 388 |
# Add key as a header
|
| 389 |
-
pdf.set_font("
|
| 390 |
pdf.multi_cell(0, 10, f"# {key}")
|
| 391 |
|
| 392 |
# Add value
|
|
|
|
| 381 |
local_filename = f"{truncated_hash}.pdf" # Use the truncated hash as the local file name
|
| 382 |
pdf = FPDF()
|
| 383 |
pdf.add_page()
|
| 384 |
+
# Use a font that supports Unicode
|
| 385 |
+
pdf.add_font('ArialUnicode', '', '/path/to/arial-unicode-ms.ttf', uni=True)
|
| 386 |
+
pdf.set_font("ArialUnicode", size=12)
|
| 387 |
|
| 388 |
# Process dictionary and render content
|
| 389 |
for key, value in md_content.items():
|
| 390 |
# Add key as a header
|
| 391 |
+
pdf.set_font("ArialUnicode", style='B', size=12) # Bold font for headers
|
| 392 |
pdf.multi_cell(0, 10, f"# {key}")
|
| 393 |
|
| 394 |
# Add value
|