* Re: [9fans] AFPL Ghostscript-8.13 plus hpijs-1.5
@ 2004-02-17 4:44 Kenji Okamoto
2004-02-18 5:34 ` Kenji Okamoto
2004-02-24 15:04 ` David Presotto
0 siblings, 2 replies; 11+ messages in thread
From: Kenji Okamoto @ 2004-02-17 4:44 UTC (permalink / raw)
To: okamoto, 9fans
After one night sleep, I reminded two more necessary notes:
1) page program has to be modified a bit:
ie. delete the -dSAFER flag from /sys/src/cmd/page/gs.c
2) to co-work with device ijs, pdf file must be converted to ps
file prior to feed it to gs. For this reason, I have following
/sys/lib/lp/process/generic and /sys/lib/lp/process/pdfgsijs
files as follows:
--------/sys/lib/lp/process/generic--------
#!/bin/rc
# Tries to determine what type of file you are printing and do the correct
# thing with it.
# It currently knows about images, troff intermediate, and ascii files.
TMPFILE=/tmp/lp$pid
fn sigexit { rm -f $TMPFILE; }
if (! ~ $DEBUG '') flag x +
if (~ $LPCLASS *nohead*) NOHEAD=1
if (~ $LPCLASS *duplex*) DUPLEX=1
cat >$TMPFILE
FILETYPE=`{file $TMPFILE}
switch ($FILETYPE(2)) {
case troff;
switch ($LPCLASS) {
case *Latin1* *post* *opost*; switch ($FILETYPE(5)) {
# Latin1 is for compatibility with old research UNIX systems, doesn't work on Plan 9
case Latin1 post; tcs -s -f utf -t latin1 < $TMPFILE |$LPLIB/process/dpost
case UTF; $LPLIB/process/tr2post < $TMPFILE
}
case *gs!* *gsijs!*; switch ($FILETYPE(5)) {
# Latin1 is for compatibility with old research UNIX systems, doesn't work on Plan 9
case Latin1 post; tcs -s -f utf -t latin1 < $TMPFILE |$LPLIB/process/dpost |$LPLIB/process/gspipe
case UTF; $LPLIB/process/tr2post < $TMPFILE |$LPLIB/process/gspipe
}
case *; echo $FILETYPE(2) -T$FILETYPE(5) output is improper for $LPDEST >[1=2]
}
case special;
switch ($FILETYPE(4)) {
case '#b'; switch ($LPCLASS) {
case *post*; $LPLIB/process/p9bitpost < $TMPFILE
case *gs!*; $LPLIB/process/p9bitpost < $TMPFILE |$LPLIB/process/gspipe
case *gsijs!*; $LPLIB/process/p9bitpost < $TMPFILE |$LPLIB/process/gspipeijs
}
case *; echo $FILETYPE file is improper for $LPDEST >[1=2]
}
case Compressed plan old; # type is really 'Compressed image' or 'plan 9 image'
# or 'old plan 9 image'
switch ($LPCLASS) {
case *post*; $LPLIB/process/p9bitpost < $TMPFILE
case *gs!*; $LPLIB/process/p9bitpost < $TMPFILE |$LPLIB/process/gspipe
case *gsijs!*; $LPLIB/process/p9bitpost < $TMPFILE |$LPLIB/process/gspipeijs
}
case jpeg;
switch ($LPCLASS) {
case *post*; $LPLIB/process/jpgpost < $TMPFILE
case *gs!*; $LPLIB/process/jpgpost < $TMPFILE |$LPLIB/process/gspipe
case *gsijs!*; $LPLIB/process/jpgpost < $TMPFILE |$LPLIB/process/gspipeijs
}
case GIF;
switch ($LPCLASS) {
case *post*; $LPLIB/process/gifpost < $TMPFILE
case *gs!*; $LPLIB/process/gifpost < $TMPFILE |$LPLIB/process/gspipe
case *gsijs!*; $LPLIB/process/gifpost < $TMPFILE |$LPLIB/process/gspipeijs
}
case ccitt-g31;
switch ($LPCLASS) {
case *post*; $LPLIB/process/g3post < $TMPFILE
case *gs!*; $LPLIB/process/g3post < $TMPFILE |$LPLIB/process/gspipe
case *gsijs!*; $LPLIB/process/g3post < $TMPFILE |$LPLIB/process/gspipeijs
}
# bitmap for research UNIX compatibility, does not work on Plan 9.
case bitmap;
switch ($LPCLASS) {
case *post*; $LPLIB/process/bpost < $TMPFILE
case *mhcc*; $LPLIB/process/bpost < $TMPFILE | $LPLIB/process/mhcc
case *; echo $FILETYPE(2) file is improper for $LPDEST >[1=2]
}
case tex;
mv $TMPFILE $TMPFILE.dvi
TMPFILE=$TMPFILE.dvi
switch ($LPCLASS) {
case *post*; $LPLIB/process/dvipost $TMPFILE
case *gs!*; $LPLIB/process/dvipost $TMPFILE |$LPLIB/process/gspipe
case *gsijs!*; $LPLIB/process/dvipost $TMPFILE |$LPLIB/process/gspipeijs
case *; echo $FILETYPE(2) file is improper for $LPDEST >[1=2]
}
case postscript;
switch ($LPCLASS) {
case *post*; $LPLIB/process/post < $TMPFILE
case *gs!*; $LPLIB/process/post < $TMPFILE |$LPLIB/process/gspipe
case *gsijs!*; $LPLIB/process/post < $TMPFILE |$LPLIB/process/gspipeijs
case *; echo $FILETYPE(2) file is improper for $LPDEST >[1=2]
}
case HPJCL;
switch ($LPCLASS) {
case *HPJCL*; $LPLIB/process/noproc < $TMPFILE
case *; echo $FILETYPE(2) file is improper for $LPDEST >[1=2]
}
case daisy;
switch ($LPDEST) {
case *; echo $FILETYPE(2) file is improper for $LPDEST >[1=2]
}
case English short extended alef limbo [Aa]scii assembler c latin rc sh as mail email message/rfc822;
switch ($LPCLASS) {
case *post*; $LPLIB/process/ppost < $TMPFILE
case *gs!*; $LPLIB/process/ppost < $TMPFILE |$LPLIB/process/gspipe
case *gsijs!*; $LPLIB/process/ppost < $TMPFILE |$LPLIB/process/gspipeijs
case *canon*; $LPLIB/process/can $* < $TMPFILE
case *; echo Unrecognized class of line printer for $LPDEST >[1=2]
}
case tiff;
switch ($LPCLASS) {
case *post*; $LPLIB/process/tiffpost $TMPFILE
case *gs!*; $LPLIB/process/tiffpost $TMPFILE |$LPLIB/process/gspipe
case *gsijs!*; $LPLIB/process/tiffpost $TMPFILE |$LPLIB/process/gspipeijs
case *; echo Unrecognized class of line printer for $LPDEST >[1=2]
}
case PDF;
switch ($LPCLASS) {
case *post*; $LPLIB/process/pdfpost $TMPFILE
case *gs!*; $LPLIB/process/pdfgs $TMPFILE
case *gsijs!*; $LPLIB/process/pdfgsijs $TMPFILE
case *; echo Unrecognized class of line printer for $LPDEST >[1=2]
}
case empty;
echo file is empty >[1=2]
case cannot;
echo cannot open file >[1=2]
case *;
echo $FILETYPE(2) file is improper for $LPDEST >[1=2]
}
wait
rv=$status
rm -f $TMPFILE
#exit $status
exit
---------end here-------
--------/sys/lib/lp/process/pdfgsijs---------
#!/bin/rc
# usage: pdfgsijs pdffile
gs -dSAFER -dNOPAUSE -dBATCH -q -s'DEVICE=pswrite' -d'LanguageLevel=2' -s'OutputFile=/tmp/pdf2ps.ps' $1
MODEL=`{echo $LPCLASS | sed 's/(.*\+)?gsijs!([^+]*)(\+.*)?/\2/'}
NUMBER=`{echo $LPCLASS | sed 's/(.*\+)?gsijs!([^+]*)\+(.*)?/\3/'}
GSTMPFILE=/tmp/pdf^$pid
switch($NUMBER) {
case 2100
GSOPT=(-q -sDEVICE'='ijs -sIjsServer'='hpijs -sDeviceManufacturer'='HP '-sDeviceModel='"$MODEL^' '^$NUMBER" -r600 -sOutputFile'='^$GSTMPFILE -sPAPERSIZE'='a4 -dIjsUseOutputFD -dSAFER -dNOPAUSE -dBATCH)
case 2500
GSOPT=(-q -sDEVICE'='ijs -sIjsServer'='hpijs -sDeviceManufacturer'='HP '-sDeviceModel='"$MODEL^' '^$NUMBER" -r600 -sOutputFile'='^$GSTMPFILE -dDuplex'='true -sPAPERSIZE'='a4 -dIjsUseOutputFD -dSAFER -dNOPAUSE -DBATCH)
}
if(~ $OLIST '')
gs $GSOPT /tmp/pdf2ps.ps
if not {
PGLIST=`{echo $OLIST | sed 's/-o//;s/,/ /g;s/ / /g' | tr -cd '0-9 -'}
GSPGLIST=()
for(i in $PGLIST){
switch($i){
case -*
GSPGLIST=($GSPGLIST `{seq 1 `{echo $i|tr -d '-'}})
case *-
# BUG assume 100 >= number of pages
GSPGLIST=($GSPGLIST `{seq `{echo $i|tr -d '-'} 100})
case *-*
GSPGLIST=($GSPGLIST `{seq `{echo $i|tr '-' ' '}})
case *
GSPGLIST=($GSPGLIST $i)
}
}
GSPGLIST=$"GSPGLIST
echo '
/Page null def
/Page# 0 def
/PDFSave null def
/DSCPageCount 0 def
/DoPDFPage {dup /Page# exch store pdfgetpage pdfshowpage} def
GS_PDF_ProcSet begin
pdfdict begin
('^$1^') (r) file pdfopen begin
/npage pdfpagecount def
['^$GSPGLIST^']
{
dup dup
1 ge exch npage le and
{ DoPDFPage }
{ pop }
ifelse
} forall
' | gs $GSOPT - >/dev/null >[2=1]
}
cat $GSTMPFILE
rm -f $GSTMPFILE
rm -f /tmp/pdf2ps.ps
exit ''
-------to here-------
3) I'm using usb psc2550 here which is connected to a cpu server
machine called "diabase"
Then, for an example, I have /rc/bin/psc2550lp command like this:
-------------/rc/bin/psc2550lp-----------
#!/bin/rc
if(! test -r /dev/usb1)
import -a diabase '#'U /dev
if(! ~ `{ps |grep usbd} *usbd)
usb/usbd
for(i in `{seq 20}){
if (grep -s '3 0x020107' /dev/usb1/$i/status >[2]/dev/null){
echo -n 'ep 3 bulk w 64 32' >/dev/usb1/$i/ctl
bind /dev/usb1/$i/ep3data /n/lp
exit ''
}
}
exit 'no printer'
---------------end here---------
To use this command on acme,
Local psc2550lp
then
lp -dpsc2550 foo.pdf
4) my /sys/lib/lp/devices line for psc2550 is as follows:
# Hewlett-Packard All-in-One Printer PSC 2500
psc2550 ThisRoom - /n/lp - gsijs!psc+2500 generic nospool - - - -
Kenji
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [9fans] AFPL Ghostscript-8.13 plus hpijs-1.5
2004-02-17 4:44 [9fans] AFPL Ghostscript-8.13 plus hpijs-1.5 Kenji Okamoto
@ 2004-02-18 5:34 ` Kenji Okamoto
2004-02-24 15:04 ` David Presotto
1 sibling, 0 replies; 11+ messages in thread
From: Kenji Okamoto @ 2004-02-18 5:34 UTC (permalink / raw)
To: 9fans
One more thought!
I decided, at last, that it's better to put those binaries of gs and hpijs
here. This is because those binaries may be sensitive to the source
versions one has (those depend on ape and/or gnu libraries).
You can find them from
http://basalt.cias.osakafu-u.ac.jp/plan9/s54.html
Kenji
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [9fans] AFPL Ghostscript-8.13 plus hpijs-1.5
2004-02-17 4:44 [9fans] AFPL Ghostscript-8.13 plus hpijs-1.5 Kenji Okamoto
2004-02-18 5:34 ` Kenji Okamoto
@ 2004-02-24 15:04 ` David Presotto
2004-02-25 0:50 ` Kenji Okamoto
1 sibling, 1 reply; 11+ messages in thread
From: David Presotto @ 2004-02-24 15:04 UTC (permalink / raw)
To: 9fans
[-- Attachment #1: Type: text/plain, Size: 65 bytes --]
I stuck your /sys/lib/lp/process/{generic,pdfgsijs} onto sources.
[-- Attachment #2: Type: message/rfc822, Size: 9866 bytes --]
From: Kenji Okamoto <okamoto@granite.cias.osakafu-u.ac.jp>
To: okamoto@granite.cias.osakafu-u.ac.jp, 9fans@cse.psu.edu
Subject: Re: [9fans] AFPL Ghostscript-8.13 plus hpijs-1.5
Date: Tue Feb 17 13:44:54 JST 2004
Message-ID: <9fab7466fa083b26a6ea23adda6a8cb6@granite.cias.osakafu-u.ac.jp>
After one night sleep, I reminded two more necessary notes:
1) page program has to be modified a bit:
ie. delete the -dSAFER flag from /sys/src/cmd/page/gs.c
2) to co-work with device ijs, pdf file must be converted to ps
file prior to feed it to gs. For this reason, I have following
/sys/lib/lp/process/generic and /sys/lib/lp/process/pdfgsijs
files as follows:
--------/sys/lib/lp/process/generic--------
#!/bin/rc
# Tries to determine what type of file you are printing and do the correct
# thing with it.
# It currently knows about images, troff intermediate, and ascii files.
TMPFILE=/tmp/lp$pid
fn sigexit { rm -f $TMPFILE; }
if (! ~ $DEBUG '') flag x +
if (~ $LPCLASS *nohead*) NOHEAD=1
if (~ $LPCLASS *duplex*) DUPLEX=1
cat >$TMPFILE
FILETYPE=`{file $TMPFILE}
switch ($FILETYPE(2)) {
case troff;
switch ($LPCLASS) {
case *Latin1* *post* *opost*; switch ($FILETYPE(5)) {
# Latin1 is for compatibility with old research UNIX systems, doesn't work on Plan 9
case Latin1 post; tcs -s -f utf -t latin1 < $TMPFILE |$LPLIB/process/dpost
case UTF; $LPLIB/process/tr2post < $TMPFILE
}
case *gs!* *gsijs!*; switch ($FILETYPE(5)) {
# Latin1 is for compatibility with old research UNIX systems, doesn't work on Plan 9
case Latin1 post; tcs -s -f utf -t latin1 < $TMPFILE |$LPLIB/process/dpost |$LPLIB/process/gspipe
case UTF; $LPLIB/process/tr2post < $TMPFILE |$LPLIB/process/gspipe
}
case *; echo $FILETYPE(2) -T$FILETYPE(5) output is improper for $LPDEST >[1=2]
}
case special;
switch ($FILETYPE(4)) {
case '#b'; switch ($LPCLASS) {
case *post*; $LPLIB/process/p9bitpost < $TMPFILE
case *gs!*; $LPLIB/process/p9bitpost < $TMPFILE |$LPLIB/process/gspipe
case *gsijs!*; $LPLIB/process/p9bitpost < $TMPFILE |$LPLIB/process/gspipeijs
}
case *; echo $FILETYPE file is improper for $LPDEST >[1=2]
}
case Compressed plan old; # type is really 'Compressed image' or 'plan 9 image'
# or 'old plan 9 image'
switch ($LPCLASS) {
case *post*; $LPLIB/process/p9bitpost < $TMPFILE
case *gs!*; $LPLIB/process/p9bitpost < $TMPFILE |$LPLIB/process/gspipe
case *gsijs!*; $LPLIB/process/p9bitpost < $TMPFILE |$LPLIB/process/gspipeijs
}
case jpeg;
switch ($LPCLASS) {
case *post*; $LPLIB/process/jpgpost < $TMPFILE
case *gs!*; $LPLIB/process/jpgpost < $TMPFILE |$LPLIB/process/gspipe
case *gsijs!*; $LPLIB/process/jpgpost < $TMPFILE |$LPLIB/process/gspipeijs
}
case GIF;
switch ($LPCLASS) {
case *post*; $LPLIB/process/gifpost < $TMPFILE
case *gs!*; $LPLIB/process/gifpost < $TMPFILE |$LPLIB/process/gspipe
case *gsijs!*; $LPLIB/process/gifpost < $TMPFILE |$LPLIB/process/gspipeijs
}
case ccitt-g31;
switch ($LPCLASS) {
case *post*; $LPLIB/process/g3post < $TMPFILE
case *gs!*; $LPLIB/process/g3post < $TMPFILE |$LPLIB/process/gspipe
case *gsijs!*; $LPLIB/process/g3post < $TMPFILE |$LPLIB/process/gspipeijs
}
# bitmap for research UNIX compatibility, does not work on Plan 9.
case bitmap;
switch ($LPCLASS) {
case *post*; $LPLIB/process/bpost < $TMPFILE
case *mhcc*; $LPLIB/process/bpost < $TMPFILE | $LPLIB/process/mhcc
case *; echo $FILETYPE(2) file is improper for $LPDEST >[1=2]
}
case tex;
mv $TMPFILE $TMPFILE.dvi
TMPFILE=$TMPFILE.dvi
switch ($LPCLASS) {
case *post*; $LPLIB/process/dvipost $TMPFILE
case *gs!*; $LPLIB/process/dvipost $TMPFILE |$LPLIB/process/gspipe
case *gsijs!*; $LPLIB/process/dvipost $TMPFILE |$LPLIB/process/gspipeijs
case *; echo $FILETYPE(2) file is improper for $LPDEST >[1=2]
}
case postscript;
switch ($LPCLASS) {
case *post*; $LPLIB/process/post < $TMPFILE
case *gs!*; $LPLIB/process/post < $TMPFILE |$LPLIB/process/gspipe
case *gsijs!*; $LPLIB/process/post < $TMPFILE |$LPLIB/process/gspipeijs
case *; echo $FILETYPE(2) file is improper for $LPDEST >[1=2]
}
case HPJCL;
switch ($LPCLASS) {
case *HPJCL*; $LPLIB/process/noproc < $TMPFILE
case *; echo $FILETYPE(2) file is improper for $LPDEST >[1=2]
}
case daisy;
switch ($LPDEST) {
case *; echo $FILETYPE(2) file is improper for $LPDEST >[1=2]
}
case English short extended alef limbo [Aa]scii assembler c latin rc sh as mail email message/rfc822;
switch ($LPCLASS) {
case *post*; $LPLIB/process/ppost < $TMPFILE
case *gs!*; $LPLIB/process/ppost < $TMPFILE |$LPLIB/process/gspipe
case *gsijs!*; $LPLIB/process/ppost < $TMPFILE |$LPLIB/process/gspipeijs
case *canon*; $LPLIB/process/can $* < $TMPFILE
case *; echo Unrecognized class of line printer for $LPDEST >[1=2]
}
case tiff;
switch ($LPCLASS) {
case *post*; $LPLIB/process/tiffpost $TMPFILE
case *gs!*; $LPLIB/process/tiffpost $TMPFILE |$LPLIB/process/gspipe
case *gsijs!*; $LPLIB/process/tiffpost $TMPFILE |$LPLIB/process/gspipeijs
case *; echo Unrecognized class of line printer for $LPDEST >[1=2]
}
case PDF;
switch ($LPCLASS) {
case *post*; $LPLIB/process/pdfpost $TMPFILE
case *gs!*; $LPLIB/process/pdfgs $TMPFILE
case *gsijs!*; $LPLIB/process/pdfgsijs $TMPFILE
case *; echo Unrecognized class of line printer for $LPDEST >[1=2]
}
case empty;
echo file is empty >[1=2]
case cannot;
echo cannot open file >[1=2]
case *;
echo $FILETYPE(2) file is improper for $LPDEST >[1=2]
}
wait
rv=$status
rm -f $TMPFILE
#exit $status
exit
---------end here-------
--------/sys/lib/lp/process/pdfgsijs---------
#!/bin/rc
# usage: pdfgsijs pdffile
gs -dSAFER -dNOPAUSE -dBATCH -q -s'DEVICE=pswrite' -d'LanguageLevel=2' -s'OutputFile=/tmp/pdf2ps.ps' $1
MODEL=`{echo $LPCLASS | sed 's/(.*\+)?gsijs!([^+]*)(\+.*)?/\2/'}
NUMBER=`{echo $LPCLASS | sed 's/(.*\+)?gsijs!([^+]*)\+(.*)?/\3/'}
GSTMPFILE=/tmp/pdf^$pid
switch($NUMBER) {
case 2100
GSOPT=(-q -sDEVICE'='ijs -sIjsServer'='hpijs -sDeviceManufacturer'='HP '-sDeviceModel='"$MODEL^' '^$NUMBER" -r600 -sOutputFile'='^$GSTMPFILE -sPAPERSIZE'='a4 -dIjsUseOutputFD -dSAFER -dNOPAUSE -dBATCH)
case 2500
GSOPT=(-q -sDEVICE'='ijs -sIjsServer'='hpijs -sDeviceManufacturer'='HP '-sDeviceModel='"$MODEL^' '^$NUMBER" -r600 -sOutputFile'='^$GSTMPFILE -dDuplex'='true -sPAPERSIZE'='a4 -dIjsUseOutputFD -dSAFER -dNOPAUSE -DBATCH)
}
if(~ $OLIST '')
gs $GSOPT /tmp/pdf2ps.ps
if not {
PGLIST=`{echo $OLIST | sed 's/-o//;s/,/ /g;s/ / /g' | tr -cd '0-9 -'}
GSPGLIST=()
for(i in $PGLIST){
switch($i){
case -*
GSPGLIST=($GSPGLIST `{seq 1 `{echo $i|tr -d '-'}})
case *-
# BUG assume 100 >= number of pages
GSPGLIST=($GSPGLIST `{seq `{echo $i|tr -d '-'} 100})
case *-*
GSPGLIST=($GSPGLIST `{seq `{echo $i|tr '-' ' '}})
case *
GSPGLIST=($GSPGLIST $i)
}
}
GSPGLIST=$"GSPGLIST
echo '
/Page null def
/Page# 0 def
/PDFSave null def
/DSCPageCount 0 def
/DoPDFPage {dup /Page# exch store pdfgetpage pdfshowpage} def
GS_PDF_ProcSet begin
pdfdict begin
('^$1^') (r) file pdfopen begin
/npage pdfpagecount def
['^$GSPGLIST^']
{
dup dup
1 ge exch npage le and
{ DoPDFPage }
{ pop }
ifelse
} forall
' | gs $GSOPT - >/dev/null >[2=1]
}
cat $GSTMPFILE
rm -f $GSTMPFILE
rm -f /tmp/pdf2ps.ps
exit ''
-------to here-------
3) I'm using usb psc2550 here which is connected to a cpu server
machine called "diabase"
Then, for an example, I have /rc/bin/psc2550lp command like this:
-------------/rc/bin/psc2550lp-----------
#!/bin/rc
if(! test -r /dev/usb1)
import -a diabase '#'U /dev
if(! ~ `{ps |grep usbd} *usbd)
usb/usbd
for(i in `{seq 20}){
if (grep -s '3 0x020107' /dev/usb1/$i/status >[2]/dev/null){
echo -n 'ep 3 bulk w 64 32' >/dev/usb1/$i/ctl
bind /dev/usb1/$i/ep3data /n/lp
exit ''
}
}
exit 'no printer'
---------------end here---------
To use this command on acme,
Local psc2550lp
then
lp -dpsc2550 foo.pdf
4) my /sys/lib/lp/devices line for psc2550 is as follows:
# Hewlett-Packard All-in-One Printer PSC 2500
psc2550 ThisRoom - /n/lp - gsijs!psc+2500 generic nospool - - - -
Kenji
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [9fans] AFPL Ghostscript-8.13 plus hpijs-1.5
2004-02-24 15:04 ` David Presotto
@ 2004-02-25 0:50 ` Kenji Okamoto
2004-02-25 0:54 ` David Presotto
0 siblings, 1 reply; 11+ messages in thread
From: Kenji Okamoto @ 2004-02-25 0:50 UTC (permalink / raw)
To: 9fans
> I stuck your /sys/lib/lp/process/{generic,pdfgsijs} onto sources.
Great!
So, please add one more file /sys/lib/lp/process/gspipeijs which
I posted here long time ago, and probably many don't remember it.
This is for plain postscript file, not pdf file.
-----from here /sys/lib/lp/process/gspipeijs -----
#!/bin/rc
# extended to IJS driver by K.Okamoto
# duble-sided printing for PSC 2550 printer
#
if (! ~ $DEBUG '') flag x +
# usage: gspipeijs [dev]
# assumes postscript on stdin
switch($#*) {
case 0
MODEL=`{echo $LPCLASS | sed 's/(.*\+)?gsijs!([^+]*)(\+.*)?/\2/'}
NUMBER=`{echo $LPCLASS | sed 's/(.*\+)?gsijs!([^+]*)\+(.*)?/\3/'}
case 1
IJS=$1
case *
echo 'usage: gspipeijs [dev]' >[1=2]
exit gspipeijs
}
GSTMPFILE=/tmp/gsp$pid
switch($NUMBER) {
case 2100
GSOPT=(-q -sDEVICE'='ijs -sIjsServer'='hpijs -sDeviceManufacturer'='HP '-sDeviceModel='"$MODEL^' '^$NUMBER" -r600 -sOutputFile'='^$GSTMPFILE -sPAPERSIZE'='a4 -dIjsUseOutputFD -dSAFER -dNOPAUSE -DBATCH)
case 2500
GSOPT=(-q -sDEVICE'='ijs -sIjsServer'='hpijs -sDeviceManufacturer'='HP '-sDeviceModel='"$MODEL^' '^$NUMBER" -r600 -sOutputFile'='^$GSTMPFILE -dDuplex'='true -sPAPERSIZE'='a4 -dIjsUseOutputFD -dSAFER -dNOPAUSE -DBATCH)
}
gs $GSOPT -
cat $GSTMPFILE
rm $GSTMPFILE
exit
----------- cut here ---------
Kenji
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [9fans] AFPL Ghostscript-8.13 plus hpijs-1.5
2004-02-25 0:50 ` Kenji Okamoto
@ 2004-02-25 0:54 ` David Presotto
0 siblings, 0 replies; 11+ messages in thread
From: David Presotto @ 2004-02-25 0:54 UTC (permalink / raw)
To: 9fans
[-- Attachment #1: Type: text/plain, Size: 4 bytes --]
done
[-- Attachment #2: Type: message/rfc822, Size: 3170 bytes --]
From: Kenji Okamoto <okamoto@granite.cias.osakafu-u.ac.jp>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] AFPL Ghostscript-8.13 plus hpijs-1.5
Date: Wed, 25 Feb 2004 09:50:30 +0900
Message-ID: <6b221435fe329720cf7aed179b570bd3@granite.cias.osakafu-u.ac.jp>
> I stuck your /sys/lib/lp/process/{generic,pdfgsijs} onto sources.
Great!
So, please add one more file /sys/lib/lp/process/gspipeijs which
I posted here long time ago, and probably many don't remember it.
This is for plain postscript file, not pdf file.
-----from here /sys/lib/lp/process/gspipeijs -----
#!/bin/rc
# extended to IJS driver by K.Okamoto
# duble-sided printing for PSC 2550 printer
#
if (! ~ $DEBUG '') flag x +
# usage: gspipeijs [dev]
# assumes postscript on stdin
switch($#*) {
case 0
MODEL=`{echo $LPCLASS | sed 's/(.*\+)?gsijs!([^+]*)(\+.*)?/\2/'}
NUMBER=`{echo $LPCLASS | sed 's/(.*\+)?gsijs!([^+]*)\+(.*)?/\3/'}
case 1
IJS=$1
case *
echo 'usage: gspipeijs [dev]' >[1=2]
exit gspipeijs
}
GSTMPFILE=/tmp/gsp$pid
switch($NUMBER) {
case 2100
GSOPT=(-q -sDEVICE'='ijs -sIjsServer'='hpijs -sDeviceManufacturer'='HP '-sDeviceModel='"$MODEL^' '^$NUMBER" -r600 -sOutputFile'='^$GSTMPFILE -sPAPERSIZE'='a4 -dIjsUseOutputFD -dSAFER -dNOPAUSE -DBATCH)
case 2500
GSOPT=(-q -sDEVICE'='ijs -sIjsServer'='hpijs -sDeviceManufacturer'='HP '-sDeviceModel='"$MODEL^' '^$NUMBER" -r600 -sOutputFile'='^$GSTMPFILE -dDuplex'='true -sPAPERSIZE'='a4 -dIjsUseOutputFD -dSAFER -dNOPAUSE -DBATCH)
}
gs $GSOPT -
cat $GSTMPFILE
rm $GSTMPFILE
exit
----------- cut here ---------
Kenji
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [9fans] AFPL Ghostscript-8.13 plus hpijs-1.5
2004-02-17 2:08 Kenji Okamoto
2004-02-17 2:11 ` Geoff Collyer
@ 2004-02-17 13:04 ` David Meyer
1 sibling, 0 replies; 11+ messages in thread
From: David Meyer @ 2004-02-17 13:04 UTC (permalink / raw)
To: 9fans
Kenji Okamoto wrote:
> http://basalt.cias.osakafu-u.ac.jp/plan0/s54.html.
.../plan9/...
Followup-To:
Distribution:
Organization: University of Bath Computing Services, UK
Keywords:
Cc:
--
Dennis Davis, BUCS, University of Bath, Bath, BA2 7AY, UK
D.H.Davis@bath.ac.uk
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [9fans] AFPL Ghostscript-8.13 plus hpijs-1.5
2004-02-17 2:35 ` Kenji Okamoto
@ 2004-02-17 4:42 ` Kenji Okamoto
0 siblings, 0 replies; 11+ messages in thread
From: Kenji Okamoto @ 2004-02-17 4:42 UTC (permalink / raw)
To: 9fans
[-- Attachment #1: Type: text/plain, Size: 601 bytes --]
One more thing to be added.
The data files should be installed under the directory of
/sys/lib/ghostscript/, and that directory contains two
sub directory (trees)
/sys/lib/ghostscript/fonts: Type 1 fonts
/sys/lib/ghostscript/8.13/
lib: postscript files, cidfmap and that's other candidates, Fontmaps, xlatmap
copy those files from /sys/src/cmd/gs trees by hand
Resource/CIDFont: Japanese CID fonts
Resource/CMap: many CMap files
Resource/ColorSpace:
Resource/Decoding:
examples: standard examples and Japanese ones
doc:
man:
Kenji
[-- Attachment #2: Type: message/rfc822, Size: 2910 bytes --]
From: Kenji Okamoto <okamoto@granite.cias.osakafu-u.ac.jp>
To: 9fans@cse.psu.edu
Subject: Re: [9fans] AFPL Ghostscript-8.13 plus hpijs-1.5
Date: Tue, 17 Feb 2004 11:35:04 +0900
Message-ID: <e270bb32cfe542cedb7e72530c75e4ee@granite.cias.osakafu-u.ac.jp>
It may better to add some notes on this which is actually
written in Japanese in that web page. ☺
If you have no problem using Ghostscript 7.04 for your work,
you don't need to version up that. The problem of GS-7.04
is that it cannot co-work with HP inkjet printer driver called
hpijs. So, if you want this, you'd better to update your Ghostscript
to 8.13 (the most recent one) and hpijs-1.5(also most recent one).
For Japanese use, I'm using Mac's Japanese fonts which are commercial
products. If you have those fonts, you can refer to
/sys/lib/ghostscript/8.13/lib/cidfmap.MacFont, which is the cidfmap
I'm using here. You can use Japanese only when you wrote postscript
file using CID-keyed text. For English users, there must have no problem,
and should work just fine, I believe(or I pray☺).
Kenji
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [9fans] AFPL Ghostscript-8.13 plus hpijs-1.5
2004-02-17 2:18 ` Kenji Okamoto
@ 2004-02-17 2:35 ` Kenji Okamoto
2004-02-17 4:42 ` Kenji Okamoto
0 siblings, 1 reply; 11+ messages in thread
From: Kenji Okamoto @ 2004-02-17 2:35 UTC (permalink / raw)
To: 9fans
It may better to add some notes on this which is actually
written in Japanese in that web page. ☺
If you have no problem using Ghostscript 7.04 for your work,
you don't need to version up that. The problem of GS-7.04
is that it cannot co-work with HP inkjet printer driver called
hpijs. So, if you want this, you'd better to update your Ghostscript
to 8.13 (the most recent one) and hpijs-1.5(also most recent one).
For Japanese use, I'm using Mac's Japanese fonts which are commercial
products. If you have those fonts, you can refer to
/sys/lib/ghostscript/8.13/lib/cidfmap.MacFont, which is the cidfmap
I'm using here. You can use Japanese only when you wrote postscript
file using CID-keyed text. For English users, there must have no problem,
and should work just fine, I believe(or I pray☺).
Kenji
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [9fans] AFPL Ghostscript-8.13 plus hpijs-1.5
2004-02-17 2:11 ` Geoff Collyer
@ 2004-02-17 2:18 ` Kenji Okamoto
2004-02-17 2:35 ` Kenji Okamoto
0 siblings, 1 reply; 11+ messages in thread
From: Kenji Okamoto @ 2004-02-17 2:18 UTC (permalink / raw)
To: 9fans
>> http://basalt.cias.osakafu-u.ac.jp/plan0/s54.html.
>
> The actual URL is:
>
> http://basalt.cias.osakafu-u.ac.jp/plan9/s54.html
Oops!
Thanks Geoff!
Kenji
^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [9fans] AFPL Ghostscript-8.13 plus hpijs-1.5
2004-02-17 2:08 Kenji Okamoto
@ 2004-02-17 2:11 ` Geoff Collyer
2004-02-17 2:18 ` Kenji Okamoto
2004-02-17 13:04 ` David Meyer
1 sibling, 1 reply; 11+ messages in thread
From: Geoff Collyer @ 2004-02-17 2:11 UTC (permalink / raw)
To: 9fans
> http://basalt.cias.osakafu-u.ac.jp/plan0/s54.html.
The actual URL is:
http://basalt.cias.osakafu-u.ac.jp/plan9/s54.html
^ permalink raw reply [flat|nested] 11+ messages in thread
* [9fans] AFPL Ghostscript-8.13 plus hpijs-1.5
@ 2004-02-17 2:08 Kenji Okamoto
2004-02-17 2:11 ` Geoff Collyer
2004-02-17 13:04 ` David Meyer
0 siblings, 2 replies; 11+ messages in thread
From: Kenji Okamoto @ 2004-02-17 2:08 UTC (permalink / raw)
To: 9fans
I put those source trees on our usual web site.
You can get it from
http://basalt.cias.osakafu-u.ac.jp/plan0/s54.html.
This page is written in Japanese using UTF-8 encoding.
I'll not accept any complainment regarding why you use
Japanese, etc. Instead, you can, if neccessary, ignore it
and just read what you can read, which may satisfy your
need, I believe.
For Japanese Plan 9 users, this page is just for you.☺
Written in UTF-8 mail, though. (_grin_)
Kenji
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2004-02-25 0:54 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-17 4:44 [9fans] AFPL Ghostscript-8.13 plus hpijs-1.5 Kenji Okamoto
2004-02-18 5:34 ` Kenji Okamoto
2004-02-24 15:04 ` David Presotto
2004-02-25 0:50 ` Kenji Okamoto
2004-02-25 0:54 ` David Presotto
-- strict thread matches above, loose matches on Subject: below --
2004-02-17 2:08 Kenji Okamoto
2004-02-17 2:11 ` Geoff Collyer
2004-02-17 2:18 ` Kenji Okamoto
2004-02-17 2:35 ` Kenji Okamoto
2004-02-17 4:42 ` Kenji Okamoto
2004-02-17 13:04 ` David Meyer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).