How to convert jpg files to one PDF?
Requirements:
- Linux
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 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
So easy, not?
Leave a comment if you can or can't convert your files?
Have you same problem in Windows? Download the . 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.
Blog categories: Linux
Comments
Submitted by Visitor (not verified) on March 27, 2008 - 8:59am Permalink
Works perfectly. Really
Works perfectly. Really sweet. Thanks.
Submitted by Visitor (not verified) on December 17, 2009 - 12:25am Permalink
imagemagick
Thanks a lot. It really worked suberb.
Submitted by on July 6, 2008 - 8:08pm Permalink
Works like a treat!
Works like a treat!
Submitted by on July 17, 2008 - 5:13am Permalink
awesome!
Just what I needed. Thanks!
Submitted by on July 24, 2008 - 12:04am Permalink
Thank you
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
Submitted by on August 27, 2008 - 9:32pm Permalink
convert multiple files to one.
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
Submitted by Visitor (not verified) on September 1, 2008 - 7:45am Permalink
I got the same message first
I got the same message first try. Remember - case sensitive so try *.JPG
Submitted by on August 27, 2008 - 9:35pm Permalink
amendium
It works...great. I was in the wrong directory the first time.
Submitted by Visitor (not verified) on October 9, 2008 - 12:12pm Permalink
doesn't work for me, says it
doesn't work for me, says it fails to find the file/directory...
i m doing something wrong, am i?
Submitted by Jozsef on October 17, 2008 - 11:25am Permalink
case sensitive
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.
Submitted by Ronah (not verified) on November 13, 2008 - 12:44pm Permalink
thanks. it works the way I
thanks. it works the way I expected. :D
Submitted by allen (not verified) on December 15, 2008 - 12:37am Permalink
works, but ran out of memory
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
Submitted by Jozsef on December 16, 2008 - 12:37am Permalink
Yes, you need to add more
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.
Submitted by Visitor (not verified) on January 29, 2009 - 1:04am Permalink
jpeg to pdf
If there are text (as images) in jpeg does ImageMagick convert those to characters?
Submitted by Jozsef on February 20, 2009 - 10:40pm Permalink
No, it doesn't convert those
No, it doesn't convert those to characters.
Submitted by Lukasz Rybka (not verified) on February 4, 2009 - 1:59pm Permalink
If you want to convert
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.
Submitted by mpcoc (not verified) on February 13, 2009 - 5:37pm Permalink
I tried to run this on 40
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
Submitted by on April 13, 2009 - 10:41pm Permalink
"Bestest" solution XD
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.
Submitted by Trond (not verified) on August 26, 2009 - 12:30pm Permalink
Or you could simply do this:
Or you could simply do this: for x in *.jpg; do convert $x `basename $x jpg`pdf; done
Submitted by Lior Zimmerman (not verified) on June 20, 2009 - 12:45pm Permalink
An easy way to convert multiple jpgs to one pdf in linux
first, let us change the name of the jpgs to pdf:
prename 's/\.jpg$/\.pdf/' *.jpg
then, join them with pdfjoin:
pdfjoin *.pdf
Done :)
Submitted by CAML (not verified) on July 5, 2009 - 12:35am Permalink
Convert *.jpg into PDF files
I'm new in linux. I've tried to convert *.jpg files into pdf and it worked...
Submitted by Al (not verified) on August 31, 2009 - 7:41pm Permalink
These command convert *.JPG
These command convert *.JPG wathever.pdf works perfectly!!
Thanxxx!!!
Submitted by Visitor (not verified) on October 17, 2009 - 10:52pm Permalink
Thanks a lot. Everything
Thanks a lot. Everything works fine!
Submitted by on November 12, 2009 - 6:58am Permalink
Works, but....
Hi Thomas,
First of all thank you very much for mentioning about this tool.
I installed it and converted a bunch of files. All went smooth.
But the size of the pdf files generated were huge. This tool has a "compress" option but I don't know what value to pass.
So, I tried the suggestion (given in one of the comments) to use F-Spot and it worked sweetly.
And I managed to add 10 jpg files to F-Spot and select them all, click print, and chose the option to print to a pdf file.
Done. My jpg files were converted and that too with much less size.
Thanks anyway for everyone who gave your valuable thoughts.
Submitted by AJEDE (not verified) on November 24, 2009 - 8:03pm Permalink
It worked like magic
Thanks a lot.
It worked like magic.
Submitted by Visitor (not verified) on December 13, 2009 - 11:33pm Permalink
That is awesome! Thank you
That is awesome!
Thank you mate!
Submitted by Vladimir (not verified) on December 30, 2009 - 9:56am Permalink
Yes, this is a goal. Thahks!
Yes, this is a goal.
Thahks!
Submitted by Fred (not verified) on January 15, 2010 - 8:58pm Permalink
Linux magic
Just magic. 'Have been working on Linux (Xubuntu) for over 2 years now, no looking back...
Thank you so much for sharing!
Submitted by on January 30, 2010 - 2:01pm Permalink
corrupt or damaged pdf
Hi
I tried that with the command line but every time my pdf is corrupt or damaged. If i convert one jpg file is ok if i convert multiple jpgs to a pdf file it gives me the damaged pdf file.
could you send me a replay to my email?
best regards
Sani
Submitted by gwern (not verified) on February 19, 2010 - 4:46pm Permalink
imagemagick considered inefficient
I should mention that the pdfjam solution is far more efficient than imagemagick, it seems. The former took my 69MB of files and gave me a 71MB PDF, while the latter gave me a 445MB (!) PDF.
Submitted by max (not verified) on March 3, 2010 - 12:54am Permalink
Doesn't work for me. It says
Doesn't work for me. It says "segmentation error" after a long while... Is there a limit for the number of pictures to put ?
Submitted by balmydrizzle (not verified) on August 20, 2010 - 4:43am Permalink
I bet your version is v6.2.8 or lower
Cause I tried that version & the command is hung there.
Submitted by Rmitboy (not verified) on March 21, 2010 - 6:12pm Permalink
Thank you so much!
Thank you so much!
Submitted by Marco (not verified) on May 24, 2010 - 9:05pm Permalink
imagemagick - convert
Simply amazing!!
Submitted by Masoud (not verified) on June 13, 2010 - 1:22pm Permalink
Unbelievable!
That's fantastic! I knew how to print to pdf using print menu in the GNOME Image viewer, but it adds nasty white margins and a very large file size. This method doesn't have such drawbacks. Thanks! :)
Submitted by Visitor (not verified) on July 14, 2010 - 9:24am Permalink
Nice! if images have
Nice! if images have different sizes, can i tell imagemagick to convert resize them on the fly? something like
convert *jpeg -page 1400X1600 filename.pdf ?
Submitted by Stea (not verified) on August 5, 2010 - 5:31pm Permalink
Nice:)
Nice:)
Submitted by Peter Funk (not verified) on September 17, 2010 - 6:12pm Permalink
Get smaller PDFs by using the option -compress jpeg
Example: four DIN A4 sized 150 dpi jpeg-files (each about 330 kB on disk) resulted in a 23 MB PDF file without compression. Using the command:
convert -compress jpeg *.jpg output.pdfcreated a PDF with reasonable 1.3 MB instead.
Submitted by Michaelos (not verified) on October 5, 2010 - 4:54am Permalink
Thank you !!!
This really worked for me just fine :).
Long live imagemagick !!!
Submitted by Alpa (not verified) on October 28, 2010 - 10:08pm Permalink
Does not work for PDFs with form fields
I need to convert PDF to JPG, my PDF has form fields (Textbox, dropdowns) on it and this conversion produces junk image which says I need to upgrade my PDF version to read it. I have a latest PDF reader. Have the same problem when I use pdftk to merge this form fields PDF with other PDFs, all other PDFs gets merged but the one with controls shows the same error message - need to upgrade PDF version.
Any help would be greatly appreciated. Thanks !
Submitted by Visitor (not verified) on December 1, 2010 - 7:36pm Permalink
Thanks!
Thanks!
Submitted by DiegoV (not verified) on December 9, 2010 - 7:12pm Permalink
Imagemagick rulz
It's really magic.
Submitted by Emma (not verified) on May 5, 2013 - 5:42pm Permalink
So easy!
Thank you :)
Submitted by bop_pop (not verified) on August 15, 2013 - 6:58am Permalink
convert -destiny 300 (or 600,
convert -destiny 300 (or 600, 1200.....) *.jpg foo.pdf - quality of convertation
convert -scale 2000x1000 (or......) *.jpg foo.pdf exact resolution
Add new comment