The below code works fine for txt file but doesn't work with pdf files.
import textract
text = textract.process(r'C:\Users\Python_files\accounts.txt')
However, I cannot seem to figure out what the problem is in the below code snippet:
import textract
path = r'C:\Users\Python_files\accounts.pdf'
text = textract.process(path)
The above code results in the following error:
ShellError: The command `pdftotext C:\Users\Python_files\accounts.pdf -` failed with exit code 127
------------- stdout -------------
------------- stderr -------------