Using imagemagick to convert numerous jpg files to single pdf
Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
I have a large number of scanned JPG images that I would like to convert into a single PDF file -- each image will be on its own page, and I want the pages to be in a certain order.
What is the command for ImageMagick to take a batch of JPGs and convert them to PDF, and order the pages in a certain way.
Say for example, that I had -- page1.jpg page2.jpg page3.jpg ...
Thanks very much for your help.
--jrtayloriv
(by the way: I am working on writing a Gentoo ebuild for convert2pdf at the moment, but until I get that worked out, I'd like to figure out how to do this using Imagemagick, which is already in the portage tree, and already installed)
Last edited by jrtayloriv; 04-14-2009 at 11:33 AM..
Reason: Problem solved
I may be wrong, but I don't think ImageMagick can do that by itself.
I would convert the images as seperate PDF's then use something like pdftk to merge them into one with ordering.
Code:
Join in1.pdf and in2.pdf into a new PDF, out1.pdf
pdftk in1.pdf in2.pdf cat output out1.pdf
or (using handles):
pdftk A=in1.pdf B=in2.pdf cat A B output out1.pdf
or (using wildcards):
pdftk *.pdf cat output combined.pdf
That does help very much. Thank you. I was able to find plenty of info on using imagemagick to convert individual JPGs into individual PDFs, so I know how to do that. I just couldn't find any info on converting a batch of JPGs into a single PDF.
pdftk seems to be what I was looking for. I appreciate the help.
--jrtayloriv
Last edited by jrtayloriv; 04-14-2009 at 11:46 AM..
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.