#!/bin/sh					-*- mode: Shell-script -*-
## File    bin/trunk/bin/ppcode part of synconf project
## Made by Tristan Carel
## Mail    <tristan.carel@gmail.com>
##
## Started on  Wed Feb  8 15:17:08 2006 Tristan Carel
## Last update Thu Sep 21 14:43:07 2006 Tristan Carel
##
## Copyright (C) 2006 Tristan Carel
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##
## $URL: https://svn.sourceforge.net/svnroot/synconf/bin/trunk/bin/ppcode $
## $Revision: 48 $
## $Date:: 2006-09-21 14:44:59 -0400 (Thu, 21 Sep 2006)                       $
##

if [ $# -eq 0 ] ; then
    cat <<EOF
Usage: $0 <files>

for each file given in command line, create a <file>.pdf
in the current directory
EOF
    exit 1
fi

for file in $*; do
    enscript	-C --landscape --column=2 -E  --highlight-bars	\
		--color -o "${file}.ps" "$file" -T 4	&&	\
    ps2pdf "${file}.ps" "${file}.pdf"
    [ -f "${file}.ps" ] && rm "${file}.ps"
done
