【发布时间】:2022-09-29 13:35:20
【问题描述】:
我在 Python 中使用 FPDF 生成 PDF 文件。下面是一个代码 sn-p,我在其中使用单元格创建一个表。该表由 3 列组成。在每一行的最后一个单元格中,我需要插入一个带有二维码的图像。我不知道如何在单元格中插入图像。
#Create table header
height = 5
pdf.cell(w = 50, h = height, txt = \'Product\', align = \'L\', border = \'B\', ln = 0)
pdf.cell(w = 120, h = height, txt = \'Instructioon\', align = \'L\', border = \'B\', ln = 0)
pdf.cell(w = 20, h = height, txt = \'Video\', align = \'L\', border = \'B\', ln = 1)
#Create the content in the first table row
pdf.cell(w = 50, h = height, txt = \'Product 1\', align = \'L\', ln = 0)
pdf.cell(w = 120, h = height, txt = \'some product descriptions\', align = \'L\', ln = 0)
#This is the cell I need to insert an image with a QR code, but I don\'t know how to insert the image inside a cell
pdf.cell(....)
-
\"我不知道如何在单元格中插入图像\"单元格仅用于文本。致电
image()。