Convert jpeg files to PDF under Linux
How to convert jpg files to one PDF?
Requirements:
- Linux
Ubuntu is my favorite. But you can use any other distribution.
- ImageMagick
Type the follow line to Ubuntu commmand prompt for intall ImageMagick:
sudo apt-get install imagemagick
Convert from jpegs to PDF:
- Go to the work directory (directory of jpegs):
cd work/directory/path
- Convert the JPG files to PDF:
convert *.jpg foo.pdf
Ubuntu is my favorite. But you can use any other distribution.
Type the follow line to Ubuntu commmand prompt for intall ImageMagick:
sudo apt-get install imagemagickcd work/directory/pathconvert *.jpg foo.pdf
So easy, not?
Leave a comment if you can or can't convert your files?
Have you same problem in Windows? Download the PDFCreator. PDFCreator is a free tool to create PDF files from nearly any Windows application that is able to print. (Not just JPG)
Another solution in Linux:
Any KDE application can print in PDF file (same method as PDFCreator). Select JPG-s and print in PDF.







Converting more than a few images can be a little tricky using only the command line. To batch convert them, use F-Spot.
1. Open F-Spot.
2. Add the images you want to convert, they must be in the order you want them.
3. Click print, and select "Print to file"
Your output will be the PDF file.
- reply
Submitted by Firefly (not verified) on April 13, 2009 - 9:41pm.I tried to run this on 40 jpeg pages, and ran out of memory, had to add another 500MB of swap,
most of the images were at 300 dpi, vmsize went past 2.2GB
- reply
Submitted by mpcoc (not verified) on February 13, 2009 - 5:37pm.If you want to convert single file:
convert 000.jpg 000.pdf
But if you want to convert multiple jpgs to one PDF you have to add -adjoin param:
convert *.jpg -adjoin 000.pdf
It works on mine Ubuntu and it's what manual says about converting few images into multiimage PDF.
- reply
Submitted by Lukasz Rybka (not verified) on February 4, 2009 - 1:59pm.If there are text (as images) in jpeg does ImageMagick convert those to characters?
- reply
Submitted by Visitor (not verified) on January 29, 2009 - 1:04am.No, it doesn't convert those to characters.
- reply
Submitted by Joey on February 20, 2009 - 10:40pm.I tried to run this on 40 jpeg pages, and ran out of memory, had to add another 500MB of swap,
most of the images were at 300 dpi, vmsize went past 2.2GB
Allen
- reply
Submitted by allen (not verified) on December 15, 2008 - 12:37am.Yes, you need to add more swap if you haven't got enough memory. The convertion will be slower with swap, but convert process does not ran out of memory.
Thx your comment.
- reply
Submitted by Joey on December 16, 2008 - 12:37am.thanks. it works the way I expected. :D
- reply
Submitted by Ronah (not verified) on November 13, 2008 - 12:44pm.doesn't work for me, says it fails to find the file/directory...
i m doing something wrong, am i?
- reply
Submitted by Visitor (not verified) on October 9, 2008 - 11:12am.Hello,
Check your filenames. All file and directory name is case sensitive in linux. Check your command and modify it from *.jpg to *.JPG or something other correct extension.
- reply
Submitted by Joey on October 17, 2008 - 10:25am.It works...great. I was in the wrong directory the first time.
- reply
Submitted by matt (not verified) on August 27, 2008 - 8:35pm.This doesn't work for me with the wild card, if I do convert *.jpg foo.pdf, I get "can't find *.jpg" I'm using ubuntu.
thanks
mbs
- reply
Submitted by matt (not verified) on August 27, 2008 - 8:32pm.I got the same message first try. Remember - case sensitive so try *.JPG
- reply
Submitted by Visitor (not verified) on September 1, 2008 - 6:45am.Thank you, it works!!!
--> Mandriva 2008 One spring
Add the following lines to your KDE file:
vi .kde/share/apps/konqueror/servicemenus/PDF_merge_images_to_pdf.desktop
[Desktop Entry]
ServiceTypes=image/*
Actions=setAsPdf
[Desktop Action setAsPdf]
Name=Convertir a PDF
Icon=pdf
Exec=convert %U foo.pdf
- reply
Submitted by JuanV (not verified) on July 23, 2008 - 11:04pm.Just what I needed. Thanks!
- reply
Submitted by Alex (not verified) on July 17, 2008 - 4:13am.Works like a treat!
- reply
Submitted by Stefan (not verified) on July 6, 2008 - 7:08pm.Works perfectly. Really sweet. Thanks.
- reply
Submitted by Visitor (not verified) on March 27, 2008 - 8:59am.Post new comment