参考地址: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.

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-16
  • 2021-12-05
  • 2022-12-23
  • 2022-12-23
  • 2021-08-26
  • 2021-05-19
猜你喜欢
  • 2021-09-04
  • 2022-01-16
  • 2021-06-29
  • 2021-12-09
  • 2022-02-08
相关资源
相似解决方案