#!/bin/sh

DEVICE=@@@device@@@
RESOLUTION=@@@resolution@@@
PAPERSIZE=@@@papersize@@@
SENDEOF=@@@sendeof@@@

nenscript -ZB -p- |
if [ "$DEVICE" = "PostScript" ]; then
	cat -
else
	gs -q -sDEVICE=$DEVICE \
		-r$RESOLUTION \
		-sPAPERSIZE=$PAPERSIZE \
		-dNOPAUSE \
		-dSAFER \
		-sOutputFile=- -
fi

if [ "$SENDEOF" != "" ]; then
	printf "\004"
fi

exit 0
