Spaces:
Sleeping
Sleeping
Create save_pdf.py
Browse files- scripts/save_pdf.py +15 -0
scripts/save_pdf.py
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from fpdf import FPDF
|
| 2 |
+
|
| 3 |
+
def save_minutes_pdf(content, pdf_path):
|
| 4 |
+
pdf = FPDF()
|
| 5 |
+
pdf.add_page()
|
| 6 |
+
|
| 7 |
+
# Load the Unicode-compatible font clearly
|
| 8 |
+
pdf.add_font("DejaVu", style="", fname="DejaVuSans.ttf", uni=True)
|
| 9 |
+
pdf.set_font("DejaVu", size=12)
|
| 10 |
+
|
| 11 |
+
# Write content clearly with Unicode support
|
| 12 |
+
pdf.multi_cell(0, 10, txt=content)
|
| 13 |
+
|
| 14 |
+
# Save the generated PDF file
|
| 15 |
+
pdf.output(pdf_path)
|