Version change, MS-style EOL added

This commit is contained in:
Serge V Shistarev 2014-05-07 14:16:14 +09:00
parent 03370b7088
commit a339269ace
2 changed files with 46 additions and 41 deletions

View file

@ -1,6 +1,6 @@
*PPD-Adobe: "4.3" *PPD-Adobe: "4.3"
*%%%% PPD file for Ricoh Aficio SP 100 with CUPS. *%%%% PPD file for Ricoh Aficio SP 100 with CUPS.
*%%%% Created by Serge V Shistarev from PPD built for Ricoh Aficio SP 1000S *%%%% Created by Serge V Shistarev from PPD built for Ricoh Aficio SP 100
*FormatVersion: "4.3" *FormatVersion: "4.3"
*FileVersion: "1.0" *FileVersion: "1.0"
*LanguageVersion: English *LanguageVersion: English
@ -10,7 +10,7 @@
*Manufacturer: "Ricoh" *Manufacturer: "Ricoh"
*ModelName: "Ricoh Aficio SP 100" *ModelName: "Ricoh Aficio SP 100"
*ShortNickName: "Ricoh Aficio SP 100" *ShortNickName: "Ricoh Aficio SP 100"
*NickName: "Ricoh Aficio SP 100, pstoricohddst-gdi 0.4 alpha" *NickName: "Ricoh Aficio SP 100, pstoricohddst-gdi 0.5 alpha"
*PSVersion: "(3010.000) 0" *PSVersion: "(3010.000) 0"
*LanguageLevel: "3" *LanguageLevel: "3"
*ColorDevice: False *ColorDevice: False

View file

