Getting error as below
Traceback (most recent call last):
File "input", line 2, in
File "C:\Users\John.ignition\cache\gwlocalhost_8088\C0\pylib\pdfkit\api.py", line 24, in from_url
r = PDFKit(url, 'url', options=options, toc=toc, cover=cover,
File "C:\Users\John.ignition\cache\gwlocalhost_8088\C0\pylib\pdfkit\pdfkit.py", line 45, in init
self.configuration = (Configuration() if configuration is None
File "C:\Users\John.ignition\cache\gwlocalhost_8088\C0\pylib\pdfkit\configuration.py", line 28, in init
self.wkhtmltopdf = subprocess.Popen(
File "C:\Users\John.ignition\cache\gwlocalhost_8088\C0\pylib\pdfkit\configuration.py", line 28, in init
self.wkhtmltopdf = subprocess.Popen(
File "C:\Users\John.ignition\cache\gwlocalhost_8088\C0\pylib\subprocess.py", line 859, in init
self._execute_child(args, executable, preexec_fn, close_fds,
File "C:\Users\John.ignition\cache\gwlocalhost_8088\C0\pylib\subprocess.py", line 1369, in _execute_child
raise OSError(errno.ENOENT, os.strerror(errno.ENOENT))
OSError: [Errno 2] No such file or directory.
Any other python library that can be used to convert html to pdf? Please suggest
I have to use 3rd party pdfkit ( pdfkit · PyPI) python library to use in ignition (For vision project).
I have copied the library to the C:\Program Files\Inductive Automation\Ignition\user-lib\pylib folder.
For what it's worth, I use pdfkit in Ignition all the time (I'm on v0.6.1 of pdfkit though, so take this with a grain of salt if you're using 1.0.0). It doesn't use any other libraries, but it does depend on having wkhtmltopdf installed somewhere on your system (that's why the call to subprocess) and that's why you're getting the error; you have to properly supply the path to wkhtmltopdf in the config structure of pdfkit. Once you get it configured properly, it works just fine (although there are some limitations to wkhtmltopdf that are not really pdfkit's fault).
We only really use it on Windows clients, so YMMV if you are trying to do this on Mac/Linux. I have spent only a few minutes attempting to get it to work on Mac (I have one Mac user), and I ran into some sandboxing issues and gave up, since it's not a super-critical feature for that user.