I am creating a jpg in my python program, and would like to make it part of a pdf with fpdf. Is that possible without writing it to a file first?
I am creating a jpg in my python program, and would like to make it part of a pdf with fpdf. Is that possible without writing it to a file first?
I don't think so. In the fpdf image docs, it says for the name param in adding an image with fpdf.image(name, x = None, y = None, w = 0, h = 0, type = '', link = ''):
name:
Path or URL of the image.
This implies that you're not passing an object representing an image directly in as the parameter, but only the path to an image that is already saved to disk as a file. This is so when you call something like pdf.output('tuto1.pdf', 'F'), it will build the PDF at that point from the text, images, etc.