1

I'm trying to use imagemagick to take several JPGs and lay them out on a pdf

I'm at the beginning of the project and I do not understand how to open the multiple images and do this.

My research indicated to me that this is possible on the command line by simply passing the convert() function multiple files. experience is telling me that this isn't how it's done with Wand, but I can't figure out how!

Any advice is appreciated!

user2666063
  • 95
  • 1
  • 1
  • 6
  • Have you had a look at http://stackoverflow.com/q/15144483/2870069 ? – Jakob Oct 28 '13 at 22:01
  • thank you for the suggestion, however I have. Composite works to overlay images. I can create an incredibly large image and programmatically generate the layout coordinates, and then try and deal with turning that into a workable pdf. That doesn't seem as elegant as the command line solution, so I'm trying to seek a better way. I think I will try and look for a more pdf oriented library and use imagemagick to handle the jpgs or tiffs I might have to deal with. – user2666063 Oct 30 '13 at 14:16

1 Answers1

1
  • my example code is below.
  • before you excute this code, insert the dir path.

import os
from wand.image import Image
from wand.display import display

path = "____absolute_dir_path____ (ex. /home/kim/work/)"

dirList=os.listdir(path)
for fname in dirList:
    print fname
    with Image(filename=path+fname) as img:
        print img.size
stray.leone
  • 339
  • 1
  • 8