Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions pdfkit/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,15 @@ def __init__(self, wkhtmltopdf='', meta_tag_prefix='pdfkit-', environ=''):
self.wkhtmltopdf = subprocess.Popen(
['where.exe', 'wkhtmltopdf'], stdout=subprocess.PIPE, startupinfo=startupinfo).communicate()[0]
else:
try:
subprocess.Popen(
['which'], stdout=subprocess.PIPE).communicate()[0]
except (IOError, FileNotFoundError) as e:
raise IOError('No which executable found. '
'If this file exists please check that this process can '
'read it or you can pass path to it manually in method call, '
'check README. Otherwise please install which - '
'https://github.com/JazzCore/python-pdfkit/wiki/Installing-which')
self.wkhtmltopdf = subprocess.Popen(
['which', 'wkhtmltopdf'], stdout=subprocess.PIPE).communicate()[0]

Expand Down