View Full Version : [ubuntu] Creating PDF file from JPG images

September 16th, 2009, 12:54 AM
I'm trying to find a program that can create a .pdf file from .jpg images, but I haven't had any luck from searching. I have 641 jpgs that I'd like to create a .pdf "manual" from them. If possible, I'd also like to add bookmarks to the pdf, for easy navigation. The bookmark part isn't really a necessity, because I've come across many programs that claim to do this with existing pdf files; but if anyone has any suggestions I'd certainly take them.

I've been reading that OpenOffice can do the basics of what I want, but I haven't been able to figure it out. I'm not sure what part of OpenOffice to use; Presentation, Word Processor, Spreadsheet, etc. But from what I've seen, it seems like I'd have to click "Insert > Picture > From File" 641 times anyways. To be honest, I couldn't even figure out how to add more than 1 image into the file, using the Word Processor.

If anyone has any ideas, I would GREATLY appreciate it. I'm using Ubuntu 9.04 Jaunty by the way. I'm also not good with the terminal, so a program with a graphical interface would be preferred over a command line based solution.

September 16th, 2009, 01:10 AM
GIMP can export jpg to pdf, iirc.

take a look at applications -> add/remove -> search for 'pdf' and take a look at the offerings.

September 16th, 2009, 01:22 AM
Scribus is a free desktop publishing program you could use as well. I haven't fiddled with it much, but it looks like it could easily do what you want it too.

In OO Word Processor, there is a button right next to print file directly that allows you to export as a PDF.

Also, GIMP is a handy way to do it. GIMP can be overwhelming for a new user (it still is for me to a large extent) but its amazingly powerful.

September 16th, 2009, 01:28 AM
Are you going to annotate the JPG images in some way, or do you simply want to merge and convert them to PDF format. If the latter, I would be inclined to use the Imagemagick convert utility. I know you said you wanted a GUI but a command-line tool may be best for this job.

If you have Imagemagick installed, just put all the JPG images in one directory, open a terminal window, change to the target directory, and enter the following:

convert -compress Zip *.jpg output.pdf

BTW, with the large number of JPG files, you may receive a memory error message. Also, it will take some time for convert to do its job.

If a GUI that suits your needs isn't provided by another forum member, give convert a try. It won't take much time.

September 16th, 2009, 01:30 AM
You could also install a nautilus script. With the script installed all you would need to do is right click on the jpg file (or any other file you wish) and select pdf.

I dont remember where I got mine, but you might try googling "nautilus scripts". There is alot of different scripts out there, including merging pdf files. One particular site will give you a whole package of scripts as well as a tutorial on how to install them.


Then there is this site, it is in a different language, but one of the scripts it offers is to merge a whole directory of images into a pdf form.


September 16th, 2009, 02:08 AM
you can link a jpg to pdf with Zotero


September 16th, 2009, 10:30 AM
A dead easy solution is to use gscan2pdf which is found in the repositories.

Import the jpg files and save as a pdf. As easy as that. The order of the jpg's can be changed if you wish before conversion to the pdf.

September 20th, 2009, 06:29 PM
Thank you everyone, for your help. I couldn't figure out how to do it in Scribus or GIMP; in the same way I couldn't figure out how to do it in OpenOffice.

The Imagemagick command thing worked up until it hit a jpg that was corrupted. I tried a couple different things to fix it; editing the image, copying & renaming one of the other images and pasting the picture from the corrupt image onto the new one. No matter what I did, I couldn't get it to get past that 1 image. I have no doubt it would have worked, had the image not been corrupted.

I was about to try the nautilus scripts, but I figured I'd give the gscan2pdf program a try first (easiest first), and it worked! Thanks again for the help everyone, I truly appreciate it.

September 24th, 2010, 10:19 AM
convert -compress Zip *.jpg output.pdf

Thank you!

September 24th, 2010, 05:08 PM
Thank you!

Your welcome!

As an aside, I am not sure why I used zip compression in my earlier post, because JPEG compression typically yields smaller file sizes with little or no difference in quality. With newer versions of convert, I believe JPEG compression is enabled by default for JPG files.

convert -compress JPEG *.jpg output.pdf

November 27th, 2010, 07:03 PM
installed imagemagick, tried suggested command and received this error message:

missing an image filename 'output.pdf' @ convert.c/ConvertImageCommand/2775

August 12th, 2012, 05:54 PM

do for every jpg {
convert -scale ".$HEIGHT."x".$WIDTH." -border ".$MARGIN."x".$MARGIN." -bordercolor white $inputfile $outputfile

find . -maxdepth 1 -iname 'page*.jpg' -exec sam2p '{}' '{}'.pdf \;"
sam2p_pdf_scale ".$PAGE_WIDTH." ".$PAGE_HEIGHT." page".$key.".jpg.pdf
pdfjoin page*.pdf --outfile out.pdf

Check the output and functionality of the code above at http://convertjpgpdf.net