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.
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.
Well thanks for answering
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.
In Python 2 mode, the
xhtml2pdfmodule is already included.
@omz but is there same package for Python 3 mode?