Skip to content

Batch convert files to PDFs in OSX Mountain Lion

2012 December 12
tags: , ,
by Tedb0t

Today I needed to convert a bunch of RTF files (I know, what?) to PDFs.  After stumbling through a bunch of dead ends, I realized this—like most things—could be done incredibly easily in Bash:

#!/bin/bash
for file in *.rtf ; do
filename=$(basename "$file") /usr/sbin/cupsfilter "$file" > "$filename.pdf"
done

Related Posts:


No comments yet

Leave a Reply

Note: You can use basic XHTML in your comments. Your email address will never be published.

Subscribe to this comment feed via RSS