I am using the open source version of Reportlab with Python on Windows. My code goes through several PNG files and combines them to form a single PDF file. Each PNG is stretched to the full LETTER specification (8.5x11).
The problem is that all the images stored in output.pdf are clamped on top of each other, and only the last added image is visible. Is there something I need to add between each drawImage()
to offset to a new page? Here is a simple linear look at what I'm doing -
WIDTH,HEIGHT = LETTER canv = canvas.Canvas('output.pdf',pagesize=LETTER) canv.setPageCompression(0) page = Image.open('one.png') canv.drawImage(ImageReader(page),0,0,WIDTH,HEIGHT) page = Image.open('two.png') canv.drawImage(ImageReader(page),0,0,WIDTH,HEIGHT) page = Image.open('three.png') canv.drawImage(ImageReader(page),0,0,WIDTH,HEIGHT) canv.save()
source share