/usr/bin/fbgs is in fbi 2.07-11.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 | #!/bin/bash
# tmp dir
DIR="$(mktemp -dtp ${TMPDIR-/var/tmp} fbgs-XXXXXX)"
test -d "$DIR" || exit 1
trap "rm -rf $DIR" EXIT
# parse options
fbiopts=""
gsopts=""
passwd=""
device="tiffpack"
opt=1
while test "$opt" = "1"; do
case "$1" in
-l) gsopts="$gsopts -r100x100"
shift
;;
-xl) gsopts="$gsopts -r120x120"
shift
;;
-xxl) gsopts="$gsopts -r150x150"
shift
;;
-a | --fitwidth | --noverbose | -u | -1)
fbiopts="$fbiopts $1"
shift
;;
-d | -m | -t | -g | -f | -T | -s)
fbiopts="$fbiopts $1 $2"
shift; shift
;;
-p) password="$2"
shift; shift
;;
-h) echo fixme: help text
exit 1
;;
-c) device="png16m"
shift
;;
-*) echo "unknown option: $1"
exit 1
;;
*) opt=0
;;
esac
done
# run ghostscript
echo
echo "### rendering pages, please wait ... ###"
echo
gs -dSAFER -dNOPAUSE -dBATCH \
-sPDFPassword="$password" \
-sDEVICE=${device} -sOutputFile=$DIR/ps%03d.tiff \
$gsopts \
"$1"
# sanity check
pages=`ls $DIR/ps*.tiff 2>/dev/null | wc -l`
if test "$pages" -eq "0"; then
echo
echo "Oops: ghostscript wrote no pages?"
echo
exit 1
fi
# show pages
fbi $fbiopts -P $DIR/ps*.tiff
|