So, it's about, for example, this link, to sheet music: https://thesession.org/tunes/12124/12124?print=true It is a special print page. Now, since at least firefox automatically has the option to download as PDF, I wonder if this could be done automatically with python. If it were possible, then I could embed it into my GUI, and have an app for showing sheet music. Is there a way to do it? Or an alternative way to convert the HTML to PDF?
Asked
Active
Viewed 152 times
0
-
1Does this answer your question ? https://stackoverflow.com/questions/23359083/how-to-convert-webpage-into-pdf-by-using-python – ScottC Dec 15 '22 at 01:36
-
Thanks! First I thought it didnt work, but I now found it does work, I made a mistake with installing it – Willem van Houten Dec 15 '22 at 17:14
1 Answers
0
Ok, I found the answer, thanksto ScottC his reference to another questoin:
Usage
import pdfkit
pdfkit.from_url('http://google.com', 'out.pdf')
Install
MacOS: brew install Caskroom/cask/wkhtmltopdf
Debian/Ubuntu: apt-get install wkhtmltopdf
Windows: choco install wkhtmltopdf
See official documentation for MacOS/Ubuntu/other OS: https://github.com/JazzCore/python-pdfkit/wiki/Installing-wkhtmltopdf

Willem van Houten
- 174
- 1
- 9