我正在尝试将一个多页的.pdf文件转换为几个单独的.png文件。我正在使用pdf2Image来完成这项工作。我已使用brew安装poppler安装了poppler。我不确定如何在shell中查找并显式写入路径。这是我的代码:
from pdf2image import convert_from_path
from pdf2image.exceptions import (
PDFInfoNotInstalledError,
PDFPageCountError,
PDFSyntaxError
)
images = convert_from_path('Bliss.pdf')
for i, image in enumerate(images):
fname = 'Bliss'+str(i)+'.png'
image.save(fname, "PNG")
这就是我得到的错误:
File "/opt/anaconda3/lib/python3.7/site-packages/pdf2image/pdf2image.py", line 468, in pdfinfo_from_path
"Unable to get page count. Is poppler installed and in PATH?"
PDFInfoNotInstalledError: Unable to get page count. Is poppler installed and in PATH?
有什么想法吗?提前谢谢
您可以在这里看到如何在mac上安装popplerhttp://macappstore.org/poppler/
相关问题 更多 >
编程相关推荐