deanmalmgren/textract — pull request #21 by deanmalmgren (2014-08-05 16:21:25+00:00)
Title: pdftotext isn't included on non-linux OSes

Extracting PDFs doesn't work on windows, because windows doesn't come with pdftotext:

```python
In [3]: textract.process("example.pdf")
---------------------------------------------------------------------------
ShellError Traceback (most recent call last)
in ()
----> 1 textract.process("example.pdf")

c:\python27\lib\site-packages\textract\parsers\__init__.pyc in process(filename, **kwargs)
24 raise exceptions.ExtensionNotSupported(ext)
25
---> 26 return filetype_module.extract(filename, **kwargs)

c:\python27\lib\site-packages\textract\parsers\pdf.pyc in extract(filename, method, **kwargs)
8 method = method or 'pdftotext'
9 if method == 'pdftotext':
---> 10 return extract_pdftotext(filename)
11 elif method == 'pdfminer':
12 return extract_pdfminer(filename)

c:\python27\lib\site-packages\textract\parsers\pdf.pyc in extract_pdftotext(filename)
17 def extract_pdftotext(filename):
18 """Extract text from pdfs using the pdftotext command line utility."""
---> 19 pipe = run('pdftotext %(filename)s -' % locals())
20 return pipe.stdout.read()
21

c:\python27\lib\site-packages\textract\shell.pyc in run(command)
16 # if pipe is busted, raise an error (unlike Fabric)
17 if pipe.returncode != 0:
---> 18 raise exceptions.ShellError(pipe.returncode)
19
20 return pipe

ShellError: Command failed with exit code 1
```

```python
In [4]: import pdftotext
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
in ()
----> 1 import pdftotext

ImportError: No module named pdftotext
```

Maybe require pdftotext or xpdf support? http://en.wikipedia.org/wiki/Pdftotext