Spaces:
Sleeping
Sleeping
Create pdf_report.py
Browse files- pdf_report.py +8 -0
pdf_report.py
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from reportlab.platypus import SimpleDocTemplate, Paragraph
|
| 2 |
+
from reportlab.lib.styles import getSampleStyleSheet
|
| 3 |
+
|
| 4 |
+
def export_pdf(chat):
|
| 5 |
+
doc = SimpleDocTemplate("chat_report.pdf")
|
| 6 |
+
styles = getSampleStyleSheet()
|
| 7 |
+
content = [Paragraph(q, styles["Normal"]) for q in chat]
|
| 8 |
+
doc.build(content)
|