Shivamsinghtomar78 commited on
Commit
0287e6d
·
verified ·
1 Parent(s): 8e37b2e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
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
- return bytes(pdf.output(dest='S').encode('latin-1'))
 
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()