Convert jpeg files to PDF under Linux

Tags:  •    •    •  

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

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.

"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 Firefly (not verified) on April 13, 2009 - 9:41pm.
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 mpcoc (not verified) on February 13, 2009 - 5:37pm.
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 Lukasz Rybka (not verified) on February 4, 2009 - 1:59pm.
jpeg to pdf

If there are text (as images) in jpeg does ImageMagick convert those to characters?

Submitted by Visitor (not verified) on January 29, 2009 - 1:04am.
No, it doesn't convert those

No, it doesn't convert those to characters.

Submitted by Joey on February 20, 2009 - 10:40pm.
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 allen (not verified) on December 15, 2008 - 12:37am.
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 Joey on December 16, 2008 - 12:37am.
thanks. it works the way I

thanks. it works the way I expected. :D

Submitted by Ronah (not verified) on November 13, 2008 - 12:44pm.
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 Visitor (not verified) on October 9, 2008 - 11:12am.
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 Joey on October 17, 2008 - 10:25am.
amendium

It works...great. I was in the wrong directory the first time.

Submitted by matt (not verified) on August 27, 2008 - 8:35pm.
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 matt (not verified) on August 27, 2008 - 8:32pm.
I got the same message first

I got the same message first try. Remember - case sensitive so try *.JPG

Submitted by Visitor (not verified) on September 1, 2008 - 6:45am.
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 JuanV (not verified) on July 23, 2008 - 11:04pm.
awesome!

Just what I needed. Thanks!

Submitted by Alex (not verified) on July 17, 2008 - 4:13am.
Works like a treat!

Works like a treat!

Submitted by Stefan (not verified) on July 6, 2008 - 7:08pm.
Works perfectly. Really

Works perfectly. Really sweet. Thanks.

Submitted by Visitor (not verified) on March 27, 2008 - 8:59am.

Post new comment

The content of this field is kept private and will not be shown publicly.