Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to insert an image inside a cell? #195

Open
JianDk opened this issue Jan 30, 2022 · 1 comment
Open

How to insert an image inside a cell? #195

JianDk opened this issue Jan 30, 2022 · 1 comment

Comments

@JianDk
Copy link

JianDk commented Jan 30, 2022

I am generating a PDF file using FPDF in Python. Below is a code snippet, where I am creating a table using cell. The table consists of 3 columns. In the last cell of each row, I need to insert an image with a QR code. I don't know how to insert an image inside a cell.

```

#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(....)

@Lucas-C
Copy link

Lucas-C commented Mar 1, 2022

pyfpdf is not maintained anymore, have you tried using fpdf2?
https://pyfpdf.github.io/fpdf2/

We do not support this use case for the moment, but feel free to open a feature request at https://github.com/PyFPDF/fpdf2/issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants