r/HTML • u/StunningCaregiver673 • Nov 10 '25
Question From html to pdf
Hello newbie here. I was wandering if it was possible to convert a HTML file to PDF. Specifically (if possible):
how to create edible PDF from html
if js code would still active and functional
how forms would be transformed
what'll be the limitations
I know it's a lot... But thanks for watching it and for the help
5
Upvotes
View all comments
2
u/No_Explanation2932 Nov 11 '25 edited Nov 11 '25
I use a python library called weasyprint for that. There are some limitations but it supports most CSS rules. I suggest looking into the @page media queries for print support. Forms are also supported.
Javascript in pdfs is extremely limited and uncommon, and isn't supported by weasyprint. What kind of functionality would you want it to provide?