~ubuntu-branches/ubuntu/gutsy/foo2zjs/gutsy-updates

« back to all changes in this revision

Viewing changes to foo2zjs-wrapper.in

  • Committer: Bazaar Package Importer
  • Author(s): Till Kamppeter
  • Date: 2007-06-25 17:25:17 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20070625172517-hfgsrqo8mmvtylad
Tags: 20070625-0ubuntu1
* New upstream release
  - Added support for Samsung CLP-300, CLP-600, CLX-3160, Xerox Phaser
    6110, 6115MFP, Konica Minolta magicolor 2480, 2490, 2530.
  - Bug fixes.
  debian/patches/10-makefile.dpatch: Regenerated to adapt to new foo2zjs
  version.
* Do not fail if building of manual.pdf fails. This file is not important
  and should not hold back releases.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
#*
19
19
#* Authors: Rick Richardson <rick.richardson@comcast.net>
20
20
 
21
 
VERSION='$Id: foo2zjs-wrapper.in,v 1.100 2006/12/17 16:00:06 rick Exp $'
 
21
VERSION='$Id: foo2zjs-wrapper.in,v 1.105 2007/06/11 00:48:33 rick Exp $'
22
22
 
23
23
#
24
24
# Printer Notes:
39
39
BASENAME=`basename $PROGNAME`
40
40
PREFIX=/usr
41
41
SHARE=$PREFIX/share/foo2zjs
 
42
PATH=$PATH:/sw/bin:/opt/local/bin
42
43
 
43
44
#
44
45
#       Log the command line, for debugging and problem reports
241
242
shift `expr $OPTIND - 1`
242
243
 
243
244
#
 
245
# If there is an argument left, take it as the file to print.
 
246
# Else, the input comes from stdin.
 
247
#
 
248
if [ $# -ge 1 ]; then
 
249
    if [ "$LPJOB" = "" ]; then
 
250
        : # LPJOB="$1"
 
251
    fi
 
252
    exec < $1
 
253
fi
 
254
 
 
255
#
244
256
case "$QUALITY" in
245
257
0)
246
258
    GSOPTS="-dCOLORSCREEN $GSOPTS"
349
361
}
350
362
 
351
363
case "$PAPER" in
 
364
Custom*)
 
365
                #%%BeginFeature: *CustomPageSize True
 
366
                #216
 
367
                #360
 
368
                #0
 
369
                #0
 
370
                #0
 
371
                #pop pop pop pop pop
 
372
 
 
373
                TMPFILE=/tmp/cus$$
 
374
                cat >$TMPFILE
 
375
                exec <$TMPFILE
 
376
 
 
377
                XDIM=`head -n 1000 $TMPFILE | sed -n '/CustomPageSize/{n;p;}'`
 
378
                case "$XDIM" in
 
379
                ""|0*)
 
380
                    rm -f $TMPFILE
 
381
                    error "Custom page size XDIM != 1-99999"
 
382
                    ;;
 
383
                esac
 
384
                XDIM=`dc -e "$XDIM 1200* 72/p"`
 
385
 
 
386
                YDIM=`head -n 1000 $TMPFILE | sed -n '/CustomPageSize/{n;n;p;}'`
 
387
                case "$YDIM" in
 
388
                ""|0*)
 
389
                    rm -f $TMPFILE
 
390
                    error "Custom page size YDIM != 1-99999"
 
391
                    ;;
 
392
                esac
 
393
                YDIM=`dc -e "$YDIM 600* 72/p"`
 
394
                PAPER=256;        paper=letter;
 
395
                MEDIA=261
 
396
                set_clipping 2 100     2 100
 
397
                ;;
352
398
1|letter)       PAPER=1;        paper=letter;    XDIM="10200"; YDIM="6600"
353
399
                case "$MODEL" in
354
400
                0)      set_clipping 204 102    204 106;;
436
482
DIM="${XDIM}x${YDIM}"
437
483
 
438
484
#
439
 
# If there is an argument left, take it as the file to print.
440
 
# Else, the input comes from stdin.
441
 
#
442
 
if [ $# -ge 1 ]; then
443
 
    if [ "$LPJOB" = "" ]; then
444
 
        : # LPJOB="$1"
445
 
    fi
446
 
    exec < $1
447
 
fi
448
 
 
449
 
#
450
485
# Filter thru psnup if N-up printing has been requested
451
486
#
452
487
case $NUP in
617
652
#
618
653
if [ -x /usr/bin/logger ]; then
619
654
    logger -t "$BASENAME" -p lpr.info -- \
620
 
        "$GSBIN $PAPERSIZE -g$DIM -r$RES $GSDEV $GSOPT $GAMAFILE"
 
655
        "$GSBIN $PAPERSIZE -g$DIM -r$RES $GSDEV $GSOPTS $GAMMAFILE"
621
656
    logger -t "$BASENAME" -p lpr.info -- \
622
657
        "foo2zjs -r$RES -g$DIM -p$PAPER -m$MEDIA \
623
658
-n$COPIES -d$DUPLEX -s$SOURCE -z$MODEL $COLOR $CLIP_UL $CLIP_LR $CLIP_LOG \
633
668
        file="$ICCTMP.$i"
634
669
        [ -f $file ] && rm -f $file
635
670
    done
 
671
    [ -f "$TMPFILE" ] && rm -f $TMPFILE
636
672
fi
637
673
 
638
674
exit 0