Archive for the ‘programming’ Category

What I really want: A command-line preflight tool for PDFs

Feb 27, 2008

Creating PDFs is difficult. Creating PDFs for print is even more difficult. Reportlab does a great job, but it defaults to RGB in most cases. This necessitates some tweaking of both Reportlab code and the code using Reportlab. Testing the result is difficult, mostly because I don’t know of any command-line tools to do preflight testing for RGB and CMYK elements.

What I need is a command-line tool to do some basic PDF preflighting (eg. non-CMYK elements, non-embedded fonts, images below 300dpi, characters which may cause difficulties in printing, etc.). Is that so much to ask? When the PDF spec is 1300 pages long, it is. Still, don’t think I won’t try and take a stab at it.

Multiple expression if statement in BASH

Nov 21, 2006

It’s not very well documented, but it’s possible to include multiple conditional expressions in a single if statement in BASH. By multiple conditional expressions, I mean something like:

if foo = 1 or bar = 3 or abc = 4 then print Hello World end … Read more