back in the good old 7.07 ghostscript days...


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users back in the good old 7.07 ghostscript days...
# 1  
Old 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"
# 2  
Old 05-05-2009
Some Unix flavours come with a pdftops, e.g.: pdftops(1), does yours and would it do what you want?
# 3  
Old 05-05-2009
not found on hpux 11.31, but you do bring up a good point.

nothing good to report, after spending sometime on syntax with new version of ghostscript.

wondering if another convert tool would be the answer...
# 4  
Old 05-06-2009
installed pdftops, and got the output file to 1/2 the size as new ghostscript output:
-rw-rw-rw- 1 me mygrp 890570 May 5 15:43 test.ps

generated w/following syntax:
me> pdftops -level1 -paper letter -expand test.in test.ps

anyone aware of another option to trim some more?

thanks
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Linux froze and got back working 5 days later, no reboot.

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

2. Shell Programming and Scripting

Look back file days in PERL

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

3. Shell Programming and Scripting

display all dates 200 days back

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

4. UNIX for Dummies Questions & Answers

display all dates 200 days back

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. UNIX for Dummies Questions & Answers

Date& Time change in linux beyond few days back

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

6. UNIX for Dummies Questions & Answers

Ghostscript

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

7. Shell Programming and Scripting

ls latest 4 days or specify days of files in the directory

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
Login or Register to Ask a Question