Mini HOWTO: Create a PDF document from multiple images

Sometimes it is required to send someone multiple images. Of course, you can send these images as they are, or you can create and send an archive of these images. But it will be more convenient to send a PDF document. In that case the recipient can easily open the document and he/she will see these images in the sequence you assumed.

There is a powerful software suite called ImageMagick. It provides various utilities for any graphics processing demands. Now we are interested in a convert utility. It has many useful features and it is really irreplaceable for the image batch-processing like in our case.

The command for converting images is pretty simple:

$ convert -define pdf:use-cropbox=true -density 72x72 -resample 72x72 -compress JPEG *.png result.pdf

The convert utility takes all PNG-images in the current directory and creates a PDF-document from it.

You can modify any options as you want. Let's have a look at some of them:
  • density and resample - these options are required for changing images resolution. Usually we scan images in a high resolution (for example, 600 dpi), and this resolution is suitable for the further image editing. But it is too high for the simple viewing. So it will be good to decrease the images resolution. At least, it will make a produced PDF document lightweight.
  • compress - this option is required for compressing images. There are various compression options and JPEG option is suitable for the most cases.
You can play with other options and find the most suitable for you. ImageMagick is a your magic wand to do anything with the images, so do not miss it.

Comments

Popular posts from this blog

Web application framework comparison by memory consumption

Trac Ticket Workflow

Shellcode detection using libemu