pdfplumber库解析pdf格式


参考地址:https://github.com/jsvine/pdfplumber

简单的pdf转换文本:

import pdfplumber

 

with pdfplumber.open(path) as pdf:

  for page in pdf.pages:

    content = page.extract_text()

    print(content)

注意:只能转换pdf文本格式,如果pdf文件中是图片则返回None。

 

将pdf转换成图片,错误

the first is ImageMagick(32bit or 64bit) must be accord with the python(32bit or 64bit), even in the 64bit OS. If not, there will be a ImageMagick not installed mistake.
The second is that it need the ghostscript otherwise ImageMagick wouldn’t work properly.


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM