我按照这里的指示: 文件:///home/bioinfo/Descargas/pdfminer3k-1.3.0/docs/index.html
下载pdfminer3k-1.3.0之后我做了:
python setup.py install
但是当我做的时候
pdf2txt.py samples / simple1.pdf
如果它没有读取pdf,路径就可以了。 它给了我错误的答案:
> Traceback(最近一次调用最后一次): 文件" /usr/local/bin/pdf2txt.py",第5行,在 pkg_resources.run_script(' pdfminer3k == 1.3.0',' pdf2txt.py') 文件" /usr/lib/python2.7/dist-packages/pkg_resources.py",第528行,在run_script中 self.require(requires)[0] .run_script(script_name,ns) 文件" /usr/lib/python2.7/dist-packages/pkg_resources.py",第1394行,在run_script中 execfile(script_filename,namespace,namespace) 文件" /usr/local/lib/python2.7/dist-packages/pdfminer3k-1.3.0-py2.7.egg/EGG-INFO/scripts/pdf2txt.py" ;,第6行,in 来自pdfminer.pdfinterp导入PDFResourceManager,process_pdf 文件" /usr/local/lib/python2.7/dist-packages/pdfminer3k-1.3.0-py2.7.egg/pdfminer/pdfinterp.py" ;,第5行,in 来自.cmapdb导入CMapDB,CMap 文件" /usr/local/lib/python2.7/dist-packages/pdfminer3k-1.3.0-py2.7.egg/pdfminer/cmapdb.py" ;,第23行,在 来自.psparser导入PSStackParser 文件" /usr/local/lib/python2.7/dist-packages/pdfminer3k-1.3.0-py2.7.egg/pdfminer/psparser.py" ;,第4行,在 来自.utils import choplist 文件" /usr/local/lib/python2.7/dist-packages/pdfminer3k-1.3.0-py2.7.egg/pdfminer/utils.py" ;,第212行, 0x00f8,0x00f9,0x00fa,0x00fb,0x00fc,0x00fd,0x00fe,0x00ff, 文件" /usr/local/lib/python2.7/dist-packages/pdfminer3k-1.3.0-py2.7.egg/pdfminer/utils.py" ;,第180行,在 PDFDocEncoding ='' .join(x的chr(x)in( ValueError:chr()arg不在范围(256)
中有任何解决方案吗?
答案 0 :(得分:2)
最新代码(版本20140328)使用unichr()
。试试这个:
pip install pdfminer==20140328