Creating multi-page PDFs with free software.

This is another of those posts which are mostly for my reference, but I’m happy to share also.

The task was to scan a multi-page letter, and email it to someone. As I’m not keen on spending money, I look to free software to get the job done.

Requirements: Linux and ImageMagick.

As the letter was a simple monochrome document, I will convert all the scanned images to the Grey colour space first, and then compile them in to a multi-page PDF. The file names are of the format “page01.jpg” “page02.jpg” “page03.jpg” etc and the input format is not important.

mogrify *.jpg -colorspace Gray -compress JPEG

convert *.jpg Filename.pdf

That is it. Really. It’s that simple.

I have not tested it, but if you have colour input images then you ought to omit the mogrify command.

Update 30/4/2015:
This gives slightly better results, I’ve been using it a lot recently:

convert input.* -resize 1240×1753 -units PixelsPerInch -density 150×150 -set page A4 output.pdf

An improvement would be to prevent ImageMagick rasterising svg files, particularly when I mix bitmaps, svgs and pdfs on the input side. Open to ideas at this point.

Advertisements

Tags:

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: