Skip navigation.
Home

En Masse Conversion of Documents to PDF

Clients from Hell is a favourite place for web designers and developers to visit for laughter, or a relief from blood-curdling rage through affirmation. But every so often there is a comment from a supposedly frustrated designer or developer that makes one think that the comment is not so stupid.

Consider the request posted on August 14, 2011. "Please do me a small favor and convert all 357 word documents into pdf format." The idea is that this is supposed to be a ridiculous request, one which would take hours and the client really doesn't realise this. Of course, the sense of frustration would be true if (a) you're attempting to this with a common web-based .doc to .pdf tool or (b) using the Microsoft PDF exporter file by file.

But there is another option which turns the supposedly ridiculous task into a trivial one. Using a combination of Linux and LibreOffice a single command can convert all the *.doc files in an active directory e.g.,


/usr/bin/soffice --headless --convert-to pdf *.doc

LibreOffice, like its predecessor OpenOffice, has a wide range of command-line tools which are certainly worthy of familiarisation.

So let's try that conversation again.

Client: Please do me a small favor and convert all 357 word documents into pdf format."
Me: *tap* *tap*, OK done.
Client: Wow, that was fast!
Me: That's why you pay me big $$$s.