Spaces:
Runtime error
Runtime error
Commit
·
f839d59
1
Parent(s):
95f81ff
Update app.py
Browse files
app.py
CHANGED
@@ -49,14 +49,15 @@ def process_text(inputs):
|
|
49 |
|
50 |
|
51 |
|
52 |
-
import
|
53 |
-
from
|
54 |
-
from
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
|
|
60 |
|
61 |
# convert HTML to PDF
|
62 |
pdf_file = BytesIO()
|
|
|
49 |
|
50 |
|
51 |
|
52 |
+
import base64
|
53 |
+
from io import BytesIO
|
54 |
+
from weasyprint import HTML
|
55 |
+
from streamlit_quill import Delta, Renderer
|
56 |
+
|
57 |
+
def save_as_pdf(text):
|
58 |
+
# convert quill editor Delta object to HTML and render with Renderer
|
59 |
+
delta = Delta(text)
|
60 |
+
html = Renderer().render(delta)
|
61 |
|
62 |
# convert HTML to PDF
|
63 |
pdf_file = BytesIO()
|