iPhone 3GS OS4 Upgrade
September 4, 2010 – 5:23 pm | One Comment

iTunes for Windows must be one of the buggiest, most poorly written applications out there. In terms of wasted months of your life it definitely ranks up there with Lotus Notes and Media Player 12. I don’t know how well iTunes works on a Mac (I like computer mice with twenty buttons, so I never was a big Mac fan), but I think I read somewhere that iTunes for Windows is the leading cause of suicides among iPhone owners.

Read the full story »
Networking

Unix and Linux network configuration. Multiple network interfaces. Bridged NICs. High-availability network configurations.

Applications

Reviews of latest Unix and Linux software. Helpful tips for application support admins. Automating application support.

Data

Disk partitioning, filesystems, directories, and files. Volume management, logical volumes, HA filesystems. Backups and disaster recovery.

Monitoring

Distributed server monitoring. Server performance and capacity planning. Monitoring applications, network status and user activity.

Commands and Shells

Cool Unix shell commands and options. Command-line tools and application. Things every Unix sysadmin needs to know.

Home » Applications

Convert Images to PDF

Submitted by Igor on July 18, 2008 – 12:26 amNo Comment
Convert Images to PDF

Converting sets of images into multi-page PDF files makes it easier to organize and share them. All you need for the conversion is the free ImageMagick that will run on your Windows, Linux, MacOS and many other operating systems. If you are running a recent version of Linux, chances are that ImageMagick is already installed on your computer (just type “which convert” to check).

The basic syntax for the conversion is very simple:

convert *.jpg filename.pdf

This command will look for all *.jpg files in the current directory and it will add them to a single PDF file.

In the following example we have a bunch of folders in /home/user/photos. Each folder contains many JPEG files. You want to convert each folder of these images into a PDF file with the same name as the folder:

ls | fgrep -v . | while read FOLDER
do
     nice -n +10 convert ./${FOLDER}/*.jpg ./${FOLDER}.pdf
done

Unfortunately, when performing batch file conversions, ImageMagick uses lots of RAM and CPU. To keep ImageMagick from taking over your CPU, we use the “nice” command. The more images you have in a folder, the more RAM/swap ImageMagick will use. It is possible that your system may run out of swap space. To add extra swap space on the fly, do the following:

dd if=/dev/zero of=/swapfile bs=1024 count=65536
mkswap /swapfile
swapon /swapfile

Running “top” or “free” will show you how much swap space your system has. It is advisable to put the extra swap space on a secondary disk, so not to slow down the system disk with swap I/O. ImageMagick is a bit sluggish and resource-hungry when it comes to working with PDF files. Adobe Acrobat is much faster and more efficient. But then again, ImageMagick doesn’t cost you three hundred bucks and it produces fully-compatible PDF files.

Popularity: 22% [?]

Related posts

Leave a comment!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.