Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
pdfkit PermissionError
-
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[0][:-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
pdfkit
uses 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. -
Aww :/
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.
http://www.blog.pythonlibrary.org/2010/03/08/a-simple-step-by-step-reportlab-tutorial/
For converting html to pdf , you may install xhtml2pdf package.
-
In Python 2 mode, the
xhtml2pdf
module is already included. -
@omz but is there same package for Python 3 mode?