Tuesday, November 13, 2012

RANT: complications of converting a picture to a pdf...

I just spent about one hour looking for a small tool (i.e. NOT starting libreoffice and putting a picture on a empty page, export as pdf) that will preserve resolution and geometrical size of a scanned-in bitmap and put it centered on a blank (A4-paper) page.

I assume that for every permutations of {'png','jpg','tiff','bmp','xpm',...},{'to','2'},'ps' there will be some tool in Ubuntu's repository, but they all seem to...
  • mess with the aspect ratio
  • either assume some fixed input resolution (ImageMagick's convert, for example) which gives you tiny, tiny, tiny output pdf-files (I could not reproduce the calculations it does) or correctly sized pages with the image enlarged until it fits border-to-border
  • re-sample the image so that the output file is huge, and image quality sucks.
But today, I finally found the small python script again I've written back in 2007, used through most of my university time (for scanning in travel invoices, notes, ...) and which still works \o/ . It's not a very pretty tool, but hey, at least it does what's advertized!
Have fun with it, in case you have to send in your Arbeitsunfähigkeitsbescheinigung like myself, being sick and getting MENTAL BECAUSE OF ALL THESE USELESS TOOLS one has to keep up with.

No comments: