Created
October 17, 2013 12:26
-
-
Save berend/7024015 to your computer and use it in GitHub Desktop.
Small python programm to reproduce https://github.com/Kozea/WeasyPrint/issues/128
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from weasyprint import HTML | |
html_source =""" | |
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<title>Weasy</title> | |
</head> | |
<body> | |
line 1<br> | |
line 2<br /> | |
line3 | |
</body> | |
</html> | |
""" | |
pdf_bytestring = HTML(string=html_source).write_pdf(target=None) | |
with open("/tmp/test.pdf", "w") as write_pdf: | |
write_pdf.write(pdf_bytestring) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment