05-05-2009
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 -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"
7 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I would like to list latest 2 days, 3 days or 4 days,etc of files in the directory...
how? is it using ls? (3 Replies)
Discussion started by: happyv
3 Replies
2. UNIX for Dummies Questions & Answers
I am trying to use Ghostscript oin AIX to print pdf's and it seems I have downloaded it and all dependencys fine - install went fine, when I type any gs commnad except gs -h it just hangs..Here is what it says before the hang:
GNU Ghostscript 5.50 (2000-2-13)
Copyright (C) 1998 Aladdin... (6 Replies)
Discussion started by: capeme
6 Replies
3. UNIX for Dummies Questions & Answers
Hi,
Could you please let me know the command to change my date /time beyond few days back. Currently when i am trying the below commands able to go beyond one day at max.
-->date
-->Mon Sep 29 19:31:58 EST 2008
-->export TZ=TMP40:00:00 (Changing the date beyond 40 hours)
-->Sun Sep 28... (4 Replies)
Discussion started by: komala
4 Replies
4. UNIX for Dummies Questions & Answers
i need help! can someone help me please?
i try to calculate date under unix (ksh)...AIX operating system.
I have to find the date 200 days from today's date.
then the script should loop 200 times and display on command line every day's date until the current date.
example:
todays date:... (1 Reply)
Discussion started by: pavan_test
1 Replies
5. Shell Programming and Scripting
i need help! can someone help me please?
i try to calculate date under unix (ksh)...AIX operating system.
I have to find the date 200 days from today's date.
then the script should loop 200 times and display on command line every day's date until the current date.
example:
todays date:... (4 Replies)
Discussion started by: pavan_test
4 Replies
6. Shell Programming and Scripting
I have 3 variables , $file =abc_2011_11_01.txt (current day file), $back = Yes and $forward = No
I need to search for 3 days back files / 3 days forward files if my current file is not present
logic is,
I need to download the current day file.
If it is missing, i need to look out for currentday... (4 Replies)
Discussion started by: irudayaraj
4 Replies
7. UNIX for Beginners Questions & Answers
Hello my friends,
I've come across the weirdest of glitches.
I'm running a simple weather monitor (just temperature) on a Raspbeery Pi 3B (Raspbian Linux 4.14.98-v7+). It has a 3G modem that sends out simple packets to my server at home.
On june 5th I lost remote access to the device.... (1 Reply)
Discussion started by: OmahaWiz
1 Replies
LEARN ABOUT OPENSOLARIS
ps2pdf
PS2PDF(1) Ghostscript PS2PDF(1)
NAME
ps2pdf - Convert PostScript to PDF using ghostscript
ps2pdf12 - Convert PostScript to PDF 1.2 (Acrobat 3-and-later compatible) using ghostscript
ps2pdf13 - Convert PostScript to PDF 1.3 (Acrobat 4-and-later compatible) using ghostscript
SYNOPSIS
ps2pdf [options...] {input.[e]ps|-} [output.pdf|-]
ps2pdf12 [options...] {input.[e]ps|-} [output.pdf|-]
ps2pdf13 [options...] {input.[e]ps|-} [output.pdf|-]
DESCRIPTION
The ps2pdf scripts are work-alikes for nearly all the functionality (but not the user interface) of Adobe's Acrobat(TM) Distiller(TM) prod-
uct: they convert PostScript files to Portable Document Format (PDF) files.
If the output filename is not specified, the output is placed is a file of the same name with a '.pdf' extension. Either the input filename
or the output filename can be '-' to request reading from stdin or writing to stdout, respectively, when used as a filter.
The three scripts differ as follows:
- ps2pdf12 will always produce PDF 1.2 output (Acrobat 3-and-later compatible).
- ps2pdf13 will always produce PDF 1.3 output (Acrobat 4-and-later compatible).
- ps2pdf per se currently produces PDF 1.4 output. However, this may change in the future. If you care about the compatibility level
of the output, use ps2pdf12 or ps2pdf13, or use the -dCompatibility=1.x switch in the command line.
There are some limitations in ps2pdf's conversion. See the HTML documentation for more information. A large number of Adobe Distiller(TM)
parameters which can be used to control the conversion are also documented there, including instructions for generating PDF/X and PDF/A
documents.
EXAMPLES
Converting a figure.ps to figure.pdf:
ps2pdf figure.ps
A conversion with more specifics:
ps2pdf -dPDFSETTINGS=/prepress figure.ps proof.pdf
Converting as part of a pipe:
make_report.pl -t ps | ps2pdf -dCompatibility=1.3 - - | lpr
SEE ALSO
gs(1), ps2pdfwr(1),
Ps2pdf.htm in the Ghostscript documentation
BUGS
See http://bugs.ghostscript.com/ and the Usenet news group comp.lang.postscript.
VERSION
This document was last revised for Ghostscript version 8.63.
AUTHOR
Artifex Software, Inc. are the primary maintainers of Ghostscript. This manpage by George Ferguson.
8.63 1 August 2008 PS2PDF(1)