Corina Roca
Corina Roca

Reputation: 546

Observed error while installing PDFMiner for Python2.7

I followed the instruction from here: file:///home/bioinfo/Descargas/pdfminer3k-1.3.0/docs/index.html

after download pdfminer3k-1.3.0 I did:

python setup.py install

But when I do

pdf2txt.py samples/simple1.pdf

And it doesn't read the pdf, the path is ok. It give me back the error:

>

Traceback (most recent call last):
  File "/usr/local/bin/pdf2txt.py", line 5, in <module>
    pkg_resources.run_script('pdfminer3k==1.3.0', 'pdf2txt.py')
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 528, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 1394, in run_script
    execfile(script_filename, namespace, namespace)
  File "/usr/local/lib/python2.7/dist-packages/pdfminer3k-1.3.0-py2.7.egg/EGG-INFO/scripts/pdf2txt.py", line 6, in <module>
    from pdfminer.pdfinterp import PDFResourceManager, process_pdf
  File "/usr/local/lib/python2.7/dist-packages/pdfminer3k-1.3.0-py2.7.egg/pdfminer/pdfinterp.py", line 5, in <module>
    from .cmapdb import CMapDB, CMap
  File "/usr/local/lib/python2.7/dist-packages/pdfminer3k-1.3.0-py2.7.egg/pdfminer/cmapdb.py", line 23, in <module>
    from .psparser import PSStackParser
  File "/usr/local/lib/python2.7/dist-packages/pdfminer3k-1.3.0-py2.7.egg/pdfminer/psparser.py", line 4, in <module>
    from .utils import choplist
  File "/usr/local/lib/python2.7/dist-packages/pdfminer3k-1.3.0-py2.7.egg/pdfminer/utils.py", line 212, in <module>
    0x00f8, 0x00f9, 0x00fa, 0x00fb, 0x00fc, 0x00fd, 0x00fe, 0x00ff,
  File "/usr/local/lib/python2.7/dist-packages/pdfminer3k-1.3.0-py2.7.egg/pdfminer/utils.py", line 180, in <genexpr>
    PDFDocEncoding = ''.join( chr(x) for x in (
ValueError: chr() arg not in range(256)

Is it any solution?

Upvotes: 3

Views: 2145

Answers (1)

Carlos Perez
Carlos Perez

Reputation: 116

The latest code (version 20140328) uses unichr(). Try this instead:

pip install pdfminer==20140328

Or download from https://pypi.python.org/pypi/pdfminer/20140328.

Upvotes: 10

Related Questions