#!/bin/bash
#
# Enscript prints a text file in post script in a nice way.
# When UTF8 is present, might need paps instead.
#

#
# first argument file to be printed
#
file="$1"
echo "Printing $file with:";
#
# enscrypt incantation:
#
echo "enscript --margins=::50: --no-header --no-job-header --font=Courier8 -MLetter ${file}"
enscript --margins=::50: --no-header --no-job-header --font=Courier8 -MLetter ${file}
if [[ $? == 0 ]]; then
    echo "[OK]  Enscript exited successfully."
else
    echo "[!!]  Enscript exit status $?. Check print job."
fi
#
# Make a note about paps
#
echo "[??]  If special characters don't print properly, try paps"
echo "paps --font=Courier8 --paper=letter <file>"
echo ""
#
# Make a note about printing Word or Openoffice docs from command line.
#
echo "Print your openoffice dos:"
echo "/usr/lib/openoffice/program/soffice -norestore -nofirststartwizard -nologo -headless -p *.odt"


