You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/Library/Python/2.7/site-packages/pdfkit/pdfkit.pyc in to_pdf(self, path)
91
92 result = subprocess.Popen(args, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
---> 93 stderr=subprocess.PIPE)
94
95 # If the source is a string then we will pipe it into wkhtmltopdf.
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.pyc in init(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags)
707 p2cread, p2cwrite,
708 c2pread, c2pwrite,
--> 709 errread, errwrite)
710 except Exception:
711 # Preserve original exception in case os.close raises.
It is probably because that pdfkit tried to pipe the long list of file paths as arguments to wkhtmltopdf. This apparently broke the pipe.
I wonder if there is a file-list file option is available for wkhtmltopdf, so that it accept a single file-list file that contains a list of input html file paths.
The text was updated successfully, but these errors were encountered:
I'm on Mac OS X 10.10.3 with py2.7.6.
I have a folder of 3,000+ html files and pdfkit failed when I run:
pdfkit.from_file(myHtmls, 'out.pdf')
the traceback:
OSError Traceback (most recent call last)
in ()
----> 1 pdfkit.from_file(htmls, '/Users/kakyo/Desktop/out.pdf')
/Library/Python/2.7/site-packages/pdfkit/api.pyc in from_file(input, output_path, options, toc, cover, css, configuration)
44 configuration=configuration)
45
---> 46 return r.to_pdf(output_path)
47
48
/Library/Python/2.7/site-packages/pdfkit/pdfkit.pyc in to_pdf(self, path)
91
92 result = subprocess.Popen(args, stdin=subprocess.PIPE, stdout=subprocess.PIPE,
---> 93 stderr=subprocess.PIPE)
94
95 # If the source is a string then we will pipe it into wkhtmltopdf.
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.pyc in init(self, args, bufsize, executable, stdin, stdout, stderr, preexec_fn, close_fds, shell, cwd, env, universal_newlines, startupinfo, creationflags)
707 p2cread, p2cwrite,
708 c2pread, c2pwrite,
--> 709 errread, errwrite)
710 except Exception:
711 # Preserve original exception in case os.close raises.
/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.pyc in _execute_child(self, args, executable, preexec_fn, close_fds, cwd, env, universal_newlines, startupinfo, creationflags, shell, to_close, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite)
1324 raise
1325 child_exception = pickle.loads(data)
-> 1326 raise child_exception
1327
1328
OSError: [Errno 7] Argument list too long
It is probably because that pdfkit tried to pipe the long list of file paths as arguments to wkhtmltopdf. This apparently broke the pipe.
I wonder if there is a file-list file option is available for wkhtmltopdf, so that it accept a single file-list file that contains a list of input html file paths.
The text was updated successfully, but these errors were encountered: