qqwjq1981 commited on
Commit
360af5d
·
verified ·
1 Parent(s): 55d7cd9

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -2
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
- pdf.set_font("Arial", size=12)
 
 
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("Arial", style='B', size=12) # Bold font for headers
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