I am using Python and I'm trying to place three images that cover the entire page. The last image creats and jumps to the next page, I think beacuse of the 'footer'. How can I disable this footer or overcome it?
from PIL import Image
from fpdf import FPDF
class PDF(FPDF):
pass
def imagex(self):
self.set_xy(0, 0)
self.image(fr'C:\Users\user\Desktop\pictures\1.jpeg', link='', type='', w=210, h=100)
self.set_xy(0, 100)
self.image(fr'C:\Users\user\Desktop\pictures\2.jpeg', link='', type='', w=210, h=100)
#This is where the picture jumps
self.set_xy(0, 200)
self.image(fr'C:\Users\user\Desktop\pictures\3.jpeg', link='', type='', w=210, h=100)
if __name__ == '__main__':
pdf = PDF()
pdf.add_page()
imagex(pdf)
pdf.output(r'C:\Users\user\Desktop\test.pdf', 'F')
You can use this below solution:
I tried to rewrite your code and assessed based on my data. In fact, you must set the location of each picture sequentially. Instead of using
self.set_xyI embedded(x,y)location inself.image("file_path", x,y, w,h)