在使用pdf2image是需要依赖poppler这个可执行文件, 网上找不到相应的文件。
使用 from PIL import Imageimport fitzfrom pdf2image import convert_from_pathpdf_file = r'D:\workspace\python学习笔记.pdf'save_path = r'D:\workspace\\long_image.png'poppler_path = r"D:\app\poppler_2\bin"# 将PDF文件转换为图像列表image_list = convert_from_path(pdf_file, poppler_path=poppler_path)# 获取第一个图像的尺寸page_width, page_height = image_list[0].size# 创建一个与所有图像大小相同的画布merged_image = Image.new("RGB", (page_width, page_height * len(image_list)), (255, 255, 255))# 将所有图像粘贴到画布上for i, image in enumerate(image_list):merged_image.paste(image, (0, i * page_height))# 将画布保存为一张长图merged_image.save(save_path) 资源下载 Poppler下载【Python】 pdf2image中所需要的poppler文件,vx580w
0evadmin
编程语言
3
文件名:【Python】 pdf2image中所需要的poppler文件,vx580w
【Python】 pdf2image中所需要的poppler文件
问题
同类推荐
-

【PyQt5】PythonUI设计开发技巧(持续更新中),三星es70
查看 -

【Python CheckiO 题解】Median,东芝G900
查看 -

【Python CheckiO 题解】The Most Numbers,2494lw
查看 -

【Python 千题 —— 基础篇】今年几岁啦,vivo s11t
查看 -

【Python 基础】-- 在 mac OS 中安装 多个 python 版本,bingbar
查看 -

【Python 必会技巧】利用 utf-8-sig 编码格式解决写入 csv 文件乱码问题,论坛签名图片
查看 -

【Python 训练营】N_11 模拟进度条,z60t
查看 -

【Python-Django】基于TF-IDF算法的医疗推荐系统复现过程,中兴blade a1
查看 -

【Python3 SelectKBest 调用personer出现的错误】,k750i
查看
控制面板
网站分类
搜索
最新留言
文章归档
网站收藏
友情链接