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 DEBIAN
foo2hiperc
foo2hiperc(1) General Commands Manual foo2hiperc(1)
NAME
foo2hiperc - Convert Ghostscript pbmraw or bitcmyk format into a HIPERC printer stream
SYNOPSIS
foo2hiperc [options] <pbmraw-file >hiperc-file
foo2hiperc [options] <bitcmyk-file >hiperc-file
foo2hiperc [options] <pksmraw-file >hiperc-file
DESCRIPTION
foo2hiperc converts Ghostscript pbmraw, bitcmyk, or pksmraw output formats to monochrome or color HIPERC streams, for driving the Oki
C310dn, C3100, C3200, C3300n, C3400n, C5100n, C5500n, C5600n, and the C5800n HIPERC printers.
COMMAND LINE OPTIONS
Normal Options
These are the options used to select the parameters of a print job that are usually controlled on a per job basis.
-c Force color mode if autodetect doesn't work.
-d duplex
Duplex code to send to printer [1].
| | |
|1 off | 2 long edge | 3 short edge
-g xpixxypix
Set page dimensions in pixels [5100x6600].
-m media
Media code to send to printer [0].
--------------------------
Media HIPERC
--------------------------
plain 0
labels 1
transparency 2
-p paper
Paper code to send to printer [2].
+-------------+------------------+
| 1 A4 | 2 letter |
| 3 legal | - - |
| 5 A5 | 6 B5jis |
| 7 A6 | 8 env Monarch |
| 9 env DL | 10 env C5 |
|11 env #10 | 12 executive |
|13 env #9 | - - |
+-------------+------------------+
-n copies
Number of copies [1].
-r xresxyres
Set device resolution in pixels/inch [600x600].
-s source
Source (InputSlot) code to send to printer [0].
|0 auto select |
|1 tray1 | 2 tray2
|3 multi | 4 manual
-t Draft mode. Every other pixel is white.
-J filename
Filename string to send to printer.
-U username
Username string to send to printer.
Printer Tweaking Options
These are the options used to customize the operation of foo2hiperc for a particular printer.
-u xoffxyoff
Set the offset of the start of the printable region from the upper left corner, in pixels [0x0].
-l xoffxyoff
Set the offset of the end of the printable region from the lower right corner, in pixels [0x0].
-L mask
Send logical clipping amounts implied by -u/-l in the HIPERC stream [3].
0 don't send any logical clipping amounts
1 only send Y clipping amount
2 only send X clipping amount
3 send both X and Y clipping amounts
-A AllIsBlack: convert C=1,M=1,Y=1 to just K=1. Works with bitcmyk input only.
-B BlackClears: K=1 forces C,M,Y to 0. Works with bitcmyk input only.
-Z compressed
Use uncompressed (0) or compressed (1) JBIG data.
Debugging Options
These options are used for debugging foo2hiperc.
-S plane
Output just a single color plane from a color print and print it on the black plane. The default is to output all color planes.
1 Cyan
2 Magenta
3 Yellow
4 Black
-D level
Set Debug level [0].
EXAMPLES
Create a black and white HIPERC stream:
gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE
-sPAPERSIZE=letter -r600x600 -sDEVICE=pbmraw
-sOutputFile=- - < testpage.ps
| foo2hiperc -r600x600 -g5100x6600 -p0 >testpage.zm
Create a color HIPERC stream:
gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE
-sPAPERSIZE=letter -g5100x6600 -r600x600 -sDEVICE=bitcmyk
-sOutputFile=- - < testpage.ps
| foo2hiperc -r600x600 -g5100x6600 -p0 >testpage.zc
FILES
/usr/bin/foo2hiperc
SEE ALSO
foo2hiperc-wrapper(1), hipercdecode(1)
AUTHOR
Rick Richardson <rick.richardson@comcast.com>
http://foo2hiperc.rkkda.com/