Created
October 17, 2021 11:52
-
-
Save zelitomas/50aa47d4966e1b743588a284e12cf599 to your computer and use it in GitHub Desktop.
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 | |
document = HTML(filename="./index.html").render() | |
duplicated_pages = document.copy(document.pages * 2) | |
duplicated_pages.write_pdf("result.pdf") |
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
<style> | |
html, body { | |
background-color: #ffeecc; | |
color: #0013ff; | |
font-family: "Neue Machina"; | |
padding: 0; | |
margin: 0; | |
} | |
@page { | |
size: 64mm 37mm; | |
margin: 0; | |
} | |
#paper { | |
position: relative; | |
width: 64mm; | |
height: 37mm; | |
background-color: white; | |
border-radius: 2mm; | |
} | |
</style> | |
<div id="paper"> | |
This should be printed twice, but is not. | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment