我正在尝试使用 .pdf 文件将 PDF 转换为纯文本pdfminer.high_level.extract_text()。我不断收到此错误消息:
File "/Users/ian/Documents/Resume Selector Project/resumeBackend.py", line 5, in digestResume
text = pdfminer.high_level.extract_text
AttributeError: module 'pdfminer' has no attribute 'high_level'
Run Code Online (Sandbox Code Playgroud)
起初,我认为这可能是我的模块未在系统范围内安装的问题,但我相信我已经通过在项目所在的同一目录中运行 pdf2txt.py 消除了这个可能的原因。
我将附上我的代码,以方便解决此问题。
File "/Users/ian/Documents/Resume Selector Project/resumeBackend.py", line 5, in digestResume
text = pdfminer.high_level.extract_text
AttributeError: module 'pdfminer' has no attribute 'high_level'
Run Code Online (Sandbox Code Playgroud) 是否可以从 PDF 文件中提取有关特定字体/字体大小/字体颜色等的文本?我更喜欢 Perl、python 或 *nix 命令行实用程序。我的目标是从 PDF 文件中提取所有标题,这样我就可以在单个 PDF 中获得一个很好的文章索引。