pdf 转成图片
yum install python3-pip
pip3 install pdf2image
#yum install poppler-utils
from pdf2image import convert_from_path
# PDF 文件路径
pdf_file_path = '1.pdf'
# 将 PDF 转换为图片
images = convert_from_path(pdf_file_path)
# 保存每一页为图片
for i, image in enumerate(images):
image.save(f'page_{i + 1}.png', 'PNG')