Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -177,8 +177,17 @@ def create_pdf_from_markdown_strings(markdown_strings):
|
|
| 177 |
return combined_html
|
| 178 |
|
| 179 |
def generate_pdf(html_string):
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 180 |
pdf = BytesIO()
|
| 181 |
-
HTML(string=html_string).write_pdf(pdf)
|
| 182 |
pdf.seek(0)
|
| 183 |
return pdf
|
| 184 |
|
|
|
|
| 177 |
return combined_html
|
| 178 |
|
| 179 |
def generate_pdf(html_string):
|
| 180 |
+
css = """
|
| 181 |
+
@page {
|
| 182 |
+
size: A4 landscape;
|
| 183 |
+
margin: 20cm;
|
| 184 |
+
}
|
| 185 |
+
body {
|
| 186 |
+
font-family: sans-serif;
|
| 187 |
+
}
|
| 188 |
+
"""
|
| 189 |
pdf = BytesIO()
|
| 190 |
+
HTML(string=html_string).write_pdf(pdf, stylesheets=[CSS(string=css)])
|
| 191 |
pdf.seek(0)
|
| 192 |
return pdf
|
| 193 |
|