Spaces:
Sleeping
Sleeping
Download scripts/save_pdf.py from adityaardak/office: direct link, hf CLI and curl.
- Browser
- Download file 404 Bytes
-
https://huggingface.co/spaces/adityaardak/office/resolve/main/scripts/save_pdf.py
- Command line
-
hf download hf://spaces/adityaardak/office/scripts/save_pdf.py
-
curl -L -o save_pdf.py https://huggingface.co/spaces/adityaardak/office/resolve/main/scripts/save_pdf.py
404 Bytes
| from fpdf import FPDF | |
| def save_minutes_pdf(content, pdf_path): | |
| pdf = FPDF() | |
| pdf.add_page() | |
| # Load the Unicode-compatible font clearly | |
| pdf.add_font("DejaVu", style="", fname="DejaVuSans.ttf", uni=True) | |
| pdf.set_font("DejaVu", size=12) | |
| # Write content clearly with Unicode support | |
| pdf.multi_cell(0, 10, txt=content) | |
| # Save the generated PDF file | |
| pdf.output(pdf_path) | |