Spaces:
Running
Running
Ilyas KHIAT
commited on
Commit
•
a67b5f8
1
Parent(s):
f9a45b7
pdf export
Browse files- export_doc.py +6 -1
- packages.txt +15 -1
export_doc.py
CHANGED
@@ -138,10 +138,15 @@ def create_pdf_from_markdown(logo_path, conversation,summary,brand_name,graph_ht
|
|
138 |
with open("footer.html", "w",encoding="utf-8") as f:
|
139 |
f.write(footer_html)
|
140 |
|
|
|
141 |
# Convert HTML to PDF with header and footer
|
142 |
pdf = pdfkit.from_file("temp.html", options={
|
|
|
143 |
'footer-right': '[page]/[toPage]',
|
144 |
-
|
|
|
|
|
|
|
145 |
})
|
146 |
return pdf
|
147 |
|
|
|
138 |
with open("footer.html", "w",encoding="utf-8") as f:
|
139 |
f.write(footer_html)
|
140 |
|
141 |
+
|
142 |
# Convert HTML to PDF with header and footer
|
143 |
pdf = pdfkit.from_file("temp.html", options={
|
144 |
+
'footer-html': 'footer.html',
|
145 |
'footer-right': '[page]/[toPage]',
|
146 |
+
'footer-font-size': '10',
|
147 |
+
'footer-spacing': '5',
|
148 |
+
'footer-line': True,
|
149 |
+
'margin-top': '5',
|
150 |
})
|
151 |
return pdf
|
152 |
|
packages.txt
CHANGED
@@ -1,3 +1,17 @@
|
|
1 |
wkhtmltopdf
|
2 |
build-essential
|
3 |
-
libgl1-mesa-dev
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
wkhtmltopdf
|
2 |
build-essential
|
3 |
+
libgl1-mesa-dev
|
4 |
+
xfonts-75dpi
|
5 |
+
xfonts-75dpi
|
6 |
+
xfonts-base
|
7 |
+
gvfs
|
8 |
+
colord
|
9 |
+
glew-utils
|
10 |
+
libvisual-0.4-plugins
|
11 |
+
gstreamer1.0-tools
|
12 |
+
opus-tools
|
13 |
+
qt5-image-formats-plugins
|
14 |
+
qtwayland5
|
15 |
+
qt5-qmltooling-plugins
|
16 |
+
librsvg2-bin
|
17 |
+
lm-sensors
|