Spaces:
Sleeping
Sleeping
| from fpdf import FPDF | |
| import os | |
| class PdfGenerator: | |
| def generate_pdf(self, lm_content: str) -> str: | |
| pdf = FPDF() | |
| pdf.add_page() | |
| pdf.set_font("Arial", size=12) | |
| for line in lm_content.split("\n"): | |
| pdf.cell(200, 10, txt=line, ln=1) | |
| output_path = "generated_lm.pdf" | |
| pdf.output(output_path) | |
| return os.path.abspath(output_path) | |