convert image to pdf
import img2pdf
img_path = './出圖章.png'
pdf_path = './stamp_transparent.pdf'
img = Image.open(img_path)
pdf_bytes = img2pdf.convert(img.filename)
with open(pdf_path, 'wb') as f:
f.write(pdf_bytes)
import img2pdf
img_path = './出圖章.png'
pdf_path = './stamp_transparent.pdf'
img = Image.open(img_path)
pdf_bytes = img2pdf.convert(img.filename)
with open(pdf_path, 'wb') as f:
f.write(pdf_bytes)