I need to convert PDFs with multiple pages to a single unanimated gif where the pages will be one below the other using Python 3 and ideally Wand. I have tried doing this with the following code, however, the gif is still animated so that individual pages behave like frames of an animation.
Here is my current code: (PDFfile is the location of a PDF, GIFfile is the location that I want to save the unanimated gif)
from wand.image import Image
with Image(filename = PDFfile) as img:
Pages = []
for x in range(len(img.sequence)):
Frame = Image(image = img.sequence[x])
Pages.append(Frame)
CombinedImage = Image()
HeightToPlaceAt = 0
for Page in Pages:
CombinedImage.blank(Pages[0].width,Pages[0].height * len(Pages))
CombinedImage.composite(Page,0,HeightToPlaceAt)
HeightToPlaceAt += Page.height
CombinedImage.save(filename = GIFfile)
How can I stop the animation so that all the frames are visible at once, is there a way to 'flatten' the image down to one frame?
Thanks