uj_jonas last edited by uj_jonas
I wanted to convert HTML to PDF and looked it on Google. I found the pdfkit docs, but when I tried using it
import pdfkit pdfkit.from_url('https://google.com', sys.argv[:-7] + 'out.pdf')
I got a PermissionError
My guess is it's just iOS restricting me, but I'd like to know if I'm doing something wrong.
dgelessus last edited by
It seems that
pdfkituses a separately installed command-line tool to do the actual conversion. iOS doesn't allow apps to start other processes, which is why you get a PermissionError. And even if you could, the necessary program wouldn't be installed.
uj_jonas last edited by
Well thanks for answering
Phuket2 last edited by
abcabc last edited by abcabc
You can use reportlab module (no need to install, already included) to create pdf files. May be you can look at this tutorial to create simple pdf documents.
For converting html to pdf , you may install xhtml2pdf package.
omz last edited by
In Python 2 mode, the
xhtml2pdfmodule is already included.
Yaroslav_Ya last edited by
@omz but is there same package for Python 3 mode?