python pdfplumber 将 pdf 转换为 jpg 时出错 FailedToExecuteCommand `"gswin64c.exe"

2024-01-12

我正在尝试使用 python 中的 pdfplumber 将 pdf 转换为图像(IDE JUPYTER)

我尝试过以下代码

with pdfplumber.open("path to pdf") as pdf:
     first_page = pdf.pages[0]
im = first_page.to_image()

我已经下载了依赖项 ImageMagick 和 Ghostscript,还在环境变量中定义了系统路径

我收到以下错误:

DelegateError: FailedToExecuteCommand `"gswin64c.exe" -q -dQUIET -dSAFER -dBATCH -dNOPAUSE -dNOPROMPT -dMaxBitmap=500000000 -dAlignToPixels=0 -dGridFitTT=2 "-sDEVICE=pngalpha" -dTextAlphaBits=4 -dGraphicsAlphaBits=4 "-r72x72" -dFirstPage=1 -dLastPage=1 "-sOutputFile=C:/Users/irg/AppData/Local/Temp/magick-xwn2OA2S47mta_1fpsoqvDw2WyROBAJq%d" "-fC:/Users/irg/AppData/Local/Temp/magick-FzpgZxweNEIZ03bmz0yeYtNa8wctH3sw" "-fC:/Users/irg/AppData/Local/Temp/magick-PdLhGJhkX1m7ozduIxlzmXaLKEegAz98"' (The system cannot find the file specified.) @ error/delegate.c/ExternalDelegateCommand/475

请帮助我解决这个问题。


None

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

python pdfplumber 将 pdf 转换为 jpg 时出错 FailedToExecuteCommand `"gswin64c.exe" 的相关文章

随机推荐