Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -84,7 +84,8 @@ def create_pdf_report(analysis):
|
|
84 |
pdf.cell(200, 10, txt="PDF Analysis Report", ln=True, align='C')
|
85 |
pdf.cell(200, 10, txt=f"Generated on: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}", ln=True, align='C')
|
86 |
pdf.multi_cell(0, 10, txt=json_to_text(analysis))
|
87 |
-
|
|
|
88 |
|
89 |
def create_word_report(analysis):
|
90 |
doc = Document()
|
|
|
84 |
pdf.cell(200, 10, txt="PDF Analysis Report", ln=True, align='C')
|
85 |
pdf.cell(200, 10, txt=f"Generated on: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}", ln=True, align='C')
|
86 |
pdf.multi_cell(0, 10, txt=json_to_text(analysis))
|
87 |
+
pdf_output = pdf.output(dest='S')
|
88 |
+
return pdf_output.encode('latin-1') if isinstance(pdf_output, str) else pdf_output
|
89 |
|
90 |
def create_word_report(analysis):
|
91 |
doc = Document()
|