
Dec 08, '09 07:30:03AM • Contributed by: owlgorithm
For example, to print 80-column ASCII plaintext (the majority of my code), I can use this:
$ cupsfilter foo.txt > foo.pdfIf you find the output of that command a bit verbose (as I do), you can send the errors silently to the null device using this version:
$ cupsfilter foo.txt > foo.pdf 2> /dev/nullThere are many ways to wrap this simple command even more conveniently, but I'll omit those here for now. The reason this method is ideal is because it uses built-in routines in OS X; any time you can take advantage of these, do, because many of the core technologies are significantly faster and more secure than third-party alternatives.
Of course, your mileage may vary :-).
[robg adds: cupsfilter PDF conversions work in at least 10.5 and 10.6, and I suspect in earlier OS X releases.]