Bug#356470: (no subject)
tags 356470 + patch
stop
This patch makes it possible for pdf2ps to use a redirect to standard output
instead of the the output file name i.e. "pdf2ps test.pdf > test.ps" instead
of "pdf2ps test.pdf test.ps".
--- pdf2ps.orig 2007-02-28 18:18:06.000000000 -0700
+++ pdf2ps 2007-02-28 18:23:17.000000000 -0700
@@ -16,18 +16,24 @@
shift
done
-if [ $# -eq 2 ]
+if [ -t 1 ]
then
- outfile=$2
-elif [ $# -eq 1 ]
-then
- outfile=`basename "$1" \.pdf`.ps
+ if [ $# -eq 2 ]
+ then
+ outfile=$2
+ elif [ $# -eq 1 ]
+ then
+ outfile=`basename "$1" \.pdf`.ps
+ else
+ echo "Usage: `basename $0` [-dASCII85EncodePages=false] [-dLanguageLevel=1|2|3] input.pdf [output.ps]" 1>&2
+ exit 1
+ fi
+ OUTFILE="-sOutputFile=$outfile"
else
- echo "Usage: `basename $0` [-dASCII85EncodePages=false] [-dLanguageLevel=1|2|3] input.pdf [output.ps]" 1>&2
- exit 1
+ OUTFILE="-sOutputFile=%stdout%"
fi
# Doing an initial 'save' helps keep fonts from being flushed between pages.
# We have to include the options twice because -I only takes effect if it
# appears before other options.
-exec $GS_EXECUTABLE $OPTIONS -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pswrite $OUTFILE "-sOutputFile=$outfile" $OPTIONS -c save pop -f "$1"
+exec $GS_EXECUTABLE $OPTIONS -q -dNOPAUSE -dBATCH -dSAFER -sDEVICE=pswrite $OUTFILE $OPTIONS -c save pop -f "$1"
Reply to: