Operating System - HP-UX
1834499 Members
2514 Online
110068 Solutions
New Discussion

back in the good old 7.07 ghostscript days...

 
Manuel Contreras
Regular Advisor

back in the good old 7.07 ghostscript days...

back in the good old 7.07 ghostscript days...

we had Great results converting pdf to ps output, from the following command:

cat $stuff | /usr/local/bin/gs -sDEVICE=ljet4 -q -dNOPAUSE -r200 -sPAPERSIZE=letter -dPDFFitPage -dBATCH -sOutputFile=- - 2> /dev/null | /usr/bin/lp.hp -d $printer


now we find ourselves w/Ghostscript 8.62, which doesn't like the earlier syntax.

my work around, is to convert the file from the pdf2ps script...then perform the print in a separate step.

it works, but the output file is THREE times the size of the earlier method.

The network team is going to demand some free lunches, unless I can get 8.62 to shead some bytes.

any assistance would be appreciated.




the pdf2ps script is as follows:
#!/bin/sh
# $Id: pdf2ps,v 1.5 2007/09/11 15:24:49 Arabidopsis Exp $
# Convert PDF to PostScript.

# This definition is changed on install to match the
# executable name set in the makefile
export LD_LIBRARY_PATH=/usr/local/lib:/usr/local/lib/hpux32:$LD_LIBRARY_PATH
GS_EXECUTABLE=/usr/local/bin/gs
#gs="`dirname $0`/$GS_EXECUTABLE"
gs=$GS_EXECUTABLE
if test ! -x "$gs"; then
gs="$GS_EXECUTABLE"
fi
GS_EXECUTABLE=/usr/local/bin/gs

OPTIONS=""
while true
do
case "$1" in
-?*) OPTIONS="$OPTIONS $1" ;;
*) break ;;
esac
shift
done

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

# 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 "-sOutputFile=$outfile" $OPTIONS -c save pop -f "$1"
5 REPLIES 5
Steven E. Protter
Exalted Contributor

Re: back in the good old 7.07 ghostscript days...

Shalom,

Honestly, I think your current solution works.

Bigger files, but it works.

That until you learn the new syntax for ghostscript 8.62

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Manuel Contreras
Regular Advisor

Re: back in the good old 7.07 ghostscript days...

so your saying I should start saving for a few lunches :P

thanks
Manuel Contreras
Regular Advisor

Re: back in the good old 7.07 ghostscript days...

nothing good to report, after spending some time on syntax (with new version).

wondering if another convert method would a good option...
does anyone have another pdf-to-ps solution? pdftops?


this is one of those times you wish your desk was closer to a unix printer :P
Heironimus
Honored Contributor

Re: back in the good old 7.07 ghostscript days...

pdftops (which I think is bundled with xpdf) will probably give you smaller files than pdf2ps.

Acrobat Reader can also run non-interactively to convert pdf to smaller postscript files than pdf2ps ("acroread -toPostScript ...", acroread -h will give you the syntax).

In both cases (and with ps2pdf) you can specify "-" to write the postscript to stdout and avoid needing to create a temp file.
Manuel Contreras
Regular Advisor

Re: back in the good old 7.07 ghostscript days...

installed yesterday, and was able to get the file down to 1/2 the size as the current GS version.

I think I could live w/those numbers :)

thank you all for your input.

manuel