I had to submit a form to a government agency today and they demanded PDF format.

The document had to be signed by hand, so I couldn’t just fill the form and resubmit. I had to print the form, fill it out, sign, and then re-scan each page. Now what? I’ve got a directory of images, how do I convert them to PDF?

Adobe’s dark pattern

Adobe Reader looks like it has a built-in tool for converting different formats to PDF. It lets you select multiple scanned images and offers to automatically merge them…for a price. I call this a dark pattern because throughout the process there is no indication that anything will cost money, but as soon as you get to the end and click “convert” you’re redirected to Adobe’s site and asked to buy a $10 monthly subscription.

Bad Adobe. I don’t want an “an easy-to-use collection of online services that lets you convert, sign, and send PDF files.” I want to merge some images into a PDF. Also, what happened to the images I tried to convert? Did you just take them into the cloud without my permission?

PDF Architect

Didn’t work.

After forcing me to create an account (ugh), the “create PDF” options were unlocked. While the program was able to merge the images into a PDF, it failed to pass the government’s form validation (“Document format not supported”).

img2pdf

Open source software is blessed; particularly josch’s img2pdf Python program.

Installation (Ubuntu)

sudo apt install img2pdf

Merging images into a PDF

img2pdf *.png -o out.pdf

Running this command from the folder containing all the scanned PNG images produced an out.pdf. Unlike the PDF produced by PDF Architect, out.pdf successfully passed the government’s form validation and was uploaded without issue.