@ -34,12 +34,16 @@ user="$2"
ptitle="$3" ptitle="$3"
my="$0" my="$0"
# MS-style EOL
e=$(echo -en "\r")
# Printing date # Printing date
ddate="`LC_ALL=en_US.UTF-8 date '+%Y/%m/%d %H:%M:%S'`" ddate="`LC_ALL=en_US.UTF-8 date '+%Y/%m/%d %H:%M:%S'`"
# Temporary directory # Temporary directory
uid="/tmp/pstoricohddst-gdi-`uuidgen`" uid="/tmp/pstoricohddst-gdi-`uuidgen`"
mkdir -p $uid mkdir -p $uid
[ "${DEBUG}" = "yes" ] && exec >$uid/output.stream #> >(tee $uid/output.stream)
[ -x "$(which inotifywait)" ] && { [ -x "$(which inotifywait)" ] && {
log "Asynchronous variant" log "Asynchronous variant"
@ -51,13 +55,13 @@ mkdir -p $uid
[ "$stage" = "empty" ] && { [ "$stage" = "empty" ] && {
log "1st stage. Flushing PJL header" log "1st stage. Flushing PJL header"
cat <<EOF cat <<EOF
%-12345X@PJL %-12345X@PJL$e
@PJL SET TIMESTAMP=$ddate @PJL SET TIMESTAMP=$ddate$e
@PJL SET FILENAME=Document @PJL SET FILENAME=Document$e
@PJL SET COMPRESS=JBIG @PJL SET COMPRESS=JBIG$e
@PJL SET USERNAME=$user @PJL SET USERNAME=$user$e
@PJL SET COVER=OFF @PJL SET COVER=OFF$e
@PJL SET HOLD=OFF @PJL SET HOLD=OFF$e
EOF EOF
stage="printing" stage="printing"
@ -65,7 +69,7 @@ EOF
[ "$page" = "999999999-page.pbm" ] && { [ "$page" = "999999999-page.pbm" ] && {
log "Last stage. Flushing PJL footer" log "Last stage. Flushing PJL footer"
cat <<EOF cat <<EOF
@PJL EOJ @PJL EOJ$e
%-12345X %-12345X
EOF EOF
pid=`ps ax | grep $uid | grep -v grep | awk ' { print $1 } '` pid=`ps ax | grep $uid | grep -v grep | awk ' { print $1 } '`
@ -84,15 +88,15 @@ EOF
# Flushing page header # Flushing page header
cat <<EOF cat <<EOF
@PJL SET PAGESTATUS=START @PJL SET PAGESTATUS=START$e
@PJL SET COPIES=1 @PJL SET COPIES=1$e
@PJL SET MEDIASOURCE=AUTO @PJL SET MEDIASOURCE=AUTO$e
@PJL SET MEDIATYPE=PLAINRECYCLE @PJL SET MEDIATYPE=PLAINRECYCLE$e
@PJL SET PAPER=A4 @PJL SET PAPER=A4$e
@PJL SET PAPERWIDTH=$xs @PJL SET PAPERWIDTH=$xs$e
@PJL SET PAPERLENGTH=$ys @PJL SET PAPERLENGTH=$ys$e
@PJL SET RESOLUTION=600 @PJL SET RESOLUTION=600$e
@PJL SET IMAGELEN=$jsize @PJL SET IMAGELEN=$jsize$e
EOF EOF
log "Flushing image $page" log "Flushing image $page"
@ -101,15 +105,16 @@ EOF
# Flushing page footer # Flushing page footer
# TODO: pixelcount for toner estimate # TODO: pixelcount for toner estimate
cat <<EOF cat <<EOF
@PJL SET DOTCOUNT=1132782 @PJL SET DOTCOUNT=1132782$e
@PJL SET PAGESTATUS=END @PJL SET PAGESTATUS=END$e
EOF EOF
} }
done done
) & ) &
# Converting from PostScript to PostScript-monochrome, then to PBM image format (per page) # Converting from PostScript to PostScript-monochrome, then to PBM image format (per page)
gs -sDEVICE=ps2write -sOutputFile=- -r600 -dQUIET -dBATCH -dNOPAUSE - | gs -sDEVICE=pbmraw -sOutputFile=${uid}/%03d-page.pbm -r600 -dQUIET -dBATCH -dNOPAUSE - #gs -sDEVICE=ps2write -sOutputFile=- -r600 -dQUIET -dBATCH -dNOPAUSE - |
gs -sDEVICE=pbmraw -sOutputFile=${uid}/%03d-page.pbm -r600 -dQUIET -dBATCH -dNOPAUSE -
stop stop
wait wait
@ -124,13 +129,13 @@ EOF
log "Conversion complete" log "Conversion complete"
cat <<EOF cat <<EOF
%-12345X@PJL %-12345X@PJL$e
@PJL SET TIMESTAMP=$ddate @PJL SET TIMESTAMP=$ddate$e
@PJL SET FILENAME=Document @PJL SET FILENAME=Document$e
@PJL SET COMPRESS=JBIG @PJL SET COMPRESS=JBIG$e
@PJL SET USERNAME=$user @PJL SET USERNAME=$user$e
@PJL SET COVER=OFF @PJL SET COVER=OFF$e
@PJL SET HOLD=OFF @PJL SET HOLD=OFF$e
EOF EOF
for page in ${uid}/*-page.pbm; do for page in ${uid}/*-page.pbm; do
@ -148,15 +153,15 @@ EOF
# Flushing page header # Flushing page header
cat <<EOF cat <<EOF
@PJL SET PAGESTATUS=START @PJL SET PAGESTATUS=START$e
@PJL SET COPIES=1 @PJL SET COPIES=1$e
@PJL SET MEDIASOURCE=AUTO @PJL SET MEDIASOURCE=AUTO$e
@PJL SET MEDIATYPE=PLAINRECYCLE @PJL SET MEDIATYPE=PLAINRECYCLE$e
@PJL SET PAPER=A4 @PJL SET PAPER=A4$e
@PJL SET PAPERWIDTH=$xs @PJL SET PAPERWIDTH=$xs$e
@PJL SET PAPERLENGTH=$ys @PJL SET PAPERLENGTH=$ys$e
@PJL SET RESOLUTION=600 @PJL SET RESOLUTION=600$e
@PJL SET IMAGELEN=$jsize @PJL SET IMAGELEN=$jsize$e
EOF EOF
# Flushing image # Flushing image
@ -165,14 +170,14 @@ EOF
# Flushing page footer # Flushing page footer
# TODO: pixelcount for toner estimate # TODO: pixelcount for toner estimate
cat <<EOF cat <<EOF
@PJL SET DOTCOUNT=1132782 @PJL SET DOTCOUNT=1132782$e
@PJL SET PAGESTATUS=END @PJL SET PAGESTATUS=END$e
EOF EOF
done done
# Flushing PJL footer # Flushing PJL footer
cat <<EOF cat <<EOF
@PJL EOJ @PJL EOJ$e
%-12345X %-12345X
EOF EOF