直播app系统源码,python pdf转为图片
直播app系统源码,python pdf转为图片
from wand.image import Image
import os
# 将pdf文件转为jpg图片文件
cur_file_path = os.path.dirname(os.path.realpath(__file__))
# path为pdf文件路径
path = os.path.join(cur_file_path, os.pardir, 'ehouse/resource/img/')
image_pdf = Image(filename=path + 'e宅快贷业务申请表.pdf', resolution=300)
image_jpeg = image_pdf.convert('jpg')
# 页面转为独立的二进制图像对象
req_image = []
for img in image_jpeg.sequence:
img_page = Image(image=img)
req_image.append(img_page.make_blob('jpg'))
# 存储为图片文件
i = 0
for img in req_image:
ff = open(path + e宅快贷业务申请表+ str(i) + '.png', 'wb')
ff.write(img)
ff.close()
i += 1
以上就是直播app系统源码,python pdf转为图片, 更多内容欢迎关注之后的文章