I am writing a program using invoice2data which requires me to use Xpdf. I am coding on Windows platform. Though I have installed I get the Error message as pdftotext not installed. Can someone help me with why it does not work? I also changed the path in environment variables. Still does not work.
Below is my code
def to_text(path):
"""
Wrapper around Poppler pdftotext.
"""
if spawn.find_executable("pdftotext"): #shutil.which('pdftotext'):
out, err = subprocess.Popen(
["pdftotext", '-layout', '-enc', 'UTF-8', path, '-'],
stdout=subprocess.PIPE).communicate()
return out
else:
raise EnvironmentError('pdftotext not installed. Can be downloaded from
https://poppler.freedesktop.org/')