为Python安装FPDF:
pip install fpdf
现在,您可以使用相同的逻辑:
from fpdf import FPDFpdf = FPDF()# imagelist is the list with all image filenamesfor image in imagelist: pdf.add_page() pdf.image(image,x,y,w,h)pdf.output("yourfile.pdf", "F")您可以在教程页面或官方文档中找到更多信息。



