pdftotext also need short names
This commit is contained in:
parent
5dead44107
commit
24d4c4dc70
1 changed files with 2 additions and 0 deletions
|
@ -226,6 +226,8 @@ def extract_text(pdf):
|
||||||
if sys.platform == 'darwin':
|
if sys.platform == 'darwin':
|
||||||
cmd = ['/usr/bin/mdimport', '-d2', pdf]
|
cmd = ['/usr/bin/mdimport', '-d2', pdf]
|
||||||
else:
|
else:
|
||||||
|
if sys.platform == 'win32':
|
||||||
|
pdf = get_short_path_name(pdf)
|
||||||
cmd = ['pdftotext', pdf, '-']
|
cmd = ['pdftotext', pdf, '-']
|
||||||
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||||
stdout, stderr = p.communicate()
|
stdout, stderr = p.communicate()
|
||||||
|
|
Loading…
Reference in a new issue