The following perl script makes life easier be providing a simple interface to Linux printing via smbprint. If no switch is given, print attempts to guess the file type and print appropriately. The source code formatting is done with nenscript. It also numbers the lines. Using this as an example, other types of formatting can be accomplished.
Postscript documents are already properly formatted, so they pass through directly.
If it is, print the rest. I use something very similar. It does this in order to prevent multiple processes from trying to print to the dame printer at the same time. On a single user system, probably not a big problem. I have a system with over 50 printers.