开发者

python converter libraries for DOC, DOCX and PDF [duplicate]

开发者 https://www.devze.com 2023-03-23 07:11 出处:网络
This question already has answers here: Closed 11 years ago. Possible Duplicate: solution to convert PDFs, DOCs, DOCXs into a textual format with python
This question already has answers here: Closed 11 years ago.

Possible Duplicate:

solution to convert PDFs, DOCs, DOCXs into a textual format with python

I am making a document search engine which indexes popular binary formats. I am looking for python libraries for this purpose.

Reliable converters proved too hard to find. PyPDF never works accurately. Please reccomend:

  • python libraries that convert these formats to text
  • or cross-platform, standalone prog开发者_如何学Crams that can be called as a subprocess


  • You can sort of read .docx by unzipping it and then rootling around in the resulting folder structure. See How can I search a word in a Word 2007 .docx file?.
  • If pyPDF isn't working for you, you can use pdftotext as a subprocess.
  • .doc is probably the hardest. Is COM scripting an option for you? That is, asking Word to open the file and export it as text? There's a linux utility extracting text from MS word files in python.


You might try Open Office.

It's converting skills are above average. For editing PDF documents, you need to install the pdf import extension.

There are some extensions to work with python, such as the python-uno bridge, but I've had difficulty with it, and generally resort to calling open office as a subprocess.

Just noticed you opened a duplicate question at: solution to convert PDFs, DOCs, DOCXs into a textual format with python...

0

精彩评论

暂无评论...
验证码 换一张
取 消