用于将 PDF 转换为文本的 Python 模块 [英] Python module for converting PDF to text

查看:23
本文介绍了用于将 PDF 转换为文本的 Python 模块的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何python模块可以将PDF文件转换为文本?我尝试了 一段代码在使用 pypdf 的 Activestate 中找到,但生成的文本之间没有空格并没有用.

Is there any python module to convert PDF files into text? I tried one piece of code found in Activestate which uses pypdf but the text generated had no space between and was of no use.

推荐答案

尝试 PDFMiner.它可以从 PDF 文件中提取 HTML、SGML 或标记 PDF"格式的文本.

Try PDFMiner. It can extract text from PDF files as HTML, SGML or "Tagged PDF" format.

Tagged PDF 格式似乎是最干净的,去掉 XML 标签只留下裸文本.

The Tagged PDF format seems to be the cleanest, and stripping out the XML tags leaves just the bare text.

Python 3 版本位于:

A Python 3 version is available under:

这篇关于用于将 PDF 转换为文本的 Python 模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