Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This 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.


  Search this Thread
Old 04-14-2009, 10:18 AM   #1
Registered: Jun 2004
Location: Inland NW, US
Distribution: Ubuntu
Posts: 366
Blog Entries: 1

Rep: Reputation: 44
[solved] Using imagemagick to convert numerous jpg files to single pdf

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.


(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
Old 04-14-2009, 11:09 AM   #2
Registered: Oct 2007
Posts: 31

Rep: Reputation: 16
ImageMagick & PDFTK


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.

       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
Not sure if that helps, but there it is

Old 04-14-2009, 11:32 AM   #3
Registered: Jun 2004
Location: Inland NW, US
Distribution: Ubuntu
Posts: 366

Original Poster
Blog Entries: 1

Rep: Reputation: 44
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.


Last edited by jrtayloriv; 04-14-2009 at 11:46 AM.
Old 04-14-2009, 11:59 AM   #4
Registered: Oct 2007
Posts: 31

Rep: Reputation: 16
Glad to be useful
Old 03-22-2010, 11:03 AM   #5
LQ Newbie
Registered: Mar 2010
Posts: 12

Rep: Reputation: 1
Thumbs up [UBUNTU]How to Covert Multiple Jpegs To one pdf file in UBUNTU/Linux

One of the most common qs i see in forums is >>> How to convert multiple jpg files to one one pdf file by one click .

I have got 2 solutions that I consider solve this situation to the best ....

*1.* Install SCRIBUS from synaptic package manager . It can convert jpegs to pdf without any issues .

F Spot Photo Manager can also be used .

*2.* This 2nd step I find much better ....
I have been using it myself for some time now ... and its flaw less ...

A) Install WINE using the terminal . For beginers .... Its a software that can run selected windows applications on a linux destro like ubuntu. Installing is very easy >>>> open synaptic manager and in quick search box type Wine. Once the wine files show in the search mark them for installation.

For details on easy manual for wine installation check here ..

B) Now go to the page below .... Its a free software.

Down load and save the software from the link given .

Open the file using wine ( Right click on the file and choose the option open with wine.) The installer will run and the programme will be installed .

And Viola ... Its ready .... Import ur jpg files and merge them all in to 1 pdf file .. Very Useful In Merging Comics together.

So , That all regarding this query .. will post soon when I come across some thing small but Very Useful ..

Plz give ur feedbacks if the solution worked for you .
Old 05-17-2010, 04:27 AM   #6
LQ Newbie
Registered: May 2010
Posts: 1

Rep: Reputation: 0
Just use ImageMagick:

convert *.jpg foo.pdf
Old 05-17-2010, 12:51 PM   #7
Senior Member
Registered: Feb 2003
Distribution: debian
Posts: 4,137
Blog Entries: 1

Rep: Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873Reputation: 873
or a2ps + ps2pdf
Old 05-03-2013, 06:13 AM   #8
LQ Newbie
Registered: May 2013
Posts: 2

Rep: Reputation: Disabled
thanks a lot zerox
that also helped me
ive been trying to get my way around imagemagick, but its hard
now i can finally stop using cheap conversion sites


batch, conversion, imagemagick, jpg, pdf

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
convert multiple jpg files into pdf Brocolli Linux - Software 5 05-08-2013 10:43 AM
Samba users can't execute some files (pdf/doc/jpg) deathsfriend99 Linux - Server 4 03-02-2009 10:48 AM
LXer: How to convert PDF files to HTML or XML files in openSUSE LXer Syndicated Linux News 0 08-20-2008 09:40 AM
HELP! BASH - Convert filenames from dsc00***.jpg to *.jpg jimmybond01 Programming 9 05-08-2007 07:17 AM
How To Merge multiple files into a single PDF ? kkempter Linux - Software 1 10-28-2005 02:02 PM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:56 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration