Spaces:
Sleeping
Sleeping
modify pdf layout
Browse files- pdf_convert.py +11 -0
pdf_convert.py
CHANGED
|
@@ -8,9 +8,20 @@ def markdown_to_pdf_weasyprint(md_content, output_pdf="travel_guide.pdf"):
|
|
| 8 |
font-family: 'Noto Color Emoji';
|
| 9 |
src: local('Noto Color Emoji'), url(https://github.com/googlefonts/noto-emoji/blob/main/fonts/NotoColorEmoji.ttf?raw=true) format('truetype');
|
| 10 |
}
|
|
|
|
| 11 |
body {
|
| 12 |
font-family: 'Noto Color Emoji', sans-serif;
|
| 13 |
font-size: 14px;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 14 |
}
|
| 15 |
""")
|
| 16 |
HTML(string=html_content).write_pdf(output_pdf, stylesheets=[css])
|
|
|
|
| 8 |
font-family: 'Noto Color Emoji';
|
| 9 |
src: local('Noto Color Emoji'), url(https://github.com/googlefonts/noto-emoji/blob/main/fonts/NotoColorEmoji.ttf?raw=true) format('truetype');
|
| 10 |
}
|
| 11 |
+
|
| 12 |
body {
|
| 13 |
font-family: 'Noto Color Emoji', sans-serif;
|
| 14 |
font-size: 14px;
|
| 15 |
+
line-height: 1.4; /* Increases margin between lines */
|
| 16 |
+
}
|
| 17 |
+
|
| 18 |
+
li {
|
| 19 |
+
margin-bottom: 7px; /* Adds spacing between list items */
|
| 20 |
+
}
|
| 21 |
+
|
| 22 |
+
li strong {
|
| 23 |
+
font-size: 15px;
|
| 24 |
+
font-weight: bold; /* Makes list titles bold */
|
| 25 |
}
|
| 26 |
""")
|
| 27 |
HTML(string=html_content).write_pdf(output_pdf, stylesheets=[css])
|