#!/usr/bin/sh #(c) Copyright 1993 ~ 1995 Hewlett-Packard Company. All Rights Reserved. # #@(#) $Header: /users/hpnp/odyssey/repository/sh/net_ljx000.psh,v 1.84 1999/11/25 15:52:20 hpnp Exp $ #-------------------------------------------------------------------------- # USER CAUTION: Starting this version, there are other programs depending on # the statements planted here for various purposes. Your changes in this # file may render those information inaccurate. # # To customize this script, edit the following functions: # Init_variables - to initialize new variables # Parsing_Options - to parse the options you create, and set the variables # Output_PCL_Options and/or Output_PS_Options # - to output the PCL/PS commands according the variable # settings #-------------------------------------------------------------------------- #[ For WJA use #version E.10.05 #supports HP LaserJet 8100 Series #supports HP LaserJet 8000 Series #supports HP LaserJet 5000 Series #supports HP LaserJet 4050 Series #supports HP LaserJet 4000 Series #supports HP Mopier 320 # by Devu 1 oct 1999] # hpnpl sets the following: OS, PERSONALTY, PRINTMODEL, TEOJ, and BANNER HPNP=/opt/hpnp BIN=/usr/bin HPNPS=$HPNP/bin/hpnps # [Modified by Kumaresan for JPIU on 26th Sept '99. HPNP=/opt/hpnpl HPNPS=$HPNP/bin/hpnps # ] #[ Added by Devu to provide banner tray and duplex print options DUPPRINT="def" BANTRAY="def" # CHANGE BANNER TRAY BPAPER="def" # CHANGE BANNER PAPER SIZE # end of addition ] PSLEVEL="1" # CHANGE POSTSCRIPT LEVEL PERSONALTY="AUTO" # CHANGE LANGUAGE BAUDRATE="9600" PRINTMODEL="lj4000" # CHANGE PRINTER MODEL TEOJ="on" # CHANGE TRUE END OF JOB BANNER="yes" # CHANGE BANNER PAGE PRINTING SPACECHAR="_-" MPAGE=$HPNP/bin/mpage #Added by Ramki on 14th Oct 98 for PSNUP OS="UNKNOWN" if [ "$OS" = "UNKNOWN" ] then OS=`uname` fi TMP=/tmp # [ Modify by the Amit R. to solve the problem of security on 20th Feb. 1998 ID=/usr/bin/id CUT=/usr/bin/cut AWK=/usr/bin/awk MKDIR=/usr/bin/mkdir USERNAME=`$ID | $CUT -f1 -d" " | $CUT -f2 -d"(" | $CUT -f1 -d")"` # get user name if [ $USERNAME = "root" -o $USERNAME = "lp" ] # for only root and lp users then TMP=$HPNP/tmp else /usr/bin/sun > /dev/null 2>&1 if [ $? -eq 0 ] then # [ Modified by Amit Raval to fix the defect#57434 on 20th Apr. 1999 # HOME=`$AWK 'BEGIN { FS=":" } # {if ( $1 == UNAME) print $6 ; }' UNAME=$USERNAME /etc/passwd` # get home dir. from /etc/passwd JAHOME=`$AWK 'BEGIN { FS=":" } {if ( $1 == UNAME) { print $6 ; exit } }' UNAME=$USERNAME /etc/passwd` # get home dir. from /etc/passwd # ] else # [ Modified by Amit Raval to fix the defect#57434 on 20th Apr. 1999 # HOME=`$AWK -v UNAME=$USERNAME 'BEGIN { FS=":" } # {if ( $1 == UNAME) print $6 ; }' /etc/passwd` # get home dir. from /etc/passwd JAHOME=`$AWK -v UNAME=$USERNAME 'BEGIN { FS=":" } {if ( $1 == UNAME) { print $6 ; exit } }' /etc/passwd` # get home dir. from /etc/passwd # ] fi if [ -z "$JAHOME" ] # Handle the NIS issue then JAHOME=$HOME # Assign the env veriable HOME if JAHOME is null. fi # [Modified by Kumaresan for JPIU on 26th Sept '99. if [ ! -d $JAHOME/.jpiu ] then $MKDIR $JAHOME/.jpiu > /dev/null 2>&1 if [ $? -eq 0 ] then TMP=$JAHOME/.jpiu fi else TMP=$JAHOME/.jpiu fi fi # ] case "$OS" in HP-UX) patternlist="-e shar -e object -e executable -e archive -e library -e compressed" GREP="$BIN/grep $patternlist" esc="" PR="pr -F" log="/var/adm/lp/log" # log file for HP-UX 9.x ;; solaris | SOLARIS | SunOS) OS="SOLARIS" PR="pr -f" if [ -w "/var/spool/lp/logs/lpsched" ] then log="/var/spool/lp/logs/lpsched" # log file for SUN/Solaris else log="/dev/null" fi ;; esac # -------- Part I Functions ----------------- # This function is used to print the all options when -ooptions is provided # for lp all_options() { echo "@PJL ENTER LANGUAGE=PCL" echo "\033&k2G\c" echo " Description of available -o options for this script (net_ljx000) is in man page. See \"man net_ljx000\" for details. " echo "\033E\033%-12345X\c" } ##[ Function for setting banner tray from Q-configuration 23 sept 1999 Handle_Ban_Tray() { case "$BANTRAY" in 1) bannerpagesrc="4";; 2) bannerpagesrc="1";; 3) # feed from 3rd tray bannerpagesrc="5";; 4) if [ $PRINTMODEL = "lj8000" -o $PRINTMODEL = "lj8100-m320" ] then bannerpagesrc="20" else bannerpagesrc="8" fi ;; 5) if [ $PRINTMODEL = "lj8000" ] then bannerpagesrc="21" elif [ $PRINTMODEL = "lj8100-m320" ] then bannerpagesrc="8" fi ;; esac } ## end of banner tray function Devu ] ##[ Added by Devu to handle duplex print sept 23 1999 Handle_dupprint() { if [ "$DUPPRINT" = "yes" ] then duplex="vduplex" elif [ "$DUPPRINT" = "no" ] then duplex="simplex" fi } ##end of duplex Devu] # option summary; Alway printed on banner page # box coordinates are in 1/720ths of an inch # boxleftX= 4.6 inches from the right edge of page # boxrightX= 0.6 inches from the right edge of page # boxtopY= 2.92 inches from the bottom edge of page # boxbottomY= 2.92 inches from the bottom edge of page # The left margin is set with the "#L" command, I'm guessing # that there are around 10 columns per inch. partial_options() { # No banner page for A6, A5, JIS-B6, JIS-B5 and ISO B5 if [ "$paper" = "exec" ] # 7 1/4 x 10.5 then boxleftX=1908 #((725 - 460) * 72 ) / 10 boxrightX=4788 #((725 - 60 ) * 72 ) / 10 boxtopY=5349 #((1050 - 307 ) * 72 ) / 10 boxbottomY=7142 #(( 1050 - 58 ) * 72 ) / 10 echo "\033&a"`expr $boxtopY + 158 `"v28L\c" elif [ "$paper" = "letter" ] # 8.5 inch x 11 inch then boxleftX=2505 # ((850 - 502) * 72) / 10 boxrightX=5385 # ((850 - 102) * 72) / 10 boxtopY=5515 # ((1100 - 334) * 72) / 10 boxbottomY=7315 # ((1100 - 84) * 72) / 10 echo "\033&a"`expr $boxtopY + 158`"v36L\c" elif [ "$paper" = "ISOA3" ] # 297 mm x 420 mm (11.58" x 16.38") then boxleftX=5025 # (( 1158 - 460 ) * 72 ) / 10 boxrightX=7905 # (( 1158 - 60 ) * 72 ) / 10 boxtopY=9691 # (( 1638 - 292 ) * 72 ) / 10 boxbottomY=11491 # (( 1638 - 42 ) * 72 ) / 10 echo "\033&a"`expr $boxtopY + 158 `"v71L\c" elif [ "$paper" = "ISOA4" ] # 210 mm x 297 mm (8.19 x 11.58) then boxleftX=2584 # (( 819 - 460 ) * 72 ) / 10 boxrightX=5464 # (( 819 - 60 ) * 72 ) / 10 boxtopY=5968 # (( 1158 - 329) * 72 ) / 10 boxbottomY=7761 # (( 1158 - 80 ) * 72 ) / 10 echo "\033&a"`expr $boxtopY + 158 `"v37L\c" elif [ "$paper" = "legal" ] # 8.5 x 14 then boxleftX=2808 # (( 850 - 460 ) * 72 ) / 10 boxrightX=5688 # (( 850 - 60 ) * 72 ) / 10 boxtopY=7812 # (( 1400 - 315 ) * 72 ) / 10 boxbottomY=9604 # (( 1400 - 66 ) * 72 ) / 10 echo "\033&a"`expr $boxtopY + 158 `"v40L\c" elif [ "$paper" = "11x17" ] then boxleftX=4608 # (( 1100 - 460 ) * 72 ) / 10 boxrightX=7488 # (( 1100 - 60 ) * 72 ) / 10 boxtopY=9849 # (( 1700 - 332) * 72 ) / 10 boxbottomY=11649 # (( 1700 - 82 ) * 72 ) / 10 echo "\033&a"`expr $boxtopY + 158 `"v65L\c" elif [ "$paper" = "ledger" ] # 11x17 inches then boxleftX=4608 # (( 1100 - 460 ) * 72 ) / 10 boxrightX=7488 # (( 1100 - 60 ) * 72 ) / 10 boxtopY=9849 # (( 1700 - 332) * 72 ) / 10 boxbottomY=11649 # (( 1700 - 82 ) * 72 ) / 10 echo "\033&a"`expr $boxtopY + 158 `"v65L\c" elif [ "$paper" = "JISB4" ] # 257 mm x 364 mm (10.02" x 14.33") then boxleftX=3902 # ((1002 - 460 ) * 72 ) / 10 boxrightX=6782 # ((1002 - 60 ) * 72 ) / 10 boxtopY=7992 # ((1433 - 323 ) * 72 ) / 10 boxbottomY=9784 # ((1433 - 74) * 72 ) / 10 echo "\033&a"`expr $boxtopY + 158 `"v55L\c" elif [ "$paper" = "JISB5" ] # 182 mm x 257 mm (7.1" x 10.02") then boxleftX=1800 # (( 717 - 467 ) * 72 ) / 10 boxrightX=4680 # (( 717 - 67 ) * 72 ) / 10 boxtopY=4737 # (( 1012 - 354 ) * 72 ) / 10 boxbottomY=6530 # ((1012 - 105 ) * 72 ) / 10 echo "\033&a"`expr $boxtopY + 158 `"v26L\c" # [ Added by Raju on 28-09-98 to support lj8100-m320 elif [ "$paper" = "8K" ] # 10.75" x 15.5" then # [ Modified by Vijay for the support of 8K Banner page on 28th Oct 1998 # boxleftX=2505 # ((1075 - # boxrightX=5385 # 5688 # boxtopY=5518 # boxbottomY=7315 # 7258 boxleftX=4284 # ((1075 - 480) * 72) / 10 boxrightX=7164 # ((1075 - 80) * 72) / 10 boxtopY=8568 # ((1550 - 360) * 72) / 10 boxbottomY=10368 # ((1550 - 110 ) * 72) / 10 echo "\033&a"`expr $boxtopY + 158`"v61L\c" # End of change by Vijay ] elif [ "$paper" = "16K" ] # 7.75" x 10.75" then # [ Modified by Vijay for the support of 16K Banner page on 28th Oct 1998 # boxleftX=2505 # boxrightX=5385 # 5688 # boxtopY=5518 # boxbottomY=7315 # 7258 boxleftX=2124 # ((775 - 480) * 72 ) / 10 # boxleftX=2412 # ((775 - 440) * 72 ) / 10 # boxrightX=5292 # ((775 - 40) * 72 ) / 10 boxrightX=5004 # ((775 - 80) * 72 ) / 10 boxtopY=5148 # ((1075 - 360)* 72 ) / 10 boxbottomY=6948 # ((1075 - 110) * 72 ) / 10 echo "\033&a"`expr $boxtopY + 158 `"v31L\c" # End of change by Vijay ] elif [ "$paper" = "JISEXEC" ] # 8.5" x 13" then # [ Modified by Vijay for the support of JISEXEC Banner page on 28th Oct 1998 # boxleftX=2505 # boxrightX=5385 # 5688 # boxtopY=5518 # boxbottomY=7315 # 7258 boxleftX=2520 # ((850 - 500) * 72) / 10 boxrightX=5400 # ((850 - 100) * 72) / 10 boxtopY=6768 # ((1300 - 360) * 72) / 10 boxbottomY=8568 # ((1300 - 110) * 72) / 10 echo "\033&a"`expr $boxtopY + 158 `"v37L\c" # End of change by Vijay ] # End of addition by Raju ] else # letter boxleftX=2505 # 2808 boxrightX=5385 # 5688 boxtopY=5518 boxbottomY=7315 # 7258 echo "\033&a"`expr $boxtopY + 158`"v36L\c" fi echo "********** Option Summary **********" # [ Modified by Vijay to solve the banner pahe problem in lj8100_m320 on 5/10/98 # echo " (See \"man net_ljx000\" for details)\n" if [ "$PRINTMODEL" = "lj8100-m320" ] then echo " (See \"man net_ljx000\" for details)" else echo " (See \"man net_ljx000\" for details)\n" fi # End of change by Vijay ] echo "\033&k2S\c" # use compressed font echo "auto (default), postscript, pcl, hpgl2, hpgl2_p, raw, relay" # [ Modified by Amit Raval to support for LaserJet 8000 printer on 17th Apr. 1998 if [ $PRINTMODEL = "lj8000" ] then echo "manual, manenv, tray1, tray2, tray3, tray4, tray5" # echo "bin1, bin2, mailbin, mtype" echo "bin1, bin2, mtype" echo "legal, letter, exec, ledger/11x17 A3, A4, A5, B5-ISO" echo "B4-JIS, B5-JIS, com10, C5, DL, monarc, PostCard/PostCardD" echo "dpi#, simplex, duplex, hduplex, topaz, yb, nb, job, nojob" # [ Modified by Raju elif [ $PRINTMODEL = "lj8100-m320" ] then echo "manual, manenv, tray1, tray2, tray3, tray4, tray5" echo "bin1, bin2, mtype" echo "legal, letter, exec, ledger/11x17, 8K, 16K, A3, A4, A5, B5-ISO" echo "B4-JIS, B5-JIS, com10, C5, DL, monarc, JIS-EXEC, PostCardD" echo "dpi#, simplex, duplex, hduplex, topaz, yb, nb, job, nojob" # [ Modified by Vijay to on 3/10/98 to solve the banner page problem # echo "proofnhold/pnh private#" echo "proofnhold/pnh, private#, fuser, collate" # End of change by Vijay ] # End of Modification by Raju ] else echo "manual, tray1, tray2, tray3, bin1, bin2, mtype" echo "legal, letter, exec, ledger/11x17 A3, A4, A5, A6, B5-ISO" echo "com10, C5, DL, monarc PostCardS, PostCard/PostCardD" echo "B4-JIS, B5-JIS, B6-JIS topaz, yb, nb, job, nojob" echo "dpi#, fuser simplex, duplex, hduplex" # [ Modified by Amit Raval to support for LaserJet 8000 printer on 17th Apr. 1998 fi # ] echo "2up, 2+,4up(pcl-hpux only), portrait, landscape, quality" echo "srbb#, srb#, sre#, tondensity, econo# (#=on/off)" echo "For PS : wmnum#, wmstr, ascii, ps1, ps2" echo "For PCL : text, ln66, stye#, italic, condensed, condensedi" echo "c, 10, 12, lpi# height#, weight#, medium, bold, ebold, type#" echo "\033&a"$boxtopY"v"$boxleftX"H\033*c4h1800v0P\033*c2880h4v0P\c" echo "\033&a"$boxbottomY"v"$boxleftX"H\033*c2880h4v0P\c" echo "\033&a"$boxtopY"v"$boxrightX"H\033*c4h1800v0P\c" } # PCL banner do_pcl_banner() { # Print the standard header # where does the paper go to if [ $outb != "def" ] then echo "@PJL SET OUTBIN=$outb" echo "@PJL ENTER LANGUAGE=PCL" else echo "@PJL ENTER LANGUAGE=PCL" if [ $mediadest != "def" ] then echo "\033&l${mediadest}G\c" fi fi # where does the paper come from if [ "$bannerpagesrc" != "def" ] then echo "\033&l${bannerpagesrc}H\c" else case "$mediasrc" in # [ Modified by Amit Raval to support for LaserJet 8000 printer on 17th Apr. 1998 # 1 | 4 | 5 | 8) 1 | 4 | 5 | 8 | 20 | 21 | 3) # ] echo "\033&l${mediasrc}H\c";; esac fi # the width of the shaded box is the width of the page - 0.7 inches # boxwidth is given in 1/720ths of an inch boxwidth=5616 boxtopY=120 boxbottomY=1800 # [ Modified by Devu to check for change in banner paper size. # If true temparorily use it. Nov 3 1999 if [ "$BPAPER" != "def" ] then TMPPAPER=$paper paper=$BPAPER fi # end Devu ] # No Banner page printing for A6, A5 and JIS-B6 case "$paper" in ISOA3) # 297 mm x 420 mm (11.58" x 16.38") echo "\033&l27A\c" boxbottomY=1920 boxtopY=240 echo "\033&a240v\c" boxwidth=7833;; ISOA4) # 210 mm x 297 mm (8.19" x 11.58") echo "\033&l26A\c" boxwidth=5493 echo "\033&a240v\c" boxbottomY=1920 boxtopY=240;; exec) echo "\033&l1A\c" # 7 1/4 x 10.5 boxtopY=180 boxbottomY=1860 echo "\033&a220v\c" # Set vertical start pos boxwidth=4737;; legal) echo "\033&l3A\c" # 8.5 x 14 boxtopY=180 boxbottomY=1855 echo "\033&a220v\c" # Set vertical start pos boxwidth=5616;; letter) echo "\033&l2A\c" boxwidth=5616 boxtopY=180 echo "\033&a220v\c" # Set vertical start pos boxbottomY=1860 ;; ledger | 11x17) echo "\033&l6A\c" boxtopY=180 echo "\033&a220v\c" # Set vertical start pos boxbottomY=1860 boxwidth=7416;; JISB4) echo "\033&l46A\c" # 257x364mm (10.02"x14.33") boxtopY=180 boxbottomY=1855 echo "\033&a220v\c" # Set vertical start pos boxwidth=6840;; JISB5) echo "\033&l45A\c" # 182x257mm (7.17"x10.12") echo "\033&a150v\c" # Set vertical start pos boxwidth=4700;; # [ Added by Raju to on 28/09/98 to support lj8100-m320 8K) echo "\033&l19A\c" # 257x364mm (10.02"x14.33") boxtopY=240 boxbottomY=1920 echo "\033&a220v\c" # Set vertical start pos # [ Modified by Vijay for the support of 8K Banner page on 28th Oct 1998 # boxwidth=6840;; boxwidth=7164;; # End of change by Vijay ] 16K) echo "\033&l17A\c" # 257x364mm (10.02"x14.33") boxtopY=240 boxbottomY=1920 echo "\033&a220v\c" # Set vertical start pos # [ Modified by Vijay for the support of 16K Banner page on 28th Oct 1998 # boxwidth=6840;; boxwidth=5004;; # End of change by Vijay ] JISEXEC) echo "\033&l18A\c" # 257x364mm (10.02"x14.33") boxtopY=240 boxbottomY=1920 echo "\033&a220v\c" # Set vertical start pos # [ Modified by Vijay for the support of JISEXEC Banner page on 28th Oct 1998 # boxwidth=6840 boxwidth=5400;; # End of change by Vijay ] # End of addition by Raju ] def) echo "\033&l2A\c" # set def as letter boxwidth=5616 boxtopY=180 echo "\033&a220v\c" # Set vertical start pos boxbottomY=1860 ;; # Postcard and envelope do not print banner page esac echo "\033&k2G\033&l0O\c" # always in portrait mode if [ "$OS" = "HP-UX" ] then echo "\033)8U\033)s1p60v1s0b16901T\n $user\033)s14v0S" user1=`pwget -n $user | line | cut -d: -f5` if [ -n "$user1" ] then echo "\n\t\t\t\t\tUser: $user1\n" else echo "\n\t\t\t\t\tUser: (No User Info in /etc/passwd)\n" fi else # assume it's Solaris or others? userXip=`echo $user | awk -F! '{print$2}' ` echo "\033)8U\033)s1p60v1s0b16901T\n $userXip\033)s14v0S" user1=`echo $user | line | cut -d! -f2` syst=`echo $user | line | cut -d! -f1` echo "\n" fi echo "\t\t\t\t\tRequest: $jobid from $syst\n" if [ "$jrpg" -eq 0 ] then echo "\t\t\t\t\tOptions: $options" fi if [ -n "$invalidopt" ] then echo "\t\t\t\t\tInvalid Options: $invalidopt\n" else echo "" fi if [ -n "$title" ] then # [ Modified by Amit R Raval to solve the problem of not aligning title option # when "-t" option is given with the lp command. # # [Modified by Amit R to add one line feed aftre the title on 18th Dec 97. # # echo "\t\t\t\t\tTitle: $title" # echo "\t\t\t\t\tTitle: $title\n" # # ] if [ "$OS" = "HP-UX" ] then echo "\t\t\t\t\tTitle: $title" else echo "\t\t\t\t\tTitle: $title\n" fi # ] else echo "" fi date1=`date` echo " $date1" # jrpg=3 # test that recover message fits on all paper sizes if [ "$jrpg" -ne 0 ] then echo "\033&a2520V\c" echo "\033)8U\033)s1p30v1S\c" echo " This job is recovered from page $jrpg !!\n\n\n\n" echo " (Note:\t There may be a few \n\n\n\t\t pages duplicated)" fi echo "\c" # draw box echo "\033&l0E\c" # left and top line #echo "\033&a120v0H\033*c4h1680v0P\033*c"$boxwidth"/720h4v0P\c" echo "\033&a"$boxtopY"v0H\033*c4h1680v0P\c" echo "\033&a"$boxtopY"v0H\033*c"$boxwidth"h4v0P\c" # bottom #echo "\033&a1800v0H\033*c"$boxwidth"h4v0P\c" echo "\033&a"$boxbottomY"v0H\033*c"$boxwidth"h4v0P\c" # right #echo "\033&a120v"$boxwidth"H\033*c4h1680v0P\c" echo "\033&a"$boxtopY"v"$boxwidth"H\033*c4h1680v0P\c" # shade the area # echo "\033&l0e8C\033&a0v0H\c" # echo "\033*c"$boxwidth"h1800v10g2P\c" echo "\033&l0e8C\033&a"$boxtopY"v0H\c" echo "\033*c"$boxwidth"h1680v10g2P\c" partial_options if [ -z "$debug" ] then if [ -r $HPNP/etc/hplogo.pcl ] then echo "\033&a140v"$boxwidth"H\c" cat $HPNP/etc/hplogo.pcl fi fi echo "\033E\033%-12345X\c" # [ Modified by Devu to get back to paper size in case # of different size for banner. Nov 3 1999 if [ "$BPAPER" != "def" ] then paper=$TMPPAPER fi #end Devu ] } # #------------------ pslp() { # pslp --- PostScript emulation of LaserJet default mode - 82 chars, 66 lines # # #[ Added by Ramki for PSNUP on 6 Nov 98 if [ -n "$psnup" ] then psnupfile=$1 #Added by Ramki for supporting PSNUP else psnupfile=$file fi #] # Put out the header #[ Modified by Devu below to add if condition for psnup to fix # n-up ascii print of a PS file: Nov 25 1999 if [ -z "$psnup" ] then # end Devu cat <<-EnD %!PS-Adobe-2.0 %%Title: pslp % /$font findfont 11.5 scalefont setfont /inch {72 mul} def /deltay 10.5 66.5 div inch def % allow .25 inch margins all sides /leftmargin .4 inch def /topmargin 10.75 inch deltay sub def /gotop { leftmargin topmargin moveto /linecount 0 def } def /checkpage { linecount 66 ge { showpage gotop } if % end of page? /linecount linecount 1 add def % incr linecount } def /crlf { currentpoint exch pop deltay sub leftmargin exch moveto } def gotop %%EndProlog pslp EnD else # Devu echo " \c" fi # Put out the text # expand tabs: #[ Modified by Ramki for PSNUP support on 6/11/98 #expand $file | expand $psnupfile | #] expand $file | # delete control chars unknown to PS: tr -s '[\001-\011][\016-\037]' '@' | # escape chars special to PS # and format each line as # checkpage (This is the text.) show crlf if [ -z "$psnup" ] then sed -e 's/\\/\\\\/g' -e 's/[()]/\\&/g' \ -e 's/^/checkpage (/' -e 's/$/) show crlf/' else sed -e 's/\\/\\\\/g' -e 's/[()]/\\&/g' fi if [ -z "$psnup" ] then cat <<-'EnD' %%Trailer pslp showpage EnD fi # end of if conditions for psnup by Devu ] } # end of function pslp #----------------------------------------------------------- # To set the Fuser Mode for media. Added three additional values for fuser # option for suporting lj8100-320. They are high1, high2 and high3. # Vellum (Media Type) is not supported for lj8100-m320. #----------------------------------------------------------- Fuser_mode_set() { case "$mtype" in Plain) case "$fuser" in normal) echo "@PJL DMINFO ASCIIHEX=04000701040108030104080101";; low) echo "@PJL DMINFO ASCIIHEX=04000701040108030104080102";; # [ Modified by Raju on 04/09/98 to support lj8100-m320 # high) # echo "@PJL DMINFO ASCIIHEX=04000701040108030104080103";; # vellum) # echo "@PJL DMINFO ASCIIHEX=04000701040108030104080104";; high | high1) echo "@PJL DMINFO ASCIIHEX=04000701040108030104080103";; vellum | high2) echo "@PJL DMINFO ASCIIHEX=04000701040108030104080104";; high3) if [ $PRINTMODEL = "lj8100-m320" ] then echo "@PJL DMINFO ASCIIHEX=04000701040108030104080105" fi;; # End of modification by Raju ] esac ;; Preprinted) case "$fuser" in normal) echo "@PJL DMINFO ASCIIHEX=04000701040108030204080101";; low) echo "@PJL DMINFO ASCIIHEX=04000701040108030204080102";; # [ Modified by Raju on 04/09/98 to support lj8100-m320 # high) # echo "@PJL DMINFO ASCIIHEX=04000701040108030204080103";; # vellum) # echo "@PJL DMINFO ASCIIHEX=04000701040108030204080104";; high | high1) echo "@PJL DMINFO ASCIIHEX=04000701040108030204080103";; vellum | high2) echo "@PJL DMINFO ASCIIHEX=04000701040108030204080104";; high3) if [ $PRINTMODEL = "lj8100-m320" ] then echo "@PJL DMINFO ASCIIHEX=04000701040108030204080105" fi;; # End of modification by Raju ] esac ;; Letterhead) case "$fuser" in normal) echo "@PJL DMINFO ASCIIHEX=04000701040108030304080101";; low) echo "@PJL DMINFO ASCIIHEX=04000701040108030304080102";; # [ Modified by Raju on 04/09/98 to support lj8100-m320 # high) # echo "@PJL DMINFO ASCIIHEX=04000701040108030304080103";; # vellum) # echo "@PJL DMINFO ASCIIHEX=04000701040108030304080104";; high | high1) echo "@PJL DMINFO ASCIIHEX=04000701040108030304080103";; vellum | high2) echo "@PJL DMINFO ASCIIHEX=04000701040108030304080104";; high3) if [ $PRINTMODEL = "lj8100-m320" ] then echo "@PJL DMINFO ASCIIHEX=04000701040108030304080105" fi;; # End of modification by Raju ] esac ;; Transparency) case "$fuser" in normal) echo "@PJL DMINFO ASCIIHEX=04000701040108030404080101";; low) echo "@PJL DMINFO ASCIIHEX=04000701040108030404080102";; # [ Modified by Raju on 04/09/98 to support lj8100-m320 # high) # echo "@PJL DMINFO ASCIIHEX=04000701040108030404080103" ;; # vellum) # echo "@PJL DMINFO ASCIIHEX=04000701040108030404080104" ;; high | high1) echo "@PJL DMINFO ASCIIHEX=04000701040108030404080103";; vellum | high2) echo "@PJL DMINFO ASCIIHEX=04000701040108030404080104";; high3) if [ $PRINTMODEL = "lj8100-m320" ] then echo "@PJL DMINFO ASCIIHEX=04000701040108030404080105" fi;; # End of modification by Raju ] esac ;; Prepunched) case "$fuser" in normal) echo "@PJL DMINFO ASCIIHEX=04000701040108030504080101" ;; low) echo "@PJL DMINFO ASCIIHEX=04000701040108030504080102" ;; # [ Modified by Raju on 04/09/98 to support lj8100-m320 # high) # echo "@PJL DMINFO ASCIIHEX=04000701040108030504080103" ;; # vellum) # echo "@PJL DMINFO ASCIIHEX=04000701040108030504080104" ;; high | high1) echo "@PJL DMINFO ASCIIHEX=04000701040108030504080103";; vellum | high2) echo "@PJL DMINFO ASCIIHEX=04000701040108030504080104";; high3) if [ $PRINTMODEL = "lj8100-m320" ] then echo "@PJL DMINFO ASCIIHEX=04000701040108030504080105" fi;; # End of modification by Raju ] esac ;; Labels) case "$fuser" in normal) echo "@PJL DMINFO ASCIIHEX=04000701040108030604080101" ;; low) echo "@PJL DMINFO ASCIIHEX=04000701040108030604080102" ;; # [ Modified by Raju on 04/09/98 to support lj8100-m320 # high) # echo "@PJL DMINFO ASCIIHEX=04000701040108030604080103" ;; # vellum) # echo "@PJL DMINFO ASCIIHEX=04000701040108030604080104" ;; high | high1) echo "@PJL DMINFO ASCIIHEX=04000701040108030604080103";; vellum | high2) echo "@PJL DMINFO ASCIIHEX=04000701040108030604080104";; high3) if [ $PRINTMODEL = "lj8100-m320" ] then echo "@PJL DMINFO ASCIIHEX=04000701040108030604080105" fi;; # End of modification by Raju ] esac ;; Bond) case "$fuser" in normal) echo "@PJL DMINFO ASCIIHEX=04000701040108030704080101" ;; low) echo "@PJL DMINFO ASCIIHEX=04000701040108030704080102" ;; # [ Modified by Raju on 04/09/98 to support lj8100-m320 # high) # echo "@PJL DMINFO ASCIIHEX=04000701040108030704080103" ;; # vellum) # echo "@PJL DMINFO ASCIIHEX=04000701040108030704080104" ;; high | high1) echo "@PJL DMINFO ASCIIHEX=04000701040108030704080103";; vellum | high2) echo "@PJL DMINFO ASCIIHEX=04000701040108030704080104";; high3) if [ $PRINTMODEL = "lj8100-m320" ] then echo "@PJL DMINFO ASCIIHEX=04000701040108030704080105" fi;; # End of modification by Raju ] esac ;; Recycled) case "$fuser" in normal) echo "@PJL DMINFO ASCIIHEX=04000701040108030804080101" ;; low) echo "@PJL DMINFO ASCIIHEX=04000701040108030804080102" ;; # [ Modified by Raju on 04/09/98 to support lj8100-m320 # high) # echo "@PJL DMINFO ASCIIHEX=04000701040108030804080103" ;; # vellum) # echo "@PJL DMINFO ASCIIHEX=04000701040108030804080104" ;; high | high1) echo "@PJL DMINFO ASCIIHEX=04000701040108030804080103";; vellum | high2) echo "@PJL DMINFO ASCIIHEX=04000701040108030804080104";; high3) if [ $PRINTMODEL = "lj8100-m320" ] then echo "@PJL DMINFO ASCIIHEX=04000701040108030804080105" fi;; # End of modification by Raju ] esac ;; Color) case "$fuser" in normal) echo "@PJL DMINFO ASCIIHEX=04000701040108030904080101" ;; low) echo "@PJL DMINFO ASCIIHEX=04000701040108030904080102" ;; # [ Modified by Raju on 04/09/98 to support lj8100-m320 # high) # echo "@PJL DMINFO ASCIIHEX=04000701040108030904080103" ;; # vellum) # echo "@PJL DMINFO ASCIIHEX=04000701040108030904080104" ;; high | high1) echo "@PJL DMINFO ASCIIHEX=04000701040108030904080103";; vellum | high2) echo "@PJL DMINFO ASCIIHEX=04000701040108030904080104";; high3) if [ $PRINTMODEL = "lj8100-m320" ] then echo "@PJL DMINFO ASCIIHEX=04000701040108030904080105" fi;; # End of modification by Raju ] esac ;; CardStock) case "$fuser" in normal) echo "@PJL DMINFO ASCIIHEX=04000701040108030A04080101" ;; low) echo "@PJL DMINFO ASCIIHEX=04000701040108030A04080102" ;; # [ Modified by Raju on 04/09/98 to support lj8100-m320 # high) # echo "@PJL DMINFO ASCIIHEX=04000701040108030A04080103" ;; # vellum) # echo "@PJL DMINFO ASCIIHEX=04000701040108030A04080104" ;; high | high1) echo "@PJL DMINFO ASCIIHEX=04000701040108030A04080103";; vellum | high2) echo "@PJL DMINFO ASCIIHEX=04000701040108030A04080104";; high3) if [ $PRINTMODEL = "lj8100-m320" ] then echo "@PJL DMINFO ASCIIHEX=04000701040108030A04080105" fi;; # End of modification by Raju ] esac ;; Rough) case "$fuser" in normal) echo "@PJL DMINFO ASCIIHEX=04000701040108030B04080101" ;; low) echo "@PJL DMINFO ASCIIHEX=04000701040108030B04080102" ;; # [ Modified by Raju on 04/09/98 to support lj8100-m320 # high) # echo "@PJL DMINFO ASCIIHEX=04000701040108030B04080103" ;; # vellum) # echo "@PJL DMINFO ASCIIHEX=04000701040108030B04080104" ;; high | high1) echo "@PJL DMINFO ASCIIHEX=04000701040108030B04080103";; vellum | high2) echo "@PJL DMINFO ASCIIHEX=04000701040108030B04080104";; high3) if [ $PRINTMODEL = "lj8100-m320" ] then echo "@PJL DMINFO ASCIIHEX=04000701040108030B04080105" fi;; # End of modification by Raju ] esac ;; Vellum) case "$fuser" in normal) echo "@PJL DMINFO ASCIIHEX=04000701040108030C04080101" ;; low) echo "@PJL DMINFO ASCIIHEX=04000701040108030C04080102" ;; high) echo "@PJL DMINFO ASCIIHEX=04000701040108030C04080103" ;; vellum) echo "@PJL DMINFO ASCIIHEX=04000701040108030C04080104" ;; esac ;; User-defined1) case "$fuser" in normal) echo "@PJL DMINFO ASCIIHEX=04000701040108030D04080101" ;; low) echo "@PJL DMINFO ASCIIHEX=04000701040108030D04080102" ;; # [ Modified by Raju on 04/09/98 to support lj8100-m320 # high) # echo "@PJL DMINFO ASCIIHEX=04000701040108030D04080103" ;; # vellum) # echo "@PJL DMINFO ASCIIHEX=04000701040108030D04080104" ;; high | high1) echo "@PJL DMINFO ASCIIHEX=04000701040108030D04080103";; vellum | high2) echo "@PJL DMINFO ASCIIHEX=04000701040108030D04080104";; high3) if [ $PRINTMODEL = "lj8100-m320" ] then echo "@PJL DMINFO ASCIIHEX=04000701040108030D04080105" fi;; # End of modification by Raju ] esac ;; User-defined2) case "$fuser" in normal) echo "@PJL DMINFO ASCIIHEX=04000701040108030E04080101" ;; low) echo "@PJL DMINFO ASCIIHEX=04000701040108030E04080102" ;; # [ Modified by Raju on 04/09/98 to support lj8100-m320 # high) # echo "@PJL DMINFO ASCIIHEX=04000701040108030E04080103" ;; # vellum) # echo "@PJL DMINFO ASCIIHEX=04000701040108030E04080104" ;; high | high1) echo "@PJL DMINFO ASCIIHEX=04000701040108030E04080103";; vellum | high2) echo "@PJL DMINFO ASCIIHEX=04000701040108030E04080104";; high3) if [ $PRINTMODEL = "lj8100-m320" ] then echo "@PJL DMINFO ASCIIHEX=04000701040108030E04080105" fi;; # End of modification by Raju ] esac ;; User-defined3) case "$fuser" in normal) echo "@PJL DMINFO ASCIIHEX=04000701040108030F04080101" ;; low) echo "@PJL DMINFO ASCIIHEX=04000701040108030F04080102" ;; # [ Modified by Raju on 04/09/98 to support lj8100-m320 # high) # echo "@PJL DMINFO ASCIIHEX=04000701040108030F04080103" ;; # vellum) # echo "@PJL DMINFO ASCIIHEX=04000701040108030F04080104" ;; high | high1) echo "@PJL DMINFO ASCIIHEX=04000701040108030F04080103";; vellum | high2) echo "@PJL DMINFO ASCIIHEX=04000701040108030F04080104";; high3) if [ $PRINTMODEL = "lj8100-m320" ] then echo "@PJL DMINFO ASCIIHEX=04000701040108030F04080105" fi;; # End of modification by Raju ] esac ;; User-defined4) case "$fuser" in normal) echo "@PJL DMINFO ASCIIHEX=04000701040108031004080101" ;; low) echo "@PJL DMINFO ASCIIHEX=04000701040108031004080102" ;; # [ Modified by Raju on 04/09/98 to support lj8100-m320 # high) # echo "@PJL DMINFO ASCIIHEX=04000701040108031004080103" ;; # vellum) # echo "@PJL DMINFO ASCIIHEX=04000701040108031004080104" ;; high | high1) echo "@PJL DMINFO ASCIIHEX=04000701040108031004080103";; vellum | high2) echo "@PJL DMINFO ASCIIHEX=04000701040108031004080104";; high3) if [ $PRINTMODEL = "lj8100-m320" ] then echo "@PJL DMINFO ASCIIHEX=04000701040108031004080105" fi;; # End of modification by Raju ] esac ;; User-defined5) case "$fuser" in normal) echo "@PJL DMINFO ASCIIHEX=04000701040108031104080101" ;; low) echo "@PJL DMINFO ASCIIHEX=04000701040108031104080102" ;; # [ Modified by Raju on 04/09/98 to support lj8100-m320 # high) # echo "@PJL DMINFO ASCIIHEX=04000701040108031104080103" ;; # vellum) # echo "@PJL DMINFO ASCIIHEX=04000701040108031104080104" ;; high | high1) echo "@PJL DMINFO ASCIIHEX=04000701040108031104080103";; vellum | high2) echo "@PJL DMINFO ASCIIHEX=04000701040108031104080104";; high3) if [ $PRINTMODEL = "lj8100-m320" ] then echo "@PJL DMINFO ASCIIHEX=04000701040108031104080105" fi;; # *) invalidopt="$invalidopt $i";; # comment by Amit on19/11/98 # End of modification by Raju ] esac ;; esac } ### End of Fuser_mode_set() #---------------------------- # initialize the variables #---------------------------- Init_variables() { lang_user=$PERSONALTY # control if Resolve_lang() should be called lang=$PERSONALTY # determine which languague should be used lang_specify="" outmode_specify="" outputmode_specify="" psnup="" #Added by Ramki on 14th Oct 98 for PSNUP invalidopt="" # used for specifying invalid option listopt="" # To list all options # For internal use debug="" nroff="" reverse="" banner=$BANNER ThreeHoles="" # CHANGE DEFAULT 3HOLE OPTION ln66="" eolwrap="no" dividing="" # CHANGE DEFAULE PAGE DIVIDE MODE , '-hh' for 2+, '-h' # for 2up and '-q' for 4up manuald="" outputmode="cooked" omode_user="cooked" bannerpagesrc="def" # CHANGE DEFAULT BANNER PAGE SOURCE ascii="" font="Courier" # CHANGE DEFAULT FONT FOR POSTSCRIPT resolution="def" # CHANGE DEFAULT RESOLUTION econo="def" # CHANGE DEFAULT ECONO MODE duplex="def" # CHANGE DEFAULT DUPLEX MODE mediasrc="def" # CHANGE DEFAULT MEDIA SOURCE mediadest="def" # CHANGE DEFAULT MEDIA DESTINATION ONLY FOR PCL FILE outb="def" # CHANGE DEFAULT MEDIA DESTINATION outbstring="OPTIONALOUTBIN" mtype="def" # CHANGE DEFAULT MEDIA TYPE fuser="def" # CHANGE DEFAULT FUSER MODE tdensity="def" # CHANGE DEFAULT TONER DENSITY mtypestring="\033&n" pescfile="no" # CHANGE DEFAULT PESC MODE (pesc option) orientation="def" # CHANGE DEFAULT ORIENTATION paper="def" # CHANGE DEFAULT PAPER SIZE length="def" length2up="-l66" pitch="def" #pitch="10.7" hsi="def" lpagelen="def" textlen="def" lmargin="def" rmargin="def" tmargin="def" italic="" spacing="def" lpi="def" vsi="def" charset="def" height="def" style="def" typeface="def" weight="def" width2up=178 # for silent run use startpg=1 # CHANGE DEFAULT START PAGE (srb option) jrpg=0 # CHANGE JOBRECOVERY START PAGE extraEOJ="false" endpg=0 # CHANGE DEFAULT END PAGE (are option) printqty="" # CHANGE DEFAULT QUALITY (quality option) rendermode="" # CHANGE DEFAULT RENDER (COLOR-GRAY) MODE mediatype="" # CHANGE DEFAULT MEDIA TYPE rotate="" # CHANGE DEFAULT ROTATE MODE staple="def" # CHANGE DEFAULT STAPLE MODE topaz="def" # CHANGE DEFAULT TOPAZ MODE loffset="def" # [ Added by Raju on 04/09/98 to support lj8100-m320 # For Job Management hold="def" # CHANGE DEFAULT PROOF AND HOLD MODE holdtype="def" # CHANGE DEFAULT JOB HOLD TYPE (private option) holdkey="" # CHANGE JOB HOLD KEY VALUE (private option) # For Collation collate="on" # CHANGE DEFAULT COLLATE MODE # For Watermark printing wmstdstr="def" # CHANGE DEFAULT WATER MARK STRING FROM 1 TO 15 # [ Modified by Amit Raval for fixing the defect of printing 'def' on 20/11/98. # wname="def" wname="" # CHANGE DEFAULT WATER MARK STRING # ] # End of addition by Raju ] } # end of init_variables() #----------------------------------- # Parse all the options to lp #----------------------------------- Parsing_Options() { for i in $options do case "$i" in debugm[/a-zA-Z0-9.-_]*) debug="yes";; debugm) debug="yes";; staple) staple="yes";; topaz) if [ $copies -gt 1 ] then topaz="yes" fi;; # [ Commented by Raju this is not used in the code # notopaz) # topaz="no";; # End ] ps1) PSLEVEL="1";; ps2) PSLEVEL="2";; auto) lang="AUTO" lang_user="AUTO";; relay) for file in $files; do cat "$file" done exit 0;; postscript | post ) lang="PS" lang_user="PS";; pcl ) lang_specify="yes" lang="PCL" lang_user="PCL";; hpgl2) lang_specify="yes" outputmode_specify="yes" lang="PCL" lang_user="HPGL2" outputmode="raw";; hpgl2_p) lang_specify="yes" outputmode_specify="yes" lang="PCL" lang_user="HPGL2_P" outputmode="raw";; r | raw) outputmode_specify="yes" outputmode="raw";; text) lang_specify="yes" outputmode_specify="yes" lang="PCL" lang_user="PCL" outputmode="cooked";; # file type pesc) pescfile="yes";; # Job Control srb[0-9]*) startpg="`echo "$i" | sed 's/^srb//'`";; srbb[0-9]*) jrpg="`echo "$i" | sed 's/^srbb//'`";; sre[0-9]*) endpg="`echo "$i" | sed 's/^sre//'`";; dpi[03-6]* ) # 3 | 300, 6 | 600 resolution="`echo "$i" | sed 's/^dpi//'`";; dpi12fast | dpi1200fast) resolution="1200fast" ;; dpi12pro | dpi12 | dpi1200) # [ Modified by Amit Raval to support for LaserJet 8000 printer on 17th Apr. 1998 # resolution="1200pro" ;; # [ Modified by Raju on 04/09/98 to support lj8100-m320 # if [ $PRINTMODEL != "lj8000" ] if [ $PRINTMODEL != "lj8000" -o $PRINTMODEL != "lj8100-m320"] # End of modification by Raju ] then resolution="1200pro" fi ;; # ] # [ Modified by Raju on 28/09/98 as the syntax was not appropriate # econo[onf]*) econo[o][nf]*) # End of modification by Raju econo="`echo "$i" | sed 's/^econo//'`";; # print quality quality*) printqty="`echo "$i" | sed 's/^quality//'`";; # toner density tondensity*) tdensity="`echo "$i" | sed 's/^tondensity//'`" ;; # render mode color) rendermode="color";; gray) rendermode="gray";; nb | nobanner) # No banner page banner="";; yb | banner) # output banner page banner="yes";; # 2-up/4-up. 2+) dividing="-hh";; half | 2 | 2up) psnup="2" #Added by Ramki on 14th Oct 98 for PSNUP dividing="-h";; quarter | 4 | 4up) psnup="4" #Added by Ramki on 14th Oct 98 for PSNUP # [Removed to support 4up printing for PS in solaris also on 19th June '98. # 4up will not work for Soalis. It will behave as 2up. # if [ "$OS" = "HP-UX" ] # then # dividing="-q" # fi;; dividing="-q" ;; # ] # [ Modified by Amit Raval to fix the defect# 57427 on Apr 16. 1999 8 | 8up) # [ Modified by Vijay on 25/7/99 to support 8up for PostScript psnup="8" # End of change by Vijay ] dividing="8up" ;; # ] 3hole) ThreeHoles="yes";; portrait) # print in portrait mode orientation="p";; landscape) # print in landscape mode orientation="l";; rotate) rotate="yes";; # duplex simplex) duplex="simplex";; vd | duplex | double | d) # vertical binding duplex="vduplex";; hd | hduplex) # double side, horizontal binding duplex="hduplex";; md | mduplex) # duplexing manually if [ "$OS" = "HP-UX" ] then manuald="mdouble" fi;; # paper source # [ Modified by Amit R. Raval to fix the problem of not working manual feed # on June 29th 1998. # tray1 | manual | man ) # manual sheet feed # mediasrc="4";; tray1 ) # feed from tray 1 mediasrc="4";; manual | man ) # manual sheet feed mediasrc="2";; # ] tray2 | upper | ub | ubin) # feed from upper tray mediasrc="1";; tray3 | lower | lb | lbin ) # feed from lower tray mediasrc="5";; tray4 ) # HCI # [ Modified by Amit Raval to support for LaserJet 8000 printer on 17th Apr. 1998 # mediasrc="8";; # [ Modified by Raju on 04/09/98 to support lj8100-m320 # if [ $PRINTMODEL = "lj8000" ] if [ $PRINTMODEL = "lj8000" -o $PRINTMODEL = "lj8100-m320" ] # End of Modification by Raju ] then mediasrc="20" else mediasrc="8" fi ;; tray5 ) if [ $PRINTMODEL = "lj8000" ] then mediasrc="21" # [ Added by Raju on 04/09/98 to support lj8100-m320 elif [ $PRINTMODEL = "lj8100-m320" ] then mediasrc="8" # End of addition by Raju ] fi ;; manualenv | manenv ) # [ Modified by Raju on 04/09/98 to support lj8100-m320 # if [ $PRINTMODEL = "lj8000" ] if [ $PRINTMODEL = "lj8000" -o $PRINTMODEL = "lj8100-m320" ] # End of modification by Raju ] then mediasrc="3" fi ;; # ] # paper destination # [ Modified by Vijay on 17/11/98 to add leftbin # bin2 | rearbin) # to back bin # [ Modified by Raju on 25th November 98 to fix the problem of not sending # output to faceup bin (when mailbox attached) # bin2 | rearbin | leftbin) # to back bin bin2) # to back bin (with mailbox bin attached) # ] if [ "$PRINTMODEL" = "lj4000" -o "$PRINTMODEL" = "lj5000" ] then outb="UPPER" # not possible to select rear bin in lj4000 and lj5000 mediadest="1" else # outb="LOWER" outb="OPTIONALOUTBIN1" mediadest="2" fi;; # [ Added by Raju on 25th November 98 to fix the problem of not sending # output to faceup bin (when mailbox not attached) rearbin | leftbin) # to back bin if [ "$PRINTMODEL" = "lj4000" -o "$PRINTMODEL" = "lj5000" ] then outb="UPPER" # not possible to select rear bin in lj4000 and lj5000 mediadest="1" else outb="LOWER" mediadest="2" fi;; # End of modification by Raju ] bin1 | topbin) # to top bin # if [ "$PRINTMODEL" = "lj4000" -o "$PRINTMODEL" = "lj5000" ] # then outb="UPPER" mediadest="1" # fi ;; bin*) binnum=`echo "$i" | sed 's/^bin//'` binnum=`expr $binnum - 1` outb="${outbstring}$binnum";; # [ Modified by Amit Raval to support for LaserJet 8000 printer on 17th Apr. 1998 # mailbin*) # if [ $PRINTMODEL = "lj8000" ] # then # binname=`echo "$i" | sed 's/^mailbin//'` # outb="$binname" # fi # ;; # ] mtype*) # [ Modified by Raju as mtype also accepts User-defined# because the following # command removes any - and _ from the string # mtype=`echo "$i" | sed 's/^mtype//'| sed "s/${SPACECHAR}/ /g"` ;; mtype=`echo "$i" | sed 's/^mtype//'` ;; fuser*) # [ Modified by Amit Raval to support for LaserJet 8000 printer on 17th Apr. 1998 # fuser=`echo "$i" | sed 's/^fuser//' | sed "s/${SPACECHAR}/ /g"`;; if [ $PRINTMODEL != "lj8000" ] then fuser=`echo "$i" | sed 's/^fuser//' | sed "s/${SPACECHAR}/ /g"` fi ;; # ] # paper size legal) # 8.5 x 14 paper="legal";; letter) # 8.5 x 11 paper="letter";; A3) # 297 mm x 420 mm paper="ISOA3";; A4) # 210 mm x 297 mm paper="ISOA4";; A5) # 148 mm x 210 mm paper="ISOA5" banner="";; # don't print banner page for this A6) # [ Modified by Amit Raval to support for LaserJet 8000 printer on 17th Apr. 1998 # paper="ISOA6" # banner="";; # don't print banner page for this # [ Modified by Raju on 04/09/98 to support lj8100-m320 # if [ $PRINTMODEL != "lj8000" ] if [ $PRINTMODEL != "lj8000" -o $PRINTMODEL != "lj8100-m320" ] # End of modification by Raju ] then paper="ISOA6" banner="" # don't print banner page for this fi ;; # ] executive | exec) # 7 1/4 x 10.5 paper="exec";; ledger ) width2up=174 paper="ledger";; 11x17 ) width2up=174 paper="11x17";; B4-JIS) paper="JISB4";; B5-JIS) paper="JISB5";; B6-JIS) # [ Modified by Amit Raval to support for LaserJet 8000 printer on 17th Apr. 1998 # paper="JISB6" # banner="";; # don't print banner page for this # [ Modified by Raju on 04/09/98 to support lj8100-m320 # if [ $PRINTMODEL != "lj8000" ] if [ $PRINTMODEL != "lj8000" -o $PRINTMODEL != "lj8100-m320" ] # End of Modification by Raju ] then paper="JISB6" banner="" # don't print banner page for this fi ;; # ] B5-ISO) paper="ISOB5" banner="";; # don't print banner page for this custom) paper="custom" banner="";; # don't print banner page for this PostCard | PostCardD) paper="postcardD" banner="";; # don't print banner page for this PostCardS) # [ Modified by Amit Raval to support for LaserJet 8000 printer on 17th Apr. 1998 # paper="postcardS" # banner="";; # don't print banner page for this # [ Modified by Raju on 04/09/98 to support lj8100-m320 # if [ $PRINTMODEL != "lj8000" ] if [ $PRINTMODEL != "lj8000" -o $PRINTMODEL != "lj8100-m320" ] # End of modification by Raju ] then paper="postcardS" banner="" # don't print banner page for this fi ;; # ] com10 | com10env) # feed from envelope tray, paper="com10" banner="";; # don't print banner page for this C5 | C5env) # envelope (international C5) paper="C5" mediasrc="6";; DL | DLenv) # feed from envelope tray, paper="DL" mediasrc="6" ;; monarc) # feed from envelope tray, paper="monarc" mediasrc="6";; # [ Added by Vijay to include 8K, 16K and JIS-EXEC 8K) paper="8K";; 16K) paper="16K";; JIS-EXEC) paper="JISEXEC";; # End of change by Vijay ] # feed banner page from upper(1)/lower (4) tray, btray1) bannerpagesrc="4";; btray2 | bupper | ubb) bannerpagesrc="1";; btray3 | blower | lbb) # feed from 3rd tray bannerpagesrc="5";; btray4) # [ Modified by Amit Raval to support for LaserJet 8000 printer on 17th Apr. 1998 # bannerpagesrc="8";; # [ Modified by Raju on 04/09/98 to support lj8100-m320 # if [ $PRINTMODEL = "lj8000" ] if [ $PRINTMODEL = "lj8000" -o $PRINTMODEL = "lj8100-m320" ] # End of modification by Raju ] then bannerpagesrc="20" else bannerpagesrc="8" fi ;; btray5) if [ $PRINTMODEL = "lj8000" ] then bannerpagesrc="21" # [ Added by Raju on 04/09/98 to support lj8100-m320 elif [ $PRINTMODEL = "lj8100-m320" ] then bannerpagesrc="8" # End of addition by Raju ] fi ;; # ] options) listopt="yes";; rev) if [ "$OS" = "HP-UX" ] then reverse="yes" fi;; n | nroff) nroff="-n" length="-l66";; pr) nroff="-p" length="";; # PCL Font Control 10) # set to 10.00 cpi pitch="10";; 12) # set to 12.00 cpi pitch="12";; c) # compressed print pitch="c";; # set font pitch to value following fp fp[0-9]* | fp.[0-9]*) pitch="`echo "$i" | sed 's/^fp//'`" ;; # set horizontal spacing increment to #/120 in. hsi[0-9]*) hsi="`echo "$i" | sed 's/^hsi//'`";; ps) # proportional spacing spacing="1";; fs) # fixed spacing spacing="0";; # set lines per inch lpi[0-9]*) lpi="`echo "$i" | sed 's/^lpi//'`";; # set perforation skip mode #perfo[onf]*) # perfo="`echo "$i" | sed 's/^perfo//'`";; # set vertical spacing increment to #/48 inch vsi[0-9]*) vsi="`echo "$i" | sed 's/^vsi//'`";; # set character set to value following cs cs[0-9]*) charset="`echo "$i" | sed 's/^cs//'`";; # set height value height[0-9]*) height="`echo "$i" | sed 's/^height//'`";; # set font style style[0-1]) style="`echo "$i" | sed 's/^style//'`";; style[4-5]) style="`echo "$i" | sed 's/^style//'`";; i | italic) style=italic;; upright) style="0";; conden | condensed) style="4" ;; condeni | condensedi) style="5" ;; # set typeface type[0-9]*) typeface="`echo "$i" | sed 's/^type//'`";; # set font weight weight[0-9]* | weight-[0-9]*) weight="`echo "$i" | sed 's/^weight//'`";; m | medium) weight=0;; sb | sbold) weight=1;; b | bold) weight=3;; eb | ebold) weight=4;; #set absolute length of page ln66) ln66="yes";; eolwrap) eolwrap="yes";; #l[0-9]*) # lpagelen="`echo "$i" | sed 's/^l//'`";; #set text length of page tl[0-9]*) textlen="`echo "$i" | sed 's/^tl//'`";; # set left margin in columns lm[0-9]*) lmargin="`echo "$i" | sed 's/^lm//'`";; tm[0-9]*) tmargin="`echo "$i" | sed 's/^tm//'`";; # set right margin in columns rm[0-9]*) rmargin="`echo "$i" | sed 's/^rm//'`";; # PS specific a | ascii) # print postscript text ascii="yes";; f*) # new font used by ASCII-to-PS font="`echo "$i" | sed 's/^f//'`";; # [ Added by Raju on 04/09/98 to support lj8100-m320 proofnhold*) # For proofNhold mode hold="`echo "$i" | sed 's/^proofnhold//'`";; pnh*) # For proofNhold mode #[ Modified by Vijay to remove banner page printing for pnh# on 17th Nov. 1998 banner="" # End of change by Vijay] hold="`echo "$i" | sed 's/^pnh//'`";; private[0-9][0-9][0-9][0-9]) # Private Job with a 4 digit PIN #[ Modified by Vijay to remove banner page printing for pnh# on 17th Nov. 1998 banner="" # End of change by Vijay] holdtype="private" holdkey="`echo "$i" | sed 's/^private//'`";; collate[o][nf]*) # Collate collate="`echo "$i" | sed 's/^collate//'`";; wmstr*) wname=`echo "$i" | sed 's/^wmstr//' | sed "s/${SPACECHAR}/ /g"`;; wmnum[0-9]*) wmstdstr=`echo "$i" | sed 's/^wmnum//'`;; # End of addition by Raju ] hpnpflog | job* | nojob*) ;; # to prevent them from being displayed *) invalidopt="$invalidopt $i";; esac done if [ "$topaz" = "yes" ] then banner="" fi # Part 2: Reolve conflict between options # settle outputmode precedence: pesc, raw, 2/4-up, and mdouble if [ "$lang_user" = "PCL" -a "$pescfile" = "yes" ] then if [ "$outputmode" = "raw" ] then outputmode="cooked" fi fi if [ "$outputmode" = "raw" ] then dividing="" # invalidate 2/4-up manuald="" # invalidate manual duplex fi if [ -n "$manuald" ] then outputmode="mdouble" omode_user="mdouble" fi if [ -n "$dividing" ] # override manaul double then case "$paper" in 11x17 | ledger) if [ "$dividing" = "-q" ] then dividing="" # not supported else outputmode="divide" omode_user="divide" if [ "$lpagelen" != "def" ] then length2up="-l$lpagelen" fi fi;; *) outputmode="divide" omode_user="divide" if [ "$lpagelen" != "def" ] then length2up="-l$lpagelen" fi;; esac fi if [ "$ln66" = "yes" ] then vsi="7.4" textlen="66" pitch="10.7" orientation="p" lpi="def" # reset, if specified. fi if [ "$ThreeHoles" = "yes" ] then # override pitch, lmargin, tmargin, vsi pitch="10.7" loffset="180" if [ "$orientation" = "def" ] then orientation="p" fi if [ "$orientation" = "p" ] then if [ "$lmargin" = "def" ] then lmargin="2" fi else if [ "$tmargin" = "def" ] then tmargin="2" fi if [ "$vsi" = "def" ] then vsi="7.85" fi fi fi if [ "$mediasrc" = "6" ] then banner="" orientation="l" fi # Silent run page adjustment # override startpg if jrpg not 0 if [ "$jrpg" -ne 0 ] then startpg=$jrpg listopt="no" banner="yes" fi if [ "$duplex" != "simplex" -a "$duplex" != "def" ] then if [ $startpg -gt 1 ] then num=$startpg num=`expr $num % 2` if [ $num -eq 0 ] then startpg=`expr $startpg - 1` fi fi fi if [ "$startpg" -gt 0 ] then # [Modified by Amit R to fix the problem of not printing proper pages for 2up # with 'srb#' and 'sre#' options on 22nd Dec 97. if [ "$dividing" = "-h" -o "$dividing" = "-hh" ] then startpg2updiv=`expr $startpg / 2` startpg2upmod=`expr $startpg % 2` if [ "$startpg2upmod" -eq 0 ] then startpg=$startpg2updiv else startpg=`expr $startpg2updiv + 1` fi elif [ "$dividing" = "-q" ] then startpg4updiv=`expr $startpg / 4` startpg4upmod=`expr $startpg % 4` if [ "$startpg4upmod" -eq 0 ] then startpg=$startpg4updiv else startpg=`expr $startpg4updiv + 1` fi # [ Modified by Amit Raval to fix the defect # 57427 on Apr. 22nd 1999 elif [ "$dividing" = "8up" ] then startpg8updiv=`expr $startpg / 8` startpg8upmod=`expr $startpg % 8` if [ "$startpg8upmod" -eq 0 ] then startpg=$startpg8updiv else startpg=`expr $startpg8updiv + 1` fi # ] fi # ] STARTPAGE="START = $startpg" else STARTPAGE="" fi if [ "$endpg" -gt 0 ] then # [Modified by Amit R to fix the problem of not printing proper pages for 2up # with 'srb#' and 'sre#' options on 22nd Dec 97. if [ "$dividing" = "-h" -o "$dividing" = "-hh" ] then endpg2updiv=`expr $endpg / 2` endpg2upmod=`expr $endpg % 2` if [ "$endpg2upmod" -eq 0 ] then endpg=$endpg2updiv else endpg=`expr $endpg2updiv + 1` fi elif [ "$dividing" = "-q" ] then endpg4updiv=`expr $endpg / 4` endpg4upmod=`expr $endpg % 4` if [ "$endpg4upmod" -eq 0 ] then endpg=$endpg4updiv else endpg=`expr $endpg4updiv + 1` fi # [ Modified by Amit Raval to fix the defect # 57427 on Apr. 22nd 1999 elif [ "$dividing" = "8up" ] then endpg8updiv=`expr $endpg / 8` endpg8upmod=`expr $endpg % 8` if [ "$endpg8upmod" -eq 0 ] then endpg=$endpg8updiv else endpg=`expr $endpg8updiv + 1` fi # ] fi # ] ENDPAGE="END = $endpg" else ENDPAGE="" fi # Validate banner page for all the medias # banner page is not supported in B5-ISO, A5, A6, C5, B6-JIS, PostCardD, # PostCardS, com10, DL, monarc if [ -n "$banner" ] then case "$paper" in B5-ISO | ISOA5 | ISOA6 | C5 | B6-JIS | PostCard* | com10 | DL | monarc) banner="";; esac fi # Set default fuser mode based on mtype if [ "$mtype" != "def" -a "$fuser" = "def" ] then case "$mtype" in Transparency) fuser="low" ;; Rough) fuser="high" ;; Vellum) fuser="vellum" ;; # [ Added by Raju on 04/09/98 to support lj8100-m320 CardStock) if [ $PRINTMODEL = "lj8100-m320" ] then fuser="high2" fi ;; Labels) if [ $PRINTMODEL = "lj8100-m320" ] then fuser="high1" fi ;; # End of addition by Raju ] *) fuser="normal" ;; esac fi } # end of function Parsing_Options() # ----------------------------------------------------------------- # Determine Which Language (PCL/PS) should be used to print the file # ----------------------------------------------------------------- Resolve_Lang() { if [ -x $HPNPS ] then # file does exist $HPNPS -q <$file > /dev/null pers=$? case "$pers" in 0) lang="PCL" # text case "$omode_user" in divide) outputmode="divide";; cooked) outputmode="cooked";; mdouble) outputmode="mdouble";; esac;; 1) lang="PS";; 2) lang="PCL" # with Esc if [ "$pescfile" = "yes" ] then # if pesc is speicified, print either cooked or divide if [ "$outputmode" != "divide" ] then outputmode="cooked" fi else outputmode="cooked" fi;; 3) if [ "$pescfile" = "yes" ] then # if pesc is speicified, print either cooked or divide lang="PCL" if [ "$outputmode" != "divide" ] then outputmode="cooked" fi else lang="RELAY" fi;; esac else # hpnps not exist lang_user="PCL" # no need to stay AUTO for next file lang="PCL" fi } # end of Resolve_Lang() # ----------------------------------------------------------------- # Output PS options # ----------------------------------------------------------------- Output_PS_Options() { echo "statusdict begin" #[ Commented by Ramki and moved to the end of function fix the defect that # tray2 commands is not working for lj8000. Date: 23/11/98 # case "$mediasrc" in # Select Input Tray # 1) ## [ Modified by Amit Raval to fix the problem of not selecting the tray option for PS file on June 11th 1998. ## echo "2 setpapertray";; # UC tray;; # # echo "0 setpapertray";; # UC tray;; ## ] # 4) ## [ Modified by Amit Raval to fix the problem of not selecting the tray option for PS file on June 11th 1998. ## echo "1 setpapertray";; # upper tray or MP tray;; # # echo "3 setpapertray";; # upper tray or MP tray;; ## ] # 5) # case "$PRINTMODEL" in ## [ Modified by Amit Raval to support for LaserJet 8000 printer on 17th Apr. 1998 ## lj4000T | lj4000TN | lj5000N | lj5000GN) ## [ Modified by Raju on 04/09/98 to support lj8100-m320 ## lj4000 | lj4000T* | lj5000 | lj5000G* | lj8000) # lj4000 | lj4000T* | lj5000 | lj5000G* | lj8000 | lj8100-m320) ## End of modification by Raju ] ## ] ## [ Modified by Amit Raval to fix the problem of not selecting the tray option for PS file on June 11th 1998. ## echo "3 setpapertray";; # LC Tray # echo "1 setpapertray";; # LC Tray ## ] # *) # echo "2 setpapertray";; # UC tray ;; # esac;; # 8) ## [ Modified by Raju on 04/09/98 to support lj8100-m320 ## echo "4 setpapertray" ;; # if [ $PRINTMODEL = "lj8100-m320" ] # then # echo "6 setpapertray" # else # echo "4 setpapertray" # fi;; ## End of modification by Raju ] ## [ Modified by Amit Raval to support for LaserJet 8000 printer on 17th Apr. 1998 # 20) # echo "5 setpapertray" ;; # 21) # echo "6 setpapertray" ;; ## ] ## 6) echo "com10envelopetray";; # envelop tray ; # 6) echo "1 setpapertray" ;; # envelop tray ; # 2) echo "/manualfeed true def";; # feed from manual ## [ Modified by Vijay to replace manual for manualenv on 17th Nov. 1998 ## 3) echo "/manualfeed envelope" ;; # feed envelope from manual # 3) echo "/manualfeed true def";; # feed from manual ## End of change by Vijay ] # esac # End of Comment by Ramki # [ Modified by Vijay on 6/10/98 to remove outputtray options # for PostScript since the commands are already available # in PJL # case "$mediadest" in # 1) echo "0 setoutputtray";; # up output bin (face down) # 2) echo "1 setoutputtray";; # back output bin (face up) # esac # End of change by Vijay ] case "$paper" in # Select Paper ISOA3) echo "a3tray";; #A3 ISOA4) echo "a4tray";; #A4 ISOA5) echo "a5tray";; #A5 ISOA6) echo "a6tray";; #A6 JISB4) echo "jb4tray";; #JIS B4 JISB5) echo "jb5tray";; #JIS B5 JISB6) echo "jb6tray";; #JIS B6 ISOB5) echo "b5tray";; #B5 exec) echo "executivetray";; #exec letter) echo "lettertray";; #letter legal) echo "legaltray";; #legal ledger) echo "ledgertray";; #ledger 11x17) echo "11x17tray";; #11x17 custom) echo "customtray";; #Custom C5) echo "c5envelopetray";; #C5 com10) echo "com10envelopetray";; #Com10 DL) echo "dlenvelopetray";; #DL postcardD) echo "doublepostcardtray";; #postcard double postcardS) echo "singlepostcardtray";; #postcard single monarc) echo "monarcenvelopetray";; #monarc # [ Commented by Raju to fix the defect related to invalid option on 25th Nov 1998 # *) invalidopt="$invalidopt $i";; # Invalid paper # ] esac case "$duplex" in simplex) echo "false setduplexmode";; # Simplex vduplex) echo "true setduplexmode" # Long Edge echo "false settumble";; hduplex) echo "true setduplexmode" # Short Edge echo "true settumble";; # [ Commented by Raju to fix the defect related to invalid option on 25th Nov 1998 # *) invalidopt="$invalidopt $i";; # Invalid option # ] esac #[ Commented by Ramki on 23/11/98 to fix lj8000 tray2 defect # echo "end" # ] if [ "$mediasrc" = "6" ] then echo "90 rotate" fi #[ Moved by Ramki on 23/11/98 to fix lj8000 tray2 defect case "$mediasrc" in # Select Input Tray 1) # [ Modified by Amit Raval to fix the problem of not selecting the tray option for PS file on June 11th 1998. # echo "2 setpapertray";; # UC tray;; echo "0 setpapertray";; # UC tray;; # ] 4) # [ Modified by Amit Raval to fix the problem of not selecting the tray option for PS file on June 11th 1998. # echo "1 setpapertray";; # upper tray or MP tray;; echo "3 setpapertray";; # upper tray or MP tray;; # ] 5) case "$PRINTMODEL" in # [ Modified by Amit Raval to support for LaserJet 8000 printer on 17th Apr. 1998 # lj4000T | lj4000TN | lj5000N | lj5000GN) # [ Modified by Raju on 04/09/98 to support lj8100-m320 # lj4000 | lj4000T* | lj5000 | lj5000G* | lj8000) lj4000 | lj4000T* | lj5000 | lj5000G* | lj8000 | lj8100-m320) # End of modification by Raju ] # ] # [ Modified by Amit Raval to fix the problem of not selecting the tray option for PS file on June 11th 1998. # echo "3 setpapertray";; # LC Tray echo "1 setpapertray";; # LC Tray # ] *) echo "2 setpapertray";; # UC tray ;; esac;; 8) # [ Modified by Raju on 04/09/98 to support lj8100-m320 # echo "4 setpapertray" ;; if [ $PRINTMODEL = "lj8100-m320" ] then echo "6 setpapertray" else echo "4 setpapertray" fi;; # End of modification by Raju ] # [ Modified by Amit Raval to support for LaserJet 8000 printer on 17th Apr. 1998 20) echo "5 setpapertray" ;; 21) echo "6 setpapertray" ;; # ] # 6) echo "com10envelopetray";; # envelop tray ; 6) echo "1 setpapertray" ;; # envelop tray ; 2) echo "/manualfeed true def";; # feed from manual # [ Modified by Vijay to replace manual for manualenv on 17th Nov. 1998 # 3) echo "/manualfeed envelope" ;; # feed envelope from manual 3) echo "/manualfeed true def";; # feed from manual # End of change by Vijay ] esac #] End of Ramki's change echo "end" } # end of Output_PS_Options() # ----------------------------------------------------------------- # Output PostScript level 2 options # ----------------------------------------------------------------- Output_PS2_Options() { echo "<<" echo "/DeferredMediaSelection true" echo "/Policies <>" case "$mediasrc" in # Select Input Tray 1) # [ Modified by Amit Raval to fix the problem of not selecting the tray option for PS file on June 11th 1998. # echo "/DeferredMediaSelection true /MediaPosition 2";;# lower tray echo "/DeferredMediaSelection true /MediaPosition 0";;# lower tray # ] 4) # [ Modified by Amit Raval to fix the problem of not selecting the tray option for PS file on June 11th 1998. # echo "/DeferredMediaSelection true /MediaPosition 1";;# upper Tray echo "/DeferredMediaSelection true /MediaPosition 3";;# upper Tray # ] 5) case "$PRINTMODEL" in # [ Modified by Amit Raval to support for LaserJet 8000 printer on 17th Apr. 1998 # lj4000* | lj5000*) # [ Modified by Raju on 04/09/98 to support lj8100-m320 # lj4000* | lj5000* | lj8000*) lj4000* | lj5000* | lj8000* | lj8100-m320*) # End of Modification by Raju ] # ] # [ Modified by Amit Raval to fix the problem of not selecting the tray option for PS file on June 11th 1998. # echo "/DeferredMediaSelection true /MediaPosition 3";; # LC Tray echo "/DeferredMediaSelection true /MediaPosition 1";; # LC Tray # ] *) echo "/DeferredMediaSelection true /MediaPosition 2";; # UC Tray esac;; 6) echo "/DeferredMediaSelection true /MediaPosition 1";;# envelop tray ; 2) echo "/DeferredMediaSelection true /ManualFeed true";; # feed from manual # [ Modified by Raju on 04/09/98 to support lj8100-m320 # 8) echo "/DeferredMediaSelection true /MediaPosition 4";; 8) if [ $PRINTMODEL = "lj8100-m320" ] then echo "/DeferredMediaSelection true /MediaPosition 6" else echo "/DeferredMediaSelection true /MediaPosition 4" fi ;; # End of Modification by Raju ] # [ Modified by Amit Raval to support for LaserJet 8000 printer on 17th Apr. 1998 20) echo "/DeferredMediaSelection true /MediaPosition 5" ;; 21) echo "/DeferredMediaSelection true /MediaPosition 6" ;; # [ Modified by Vijay to replace manual for manualenv on 17th November 1998 # 3) echo "/DeferredMediaSelection true /ManualFeed envelope" ;; 3) echo "/DeferredMediaSelection true /ManualFeed true";; # feed from manual # End of change by Vijay ] # ] esac # [ Modified by Vijay on 6/10/98 to remove outputtray options # for PostScript since the commands are already available # in PJL # case "$mediadest" in # 1) echo "/OutputAttributes <>";; # up output bin (face down) # 2) echo "/OutputAttributes <>";; # back output bin (face up) # esac # End of change by Vijay ] case "$paper" in # Select Paper ISOA3) echo "/DeferredMediaSelection true /PageSize [842 1191]";; #a3 ISOA4) echo "/DeferredMediaSelection true /PageSize [595 842]";; #a4 paper ISOA5) echo "/DeferredMediaSelection true /PageSize [420 595]";; #a5 paper ISOA6) echo "/DeferredMediaSelection true /PageSize [297 420]";; #a6 paper ISOB5) echo "/DeferredMediaSelection true /PageSize [499 708]";; #b5 paper JISB4) echo "/DeferredMediaSelection true /PageSize [729 1032]";; #jb4tray JISB5) echo "/DeferredMediaSelection true /PageSize [516 729]";; #jb5tray JISB6) echo "/DeferredMediaSelection true /PageSize [363 516]";; #jb6tray exec) echo "/DeferredMediaSelection true /PageSize [522 756]";; #executive letter) echo "/DeferredMediaSelection true /PageSize [612 792]";; #letter legal) echo "/DeferredMediaSelection true /PageSize [612 1008]";; #legal ledger) echo "/DeferredMediaSelection true /PageSize [1224 792]";; #ledger 11x17) echo "/DeferredMediaSelection true /PageSize [792 1224]";; #11x17 com10) echo "/DeferredMediaSelection true /PageSize [297 684]";; # comm10 envelope C5) echo "/DeferredMediaSelection true /PageSize [461 648]";; # c5 envelope DL) echo "/DeferredMediaSelection true /PageSize [312 624]";; # dl envelope postcardS) echo "/DeferredMediaSelection true /PageSize [284 420]";; #single postcard postcardD) echo "/DeferredMediaSelection true /PageSize [420 567]";; #double postcard monarc) echo "/DeferredMediaSelection true /PageSize [279 540]";; #monarc # [ Added by Raju on 04/09/98 to support lj8100-m320 8K) echo "/DeferredMediaSelection true /PageSize [774 1116]";; #8K 16K) echo "/DeferredMediaSelection true /PageSize [558 774]";; #16K JISEXEC) echo "/DeferredMediaSelection true /PageSize [612 936]";; #JIS EXEC # [ Commented by Raju on 25 Nov 1998 as custom size is not supported # custom) echo "/DeferredMediaSelection true /PageSize [842 1274]";; #Custom # *) invalidopt="$invalidopt $i";; # Comment by Amit on 19/11/98 # End of addition by Raju ] esac case "$duplex" in simplex) echo "/Duplex false";; # Simplex vduplex) echo "/Duplex true" # Long Edge echo "/Tumble false";; # Short Edge hduplex) echo "/Duplex true" echo "/Tumble true";; # [ Commented by Raju to fix the defect related to invalid option on 25th Nov 1998 # *) invalidopt="$invalidopt $i";; # Invalid option # ] esac case "$mtype" in # Set Media Type def) ;; *) echo "/DeferredMediaSelection true /MediaType ($mtype)" ;; esac # [ Removed watermark code from here and put it to WaterMark function # to fix the problem of not working wotermark for ps1 by Amit Raval # on 25th Nov. 1998. echo ">>setpagedevice" } # end of Output_PS2_Options() # ----------------------------------------------------------------- # Output PCL options # ----------------------------------------------------------------- Output_PCL_Options() { case "$mediasrc" in def);; *) echo "\033&l${mediasrc}H\c";; esac case "$mtype" in def);; *) count=`echo "$mtype" | wc |awk '{print $3}'` echo "\033&n${count}Wd${mtype}\c";; esac case "$paper" in legal) echo "\033&l3A\c";; #legal letter) echo "\033&l2A\c";; #letter ISOA3) echo "\033&l27A\c";; # A3 ISOA4) echo "\033&l26A\c";; # A4 ISOA5) echo "\033&l25A\c";; # A5 ISOA6) echo "\033&l24A\c";; # A6 exec) echo "\033&l1A\c";; ledger | 11x17) echo "\033&l6A\c";; # ledger (11x17) JISB4) echo "\033&l46A\c";; # JIS B4 JISB5) echo "\033&l45A\c";; # JIS B5 JISB6) echo "\033&l44A\c";; # JIS B6 ISOB5) echo "\033&l100A\c";; # B5 com10) echo "\033&l81A\c";; # Com10 custom) echo "\033&l101A\c";; # Custom postcardD) echo "\033&l72A\c";; # Postcard Double postcardS) echo "\033&l71A\c";; # Postcard Single C5) echo "\033&l91A\c";; # C5 DL) echo "\033&l90A\c";; # DL monarc) echo "\033&l80A\c";; # monarc # [ Added by Raju on 04/09/98 to support lj8100-m320 8K) echo "\033&l19A\c" ;; # 8K 16K) echo "\033&l17A\c";; # 16K JISEXEC) echo "\033&l18A\c";; # JIS EXEC # *) invalidopt="$invalidopt $i";; # comment by Amit on 19/11/98 # End of addition by Raju ] esac # does not matter if support or not, PCL will ignore it if not case "$duplex" in simplex) echo "\033&l0S\c";; # simplex vduplex) echo "\033&l1S\c";; # long edge hduplex) echo "\033&l2S\c";; # short edge esac case "$orientation" in # Orientation p) if [ "$rotate" = "yes" ] then echo "\033&l2O\c" else echo "\033&l0O\c" fi;; l) if [ "$rotate" = "yes" ] then echo "\033&l3O\c" else echo "\033&l1O\c" fi length="-l45";; esac case "$eolwrap" in # EOL Wrap yes) echo "\033&s0C\c" ;; no) echo "\033&s1C\c" ;; esac case "$vsi" in # VSI def);; *) echo "\033&l${vsi}C\c";; esac case "$lpi" in # Lines Per Inch def);; *) echo "\033&l${lpi}D\c";; esac case "$lpagelen" in # Logical Page Length def) if [ "$length" = "def" ] then length="-l60" fi;; *) echo "\033&l${lpagelen}P\c" length="-l$lpagelen";; esac case "$tmargin" in # Top Margin def);; *) echo "\033&l${tmargin}E\c";; esac case "$textlen" in # Text Length def);; *) echo "\033&l${textlen}F\c" length="-l$textlen";; esac case "$charset" in # Charset def);; *) echo "\033(${charset}\c";; esac case "$spacing" in # Spacing def);; *) echo "\033(s${spacing}P\c";; esac case "$pitch" in # Font Pitch def);; c) echo "\033&k2S\c";; *) echo "\033(s${pitch}H\c";; esac case "$hsi" in # HSI def);; *) echo "\033&k${hsi}H\c";; esac case "$height" in # Font Height def);; *) echo "\033(s${height}V\c";; esac case "$style" in # Font Style def);; italic) echo "\033(s1S\c" italic="-i";; condeni | condenseditalic) echo "\033(s5S\c" italic="-i";; *) echo "\033(s${style}S\c";; esac case "$weight" in # Weight def);; *) echo "\033(s${weight}B\c";; esac case "$typeface" in # Typeface def);; *) echo "\033(s${typeface}T\c";; esac case "$lmargin" in # Left Margin def);; *) echo "\033&a${lmargin}L\c";; esac case "$rmargin" in # Right Margin def);; *) echo "\033&a${rmargin}M\c";; esac case "$mediadest" in # Output Bin def);; *) echo "\033&l${mediadest}G\c";; # esac case "$loffset" in # Offset def);; *) echo "\033&l${loffset}U\c";; esac } # end of Output_PCL_Options() #---------------------------- # Trap Handler #---------------------------- CancelJob() { rm -f $TMP/ljx000$$ echo "$jobid is cancelled" >> $log if [ -t 1 ] then stty raw $baudrate -parenb cs8 ixon -istrip clocal <&1 2>/dev/null fi exit 0 } #--------------------------------------------------------- # Setup N up printing (avoid sending unnecessary commands) #--------------------------------------------------------- Setup_Nup() { # reset following if they are set reverse=""; pitch="def" hsi="def"; vsi="def" spacing="def"; lpi="def" charset="def"; style="def" typeface="def"; weight="def"; italic="" lpagelen="def"; length="def"; textlen="def" lmargin="def"; rmargin="def" nroff="" case "$orientation" in p | def) orientation="p" case "$dividing" in -h);; -q) fontdl /usr/lib/lp/fonts/lp4p;; esac;; l) case "$dividing" in -h) fontdl /usr/lib/lp/fonts/lp2l;; -q) fontdl -l /usr/lib/lp/fonts/lp4l;; esac;; esac } #---------------------------------------------------------------- # Although net_ljx000 is written with JetDirect in mind, it can # also be used with serial/parallel connections. Following # is the only steps needed for non-JetDirect setup. # In case this script is used for serial/parallel connection, # Set up tty parameters #---------------------------------------------------------------- Setup_iface() { # for serial connection baudrate=$BAUDRATE # Set up interface (parallel/serial, no effect on JetDirect) if [ -t 1 ] then stty raw $baudrate -parenb cs8 ixon -istrip clocal <&1 2>/dev/null else if [ "$OS" = "HP-UX" ] then slp -r 2>/dev/null fi fi } #---------------------------------------------------------------- # Profile1 and 2 are used for user-level diagnostic purpose #---------------------------------------------------------------- Profile1() { if [ "$debug" = "yes" ] then echo "@PJL COMMENT **** Job ($jobid) Profile ****" case "$resolution" in 3|300) echo "@PJL COMMENT RESOLUTION = 300" echo "@PJL COMMENT BITSPERPIXEL =1" ;; 6|600) echo "@PJL COMMENT RESOLUTION = 600" echo "@PJL COMMENT BITSPERPIXEL =1" ;; 12 | 1200pro | 1200) echo "@PJL COMMENT RESOLUTION = 1200" echo "@PJL COMMENT BITSPERPIXEL =1" ;; 1200fast) echo "@PJL COMMENT RESOLUTION = 600" echo "@PJL COMMENT BITSPERPIXEL =2" ;; # 12 | 1200fast | 1200 | 1200pro) # echo "@PJL SET RESOLUTION = 1200" ;; esac echo "@PJL COMMENT Copies : $copies" if [ -n "$banner" -a -z "$reverse" ] then echo "@PJL COMMENT Banner page: Front" fi case "$mediasrc" in 1) echo "@PJL COMMENT Input Tray: tray 2 (Lower/PC Tray)" ;; 4) echo "@PJL COMMENT Input Tray: tray 1 (Upper/MP Tray)" ;; 5) echo "@PJL COMMENT Input Tray: tray 3 (LC Tray)";; 2) echo "@PJL COMMENT Input Tray: manual feed tray";; 6) echo "@PJL COMMENT Input Tray: envelop feed";; # [ Modified by Raju on 04/09/98 to support lj8100-m320 # 8) echo "@PJL COMMENT Input Tray: tray 4" ;; 8) if [ $PRINTMODEL != "lj8100-m320" ] then echo "@PJL COMMENT Input Tray: tray 4" else echo "@PJL COMMENT Input Tray: tray 5" fi ;; # End of modification by Raju ] # [ Modified by Amit Raval to support for LaserJet 8000 printer on 17th Apr. 1998 20) echo "@PJL COMMENT Input Tray: tray 4" ;; 21) echo "@PJL COMMENT Input Tray: tray 5" ;; 3) echo "@PJL COMMENT Input Tray: manual feed envelop" ;; # ] esac fi } Profile2() { if [ "$debug" = "yes" ] then if [ "$OS" = "HP-UX" ] then echo "@PJL COMMENT File: $fname" else echo "@PJL COMMENT File: $file" fi if [ "$WRONGTYPE" = "true" ] then echo "@PJL COMMENT ** Wrong file type (such as binary, shar,...) **" return fi echo "@PJL COMMENT ** LANGUAGE: $lang" if [ "$lang" = "PCL" ] then case "$outputmode" in raw) echo "@PJL COMMENT ** Raw mode (adding NO extra characters)";; cooked) echo "@PJL COMMENT ** 1-up Text printing (adding one CR for each LF)";; divide) case "$dividing" in -h) echo "@PJL COMMENT ** 2-up Text printing (adding one CR for each LF)";; -q) echo "@PJL COMMENT ** 4-up Text printing (adding one CR for each LF)";; esac;; esac fi case "$duplex" in simplex) echo "@PJL COMMENT ** simplex" ;; vduplex) echo "@PJL COMMENT ** duplex-vertical binding";; hduplex) echo "@PJL COMMENT ** duplex-horizontal binding";; esac echo "" fi } #end of debug section #---------------------------------------------------------------- # This function will be used when 2+/2up with -olandscape option # is given. expfilen is not used. # This function takes care of the border lines based on the paper # sizes for 2up and 2+ options, on reverse portrait and reverse # landscape and the font type based on the media size. #---------------------------------------------------------------- setprinter_landscape() { # rotate, Symbolset, Spacing, Pitch, Height, Style, Stroke weight and # Typeface. if [ "$rotate" = "yes" ] then echo "\033&l2O\033(8U\033(s021.43h7.4v0s0b5T\033&l3.79C\c" else echo "\033&l0O\033(8U\033(s021.43h7.4v0s0b5T\033&l3.79C\c" fi # HMI, disable perforation, top margin 4, text length 66, left margin 1 echo "\033&k6.60H\033&l0L\033&l4E\033&a3L\033&l133F\c" # # define overlay macro # # draw boundary # macro id = 2, start macro definition echo "\033&f2y0X\c" # push cursor position, vertical motion index, full logical page echo "\033&f0S\033&l1c0E\c" # Performing paper level operations like setting up # no. of lines, drawing lines etc. # l#E -> Top margin, a#l leftmargin # p#Y -> Vertical Cursor positioning # c#B -> Vertical Rectangle size, c#P-> Fill area # c#A -> Horizontal Rectangle size if [ "$paper" = "ISOA4" -o "$paper" = "def" -o "$paper" = "letter" ] then # Start for A4, letter # letter : 8.5 x 11.0 inches # A4 : 8.27 x 11.7 inches (Almost close to letter) echo "\033&l0E\033&a0L\c" # Margin settings echo "\033*p0x60Y\033*c2336A\033*c1B\033*c0P\c" # Cursor positioning & # rectangle size echo "\033*p0x3248Y\033*c2336A\033*c1B\033*c0P\c" echo "\033*p0x60Y\033*c1A\033*c3188B\033*c0P\c" echo "\033*p2336x60Y\033*c1A\033*c3188B\033*c0P\c" echo "\033*p0x1654Y\033*c2336A\033*c1B\033*c0P\c" echo "\033&l4E\033&a3L\033&l133F\c" # No. of lines and page settings # shading # for 2+ option if [ "$dividing" = "-hh" ] # 2+ then # Solaris 2up may reach here. Use -hh to differentiate echo "\033*p0x36Y\033*c2336a125b10g2P\c" # Shade top echo "\033*p0x1629Y\033*c2336a125b10g2P\c" # Shade middle echo "\033*p1x37Y\033*c125a3188b2P\c" # Shade left fi elif [ "$paper" = "ISOA3" ] then echo "\033&l0E\033&a0L\c" # Margin settings echo "\033*p0x60Y\033*c3080A\033*c1B\033*c0P\c" # Cursor positioning & # rectangle size echo "\033*p0x4736Y\033*c3080A\033*c1B\033*c0P\c" echo "\033*p0x60Y\033*c1A\033*c4676B\033*c0P\c" echo "\033*p3080x60Y\033*c1A\033*c4676B\033*c0P\c" echo "\033*p0x2368Y\033*3080A\033*c1B\033*c0P\c" echo "\033*p0x60Y\033*c3080a1b0P\033*p0x2368Y\033*c0P\c" echo "\033&l4E\033&a3L\033&l268F\c" # No. of lines and page settings if [ "$dividing" = "-hh" ] # 2+ then echo "\033*p0x36Y\033*c3080a125b10g2P\c" # Shade top echo "\033*p0x2343Y\033*c3080a125b10g2P\c" # Shade middle echo "\033*p1x37Y\033*c120a4676b2P\c" # Shade left fi elif [ "$paper" = "legal" ] then # Start for legal paper size echo "\033&l0E\033&a0L\c" # Margin settings echo "\033*p0x60Y\033*c2324A\033*c1B\033*c0P\c" # Cursor positioning & # rectangls size echo "\033*p0x4060Y\033*c2324A\033*c1B\033*c0P\c" echo "\033*p0x60Y\033*c1A\033*c4000B\033*c0P\c" echo "\033*p2324x60Y\033*c1A\033*c4000B\033*c0P\c" echo "\033*p0x2034Y\033*c2324A\033*c1B\033*c0P\c" echo "\033&l4E\033&a3L\033&l166F\c" # No. of lines and page settings if [ "$dividing" = "-hh" ] then echo "\033*p0x36Y\033*c2324a125b10g2P\c" # Shade top echo "\033*p0x2009Y\033*c2324a125b10g2P\c" # Shade middle echo "\033*p1x37Y\033*c120a4000b2P\c" # Shade left fi elif [ "$paper" = "exec" ] then echo "\033&l0E\033&a0L\c" # Margin settings echo "\033*p0x60Y\033*c2014A\033*c1B\033*c0P\c" # Cursor positioning & # rectangle size echo "\033*p0x3060Y\033*c2014A\033*c1B\033*c0P\c" echo "\033*p0x60Y\033*c1A\033*c3000B\033*c0P\c" echo "\033*p2014x60Y\033*c1A\033*c3000B\033*c0P\c" echo "\033*p0x1534Y\033*c2014A\033*c1B\033*c0P\c" echo "\033&l4E\033&a3L\033&l121F\c" # No. of lines and Page settings if [ "$dividing" = "-hh" ] # 2+ then echo "\033*p0x36Y\033*c2014a125b10g2P\c" # Shade top echo "\033*p0x1509Y\033*c2014a125b10g2P\c" # Shade middle echo "\033*p1x37Y\033*c120a3000b2P\c" # Shade left fi fi # pop previously saved cursor position echo "\033&f1S\c" # end macro definition echo "\033&f1x2y\c" # enable macro # echo "\033&f4X\c" # lineperpage is the total no. of lines per page. # lineperhalf is the no. of lines for each half of the page. #[ Modified by Devu to fix problems with 2up landscape # 29th Jul 1999 if [ "$dividing" = "-hh" ] # 2+ then if [ "$paper" = "ISOA3" ] then lineperpage=194 lineperhalf=97 width2up=180 elif [ "$paper" = "legal" ] then lineperpage=166 lineperhalf=83 width2up=138 elif [ "$paper" = "exec" ] then lineperpage=124 lineperhalf=62 width2up=118 else lineperpage=134 lineperhalf=67 width2up=138 fi else if [ "$paper" = "ISOA3" ] then lineperpage=194 #[Change by Kumaresan for 2up page break fix Jul 29 1999 # lineperhalf=97 lineperhalf=96 width2up=180 # ] elif [ "$paper" = "legal" ] then lineperpage=166 #[ Change by Kumaresan # lineperhalf=83 lineperhalf=82 width2up=138 # ] elif [ "$paper" = "exec" ] then lineperpage=124 # [Changed By Kumaresan for 2up landscape fix Jul 29th 1999 # lineperhalf=62 lineperhalf=61 width2up=118 # end of change Kumaresan] else lineperpage=134 lineperhalf=67 width2up=138 fi fi # end of modification by Devu Jul 29 1999 ] if [ "$OS" = "SOLARIS" ] then NAWK=/usr/bin/nawk else NAWK=/usr/bin/awk fi if [ "$dividing" = "-hh" ] then [ X$fname = X ] && head="STDIN" || head="$fname" if [ "$OS" = "HP-UX" ] then head=${title:-$head} # to display the page header size=`expr length "$head"` numdots=`expr 28 - $size / 2` pad=`expr substr "$white" 1 $numdots` head="$pad$head $pad" elif [ "$OS" = "SOLARIS" ] then size=`echo "$head" | wc -c` numdots=`expr 28 - $size / 2` pad=`echo "$white" | cut -c1-$numdots` head="$pad$head $pad" # to display the page header fi expand $file | # expands tabs and whitespace characters pr -n" " -h "$head" -l$lineperhalf | # pr provides the formatted output with headers # and footers. $NAWK -v lineperhalf=$lineperhalf ' { print } ' | # awk inserts a line at every half page # [ Changed by Devu to avoid lines crossing Jul 30 1999 # pr -l$lineperpage -t -f pr -l$lineperpage -t -f | cut -c 1-$width2up # end Change by Devu ] # Finally pr splits it into pages using -f else # [ Added by Devu an if and else to handle 2up page Break problems # 29 Jul 1999 if [ "$paper" = "letter" -o "$paper" = "def" -o "$paper" = "ISOA4" ] then expand $file | # expands tabs and whitespace characters pr -t | # Provides the output without header and footer. $NAWK -v lineperhalf=$lineperhalf ' { if ( NR%lineperhalf == 0 ) { printf "\n" NR++ } print } ' | # nawk will insert line at every half page. # [ Change by Devu 30 JUL 1999 # pr -l$lineperpage -t -f pr -l$lineperpage -t -f | cut -c 1-$width2up # end Change ] # Finally it splits into different pages using -f else expand $file | Page_Break_Filter_4up8up | pr -t | # Provides the output without header and footer. $NAWK -v lineperhalf=$lineperhalf ' { # [ Changed by Devu for 2up page Break handling 29 Jul 1999 # if ( NR%lineperhalf == 0 ) { if ( NR% (lineperhalf+1) == 0 ) { # end of Change Devu ] printf "\n" NR++ } print } ' | # nawk will insert line at every half page. # Finally it splits into different pages using -f # [ Change by Devu 30 JUL 1999 # pr -l$lineperpage -t -f pr -l$lineperpage -t -f | cut -c 1-$width2up #end Change ] fi # End of if else Devu ] fi echo "\033E\c" } # End of addition by Vijay ] # [Added by Kumaresan on 29th July 99 # Function to handle page break for 2/4/8up Page_Break_Filter_4up8up() { $NAWK -F" " -v lineperhalf=$lineperhalf '{ if ( '/\\f/' && NR % lineperhalf != 0) { linesread=NR % lineperhalf linestoprint=lineperhalf - linesread sub(" ","",$1) if ($1 == "") { printf "\n" } else { print $1 } while (linestoprint) { printf "\n" NR++ linestoprint-- } if ($2 != NULL) { NR++ print $2 } maxfield=NF nextfield=3 while (maxfield >2) { sub(" ","",$nextfield) linestoprint2=lineperhalf-1 while (linestoprint2) { printf "\n" NR++ linestoprint2-- } if ($nextfield =="") { if ($(nextfield+1) == NULL) { if (nextfield ==3) NR-- } else { printf "\n" NR++ } } else if ($nextfield == "\n") { printf "\n" } else { print $nextfield } maxfield-- nextfield++ if (maxfield ==2) NR++ } } else print }' } # ] #[ adjustlength3(): # Added by Devu for 4up printing. Jul 16 1999 adjustlength3() { awk ' NR>0 { print } # if NR > 1, but it will lose the first line END { if( NR % 264 > 0 ) { printf "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" printf "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" printf "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" printf "\n\n\n\n\n\n" printf "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" printf "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" printf "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" printf "\n\n\n\n\n\n" } print }' } #end of adjustlength3() by Devu ] #[adjustlength4() #Added by Devu to fix problems with 8up printing. Jul 16 1999 adjustlength4() { awk ' NR>0 { print } # if NR > 1, but it will lose the first line END { if( NR % 264 > 0 ) { printf "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" printf "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" printf "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" printf "\n\n\n\n\n\n" printf "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" printf "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" printf "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" printf "\n\n\n\n\n\n" printf "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" printf "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" printf "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" printf "\n\n\n\n\n\n" printf "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" printf "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" printf "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" printf "\n\n\n\n\n\n" printf "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" printf "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" printf "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" printf "\n\n\n\n\n\n" printf "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" printf "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" printf "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" printf "\n\n\n\n\n\n" printf "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" printf "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" printf "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" printf "\n\n\n\n\n\n" printf "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" printf "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" printf "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" printf "\n\n\n\n\n\n" } print }' } #end adjustlength4() Devu jul 16 1999 ] # [ Modified by Amit Raval to fix the defect# 57427 on Apr 16. 1999 Setup_4up_landscape() { # landscape, symbolset 8U, font matrix if [ "$rotate" = "yes" ] then echo "\033&l3O\033(8U\033(s0p4.0v0s0b25093t24.00H\033&l2.75C\c" else echo "\033&l1O\033(8U\033(s0p4.0v0s0b25093t24.00H\033&l2.75C\c" fi # HMI, disable perforation, top margin 4, text length 66, left margin 1 echo "\033&k6.30H\033&l0l8e66F\033&a2L\c" # # define overlay macro # # draw boundary # macro id = 2, start macro definition echo "\033&f2y0X\c" # push cursor position, vertical motion index, full logical page echo "\033&f0S\033&l1c0E\c" if [ "$paper" = "letter" -o "$paper" = "def" -o "$paper" = "ISOA4" ] then # for letter size and A4 echo "\033*p0x100Y\033*c3178a1b0P\033*p0x2428Y\033*c0P\c" echo "\033*p0x100Y\033*c1a2336b0P\033*p1587x100Y\033*c0P\c" echo "\033*p3178x100Y\033*c0P\c" echo "\033*p0x1270Y\033*c3178a1b0P\c" elif [ "$paper" = "legal" ] then # for legal size, top and bottom horizontal lines echo "\033*p0x100Y\033*c4000a1b0P\033*p0x2428Y\033*c0P\c" # 3 vertical lines echo "\033*p0x100Y\033*c1a2329b0P\033*p1997x100Y\033*c0P\c" echo "\033*p4000x100Y\033*c0P\c" echo "\033*p0x1270Y\033*c4000a1b0P\c" elif [ "$paper" = "exec" ] then # paper size : exec echo "\033*p0x100Y\033*c3000a1b0P\033*p0x2118Y\033*c0P\c" echo "\033*p0x100Y\033*c1a2050b0P\033*p1492x100Y\033*c0P\c" echo "\033*p3000x100Y\033*c0P\c" echo "\033*p0x1120Y\033*c3000a1b0P\c" elif [ "$paper" = "ISOA3" ] then # A3 paper size ( Calculated as double the size of A4 in portrait form) echo "\033*p0x100Y\033*c4676a1b0P\033*p0x3184Y\033*c0P\c" echo "\033*p0x1654Y\033*c4676a1b0P\c" echo "\033*p0x100Y\033*c1a3083b0P\033*p2329x100Y\033*c0P\c" echo "\033*p4676x100Y\033*c0P\c" fi # pop previously saved cursor position echo "\033&f1S\c" # end macro definition echo "\033&f1x2y\c" # enable macro # echo "\033&f4X\c" # lineperpage is the total no. of lines per page. # lineperhalf is the no. of lines for each half of the page. if [ "$paper" = "ISOA3" ] then lineperpage=176 # 88*2 # [ Modified by Vijay on 27/7/99 to solve 4up landscape problem # lineperhalf=89 lineperhalf=88 # End of change by Vijay ] width4up=293 # 146*2 + 1 elif [ "$paper" = "legal" ] then lineperpage=132 # 66*2 # [ Modified by Vijay on 27/7/99 to solve 4up landscape problem # lineperhalf=67 lineperhalf=66 # End of change by Vijay ] width4up=251 # 125*2 + 1 elif [ "$paper" = "exec" ] then lineperpage=114 # 57*2 # [ Modified by Vijay on 27/7/99 to solve 4up landscape problem # lineperhalf=58 lineperhalf=57 # End of change by Vijay ] width4up=187 # 93*2 + 1 elif [ "$paper" = "letter" -o "$paper" = "def" -o "$paper" = "ISOA4" ] then lineperpage=132 # 66*2 # [ Modified by Vijay to rectify 4up landscape problem # lineperhalf=67 lineperhalf=66 # End of change by Vijay ] # [ Modified by Devu to fix the problem of 4up printing in HP-UX on May 17, 1999. Defect # 57839 #width4up=177 # 88*2 + 1 width4up=199 # End of change by Devu ] fi # [ Modified by Devu to fix the problem of 4up printing in HP-UX on May 17, 1999. Defect # 57839 # Uncommented NAWK for HP-UX if [ "$OS" = "SOLARIS" ] then NAWK=/usr/bin/nawk else NAWK=/usr/bin/awk fi # end of uncomment Devu ] #[ Commented by Devu to fix problems in 4up printing jul 16 1999 # expand $file | # expands tabs and whitespace characters # pr -l$lineperpage -t -f -2 -w$width4up | # end of commenting Devu jul 16 1999 ] #[[added by devu for latest fix 4up # [Modified by Kumaresan for 2/4/8up printing on 29th July 99 #expand $file | Page_Break_Filter | pr -e4 -t -l$lineperpage | adjustlength3 | expand $file | Page_Break_Filter_4up8up | pr -e4 -t -l$lineperpage | adjustlength3 | # ] pr -l$lineperpage -t -f -2 -w$width4up | # end addition Devu jul 16 1999]] $NAWK -v lineperhalf=$lineperhalf ' { # [Modified by Kumaresan for 2/4/8up printing on 29th July 99 # if ( NR%lineperhalf == 0 ) { if ( NR%(lineperhalf+1) == 0 ) { # ] printf "\n" # Insert empty line at every half page NR++ } print } ' # Finally it splits into different pages using -f echo "\033E\c" } Setup_4up_portrait() { # rotate, Symbolset, Spacing, Pitch, Height, Style, Stroke weight and # Typeface. if [ "$rotate" = "yes" ] then echo "\033&l2O\033(8U\033(s0p7.8v0s1b4102t30.00H\033&l3.77C\c" else echo "\033&l0O\033(8U\033(s0p7.8v0s1b4102t30.00H\033&l3.77C\c" fi # HMI, disable perforation, top margin 4, text length 66, left margin 1 echo "\033&k5.70H\033&l0L\033&l5E\033&a2L\033&l133F\c" # # define overlay macro # # draw boundary # macro id = 2, start macro definition echo "\033&f2y0X\c" # push cursor position, vertical motion index, full logical page echo "\033&f0S\033&l1c0E\c" # Performing paper level operations like setting up # no. of lines, drawing lines etc. # l#E -> Top margin, a#l leftmargin # p#Y -> Vertical Cursor positioning # p#X -> Horizontal Cursor positioning # c#B -> Vertical Rectangle size, c#P-> Fill area # c#A -> Horizontal Rectangle size if [ "$paper" = "ISOA4" -o "$paper" = "def" -o "$paper" = "letter" ] then # Start for A4, letter # letter : 8.5 x 11.0 inches # A4 : 8.27 x 11.7 inches (Almost close to letter) echo "\033&l0E\033&a0L\c" # Margin settings echo "\033*p0x60Y\033*c2336A\033*c1B\033*c0P\c" # Cursor positioning & # rectangle size echo "\033*p0x3250Y\033*c2336A\033*c1B\033*c0P\c" echo "\033*p0x60Y\033*c1A\033*c3190B\033*c0P\c" # Draw left vertical echo "\033*p2336x60Y\033*c1A\033*c3190B\033*c0P\c" # Draw right vertical echo "\033*p0x1672Y\033*c2336A\033*c1B\033*c0P\c" echo "\033*p1168x60Y\033*c1A\033*c3190B\033*c0P\c" echo "\033&l4E\033&a3L\033&l133F\c" # No. of lines and page settings elif [ "$paper" = "ISOA3" ] then echo "\033&l0E\033&a0L\c" # Margin settings echo "\033*p0x60Y\033*c3080A\033*c1B\033*c0P\c" # Cursor positioning & # rectangle size echo "\033*p0x4736Y\033*c3080A\033*c1B\033*c0P\c" echo "\033*p0x60Y\033*c1A\033*c4676B\033*c0P\c" echo "\033*p3080x60Y\033*c1A\033*c4676B\033*c0P\c" echo "\033*p1544x60Y\033*c1A\033*c4676B\033*c0P\c" # Middle vertical line echo "\033*p0x60Y\033*c3080a1b0P\033*p0x2402Y\033*c0P\c" echo "\033&l4E\033&a3L\033&l268F\c" # No. of lines and page settings elif [ "$paper" = "legal" ] then # Start for legal paper size echo "\033&l0E\033&a0L\c" # Margin settings echo "\033*p0x60Y\033*c2324A\033*c1B\033*c0P\c" # Cursor positioning & # rectangls size # Top horizontal line echo "\033*p0x4060Y\033*c2324A\033*c1B\033*c0P\c" # bottom horizontal echo "\033*p0x60Y\033*c1A\033*c4000B\033*c0P\c" # left vertical line echo "\033*p2324x60Y\033*c1A\033*c4000B\033*c0P\c" # Right vertical line echo "\033*p0x2076Y\033*c2324A\033*c1B\033*c0P\c" # Middle Hirizontal echo "\033*p1166x60Y\033*c1A\033*c4000B\033*c0P\c" # Middle vertical line echo "\033&l4E\033&a3L\033&l166F\c" # No. of lines and page settings elif [ "$paper" = "exec" ] then echo "\033&l0E\033&a0L\c" # Margin settings echo "\033*p0x60Y\033*c2014A\033*c1B\033*c0P\c" # Cursor positioning & # rectangle size echo "\033*p0x3060Y\033*c2014A\033*c1B\033*c0P\c" echo "\033*p0x60Y\033*c1A\033*c3000B\033*c0P\c" echo "\033*p2014x60Y\033*c1A\033*c3000B\033*c0P\c" echo "\033*p1009x60Y\033*c1A\033*c3000B\033*c0P\c" # Middle vertical line echo "\033*p0x1577Y\033*c2014A\033*c1B\033*c0P\c" echo "\033&l4E\033&a3L\033&l121F\c" # No. of lines and Page settings fi # pop previously saved cursor position echo "\033&f1S\c" # end macro definition echo "\033&f1x2y\c" # enable macro # echo "\033&f4X\c" # lineperpage is the total no. of lines per page. # lineperhalf is the no. of lines for each half of the page. if [ "$paper" = "ISOA3" ] then lineperpage=194 # 97*2 lineperhalf=97 width4up=214 # 106*2 + 1 elif [ "$paper" = "legal" ] then lineperpage=166 # 83*2 lineperhalf=83 width4up=161 # 80*2 + 1 elif [ "$paper" = "exec" ] then lineperpage=124 # 62*2 lineperhalf=62 width4up=139 # 69*2 + 1 elif [ "$paper" = "letter" -o "$paper" = "def" -o "$paper" = "ISOA4" ] then lineperpage=132 # 66*2 lineperhalf=66 width4up=161 # 80*2 + 1 fi # [ Modified by Devu to fix the problem of 4up printing in HP-UX on May 17, 1999. Defect # 57839 # Uncommented NAWK for HP-UX if [ "$OS" = "SOLARIS" ] then NAWK=/usr/bin/nawk else NAWK=/usr/bin/awk fi # End of change by Devu ] #[ Commented by Devu to fix problems in 4up printing jul 16 1999 # expand $file | # expands tabs and whitespace characters # pr -l$lineperpage -t -f -2 -w$width4up | # end of commenting Devu jul 16 1999 ] #[ Added by devu to fix 4up printing jul 16 1999 # [Modified by Kumaresan for 2/4/8up printing on 29th July 99 # expand $file | Page_Break_Filter | pr -e4 -t -l$lineperpage | adjustlength3 | expand $file | Page_Break_Filter_4up8up | pr -e4 -t -l$lineperpage | adjustlength3 | # ] pr -l$lineperpage -t -f -2 -w$width4up | #end of addition by Devu Jul 16 1999 ] $NAWK -v lineperhalf=$lineperhalf ' { print if ( NR%lineperhalf == 0 ) { printf "\n" # Insert empty line at every half page. } } ' # Finally it splits into different pages using -f echo "\033E\c" } setprinter_8up_landscape() { # rotate, Symbolset, Spacing, Pitch, Height, Style, Stroke weight and # Typeface. if [ "$rotate" = "yes" ] then echo "\033&l2O\033(8U\033(s0p3.0v0s0b16602t30.00H\033&l1.90C\c" else echo "\033&l0O\033(8U\033(s0p3.0v0s0b16602t30.00H\033&l1.90C\c" fi # HMI, disable perforation, top margin 4, text length 66, left margin 1 echo "\033&k5.20H\033&l0L\033&l7E\033&a2L\033&l133F\c" # # define overlay macro # # draw boundary # macro id = 2, start macro definition echo "\033&f2y0X\c" # push cursor position, vertical motion index, full logical page echo "\033&f0S\033&l1c0E\c" # Performing paper level operations like setting up # no. of lines, drawing lines etc. # l#E -> Top margin, a#l leftmargin # p#Y -> Vertical Cursor positioning # p#X -> Horizontal Cursor positioning # c#B -> Vertical Rectangle size, c#P-> Fill area # c#A -> Horizontal Rectangle size if [ "$paper" = "ISOA4" -o "$paper" = "def" -o "$paper" = "letter" ] then # Start for A4, letter # letter : 8.5 x 11.0 inches # A4 : 8.27 x 11.7 inches (Almost close to letter) echo "\033&l0E\033&a0L\c" # Margin settings echo "\033*p0x60Y\033*c2336A\033*c1B\033*c0P\c" # Cursor positioning & # rectangle size echo "\033*p0x3250Y\033*c2336A\033*c1B\033*c0P\c" echo "\033*p0x60Y\033*c1A\033*c3190B\033*c0P\c" # Draw left vertical echo "\033*p2336x60Y\033*c1A\033*c3190B\033*c0P\c" # Draw right vertical echo "\033*p0x1661Y\033*c2336A\033*c1B\033*c0P\c" echo "\033*p0x866Y\033*c2336A\033*c1B\033*c0P\c" echo "\033*p0x2458Y\033*c2336A\033*c1B\033*c0P\c" echo "\033*p1168x60Y\033*c1A\033*c3190B\033*c0P\c" echo "\033&l4E\033&a3L\033&l133F\c" # No. of lines and page settings elif [ "$paper" = "ISOA3" ] then echo "\033&l0E\033&a0L\c" # Margin settings echo "\033*p0x60Y\033*c3080A\033*c1B\033*c0P\c" # Cursor positioning & # rectangle size echo "\033*p0x4736Y\033*c3080A\033*c1B\033*c0P\c" echo "\033*p0x60Y\033*c1A\033*c4676B\033*c0P\c" echo "\033*p3080x60Y\033*c1A\033*c4676B\033*c0P\c" echo "\033*p1544x60Y\033*c1A\033*c4676B\033*c0P\c" # Middle vertical line echo "\033*p0x60Y\033*c3080a1b0P\033*p0x2397Y\033*c0P\c" echo "\033*p0x1234Y\033*c3080A\033*c1B\033*c0P\c" # Above-Middle Hirizontal echo "\033*p0x3562Y\033*c3080A\033*c1B\033*c0P\c" # Below-Middle Hirizontal echo "\033&l4E\033&a3L\033&l268F\c" # No. of lines and page settings elif [ "$paper" = "legal" ] then # Start for legal paper size echo "\033&l0E\033&a0L\c" # Margin settings echo "\033*p0x60Y\033*c2324A\033*c1B\033*c0P\c" # Cursor positioning & # rectangls size # Top horizontal line echo "\033*p0x4060Y\033*c2324A\033*c1B\033*c0P\c" # bottom horizontal echo "\033*p0x60Y\033*c1A\033*c4000B\033*c0P\c" # left vertical line echo "\033*p2324x60Y\033*c1A\033*c4000B\033*c0P\c" # Right vertical line echo "\033*p0x2064Y\033*c2324A\033*c1B\033*c0P\c" # Middle Hirizontal echo "\033*p0x1068Y\033*c2324A\033*c1B\033*c0P\c" # Above-Middle Hirizontal echo "\033*p0x3064Y\033*c2324A\033*c1B\033*c0P\c" # Below-Middle Hirizontal echo "\033*p1166x60Y\033*c1A\033*c4000B\033*c0P\c" # Middle vertical line echo "\033&l4E\033&a3L\033&l166F\c" # No. of lines and page settings elif [ "$paper" = "exec" ] then echo "\033&l0E\033&a0L\c" # Margin settings echo "\033*p0x60Y\033*c2014A\033*c1B\033*c0P\c" # Cursor positioning & # rectangle size echo "\033*p0x3060Y\033*c2014A\033*c1B\033*c0P\c" echo "\033*p0x60Y\033*c1A\033*c3000B\033*c0P\c" echo "\033*p2014x60Y\033*c1A\033*c3000B\033*c0P\c" echo "\033*p1009x60Y\033*c1A\033*c3000B\033*c0P\c" # Middle vertical line echo "\033*p0x1565Y\033*c2014A\033*c1B\033*c0P\c" echo "\033&l4E\033&a3L\033&l121F\c" # No. of lines and Page settings echo "\033*p0x792Y\033*c2014A\033*c1B\033*c0P\c" # Above-Middle Hirizontal echo "\033*p0x2289Y\033*c2014A\033*c1B\033*c0P\c" # Below-Middle Hirizontal fi # pop previously saved cursor position echo "\033&f1S\c" # end macro definition echo "\033&f1x2y\c" # enable macro # echo "\033&f4X\c" # lineperpage is the total no. of lines per page. # lineperhalf is the no. of lines for each half of the page. if [ "$paper" = "ISOA3" ] then lineperpage=388 # 97*4 lineperhalf=97 width8up=235 # 117*2 + 1 elif [ "$paper" = "legal" ] then lineperpage=332 # 83*4 lineperhalf=83 width8up=177 # 88*2 + 1 elif [ "$paper" = "exec" ] then lineperpage=248 # 62*4 lineperhalf=62 width8up=153 # 76*2 + 1 elif [ "$paper" = "ISOA4" -o "$paper" = "def" -o "$paper" = "letter" ] then lineperpage=264 # 66*4 lineperhalf=66 width8up=177 # 88*2 + 1 fi if [ "$OS" = "SOLARIS" ] then NAWK=/usr/bin/nawk else NAWK=/usr/bin/awk fi # [ Commented by Devu to fix problems in 8up printing jul 16 1999 # expand $file | # expands tabs and whitespace characters # pr -l$lineperpage -t -f -2 -w$width8up | # end of comment ] #[Added by devu to fix problems in 8up printing jul 16 1999 # [Modified by Kumaresan for 2/4/8up printing on 29th July 99 #expand $file | Page_Break_Filter | pr -e4 -t -l$lineperpage | adjustlength4 | expand $file | Page_Break_Filter_4up8up | pr -e4 -t -l$lineperpage | adjustlength4 | # ] pr -l$lineperpage -t -f -2 -w$width8up | #end of addition by Devu jul 16 1999] $NAWK -v lineperhalf=$lineperhalf ' { print if ( NR%lineperhalf == 0 ) { printf "\n" # Insert empty line at every half page. } } ' # Finally it splits into different pages using -f echo "\033E\c" } setprinter_8up_portrait() { # landscape, symbolset 8U, font matrix if [ "$rotate" = "yes" ] then echo "\033&l3O\033(8U\033(s0p4.0v0s0b25093t35.00H\033&l2.75C\c" else echo "\033&l1O\033(8U\033(s0p4.0v0s0b25093t35.00H\033&l2.75C\c" fi # HMI, disable perforation, top margin 4, text length 66, left margin 1 echo "\033&k3.90H\033&l0l8e66F\033&a2L\c" # # define overlay macro # # draw boundary # macro id = 2, start macro definition echo "\033&f2y0X\c" # push cursor position, vertical motion index, full logical page echo "\033&f0S\033&l1c0E\c" if [ "$paper" = "letter" -o "$paper" = "def" -o "$paper" = "ISOA4" ] then # for letter size echo "\033*p0x100Y\033*c3178a1b0P\033*p0x2428Y\033*c0P\c" echo "\033*p0x100Y\033*c1a2336b0P\033*p1587x100Y\033*c0P\c" echo "\033*p3178x100Y\033*c0P\c" echo "\033*p2380x100Y\033*c0P\c" echo "\033*p800x100Y\033*c0P\c" echo "\033*p0x1270Y\033*c3178a1b0P\c" elif [ "$paper" = "legal" ] then # for legal size, top and bottom horizontal lines echo "\033*p0x100Y\033*c4000a1b0P\033*p0x2428Y\033*c0P\c" # 3 vertical lines echo "\033*p0x100Y\033*c1a2329b0P\033*p1997x100Y\033*c0P\c" echo "\033*p4000x100Y\033*c0P\c" echo "\033*p1004x100Y\033*c0P\c" echo "\033*p2994x100Y\033*c0P\c" echo "\033*p0x1270Y\033*c4000a1b0P\c" elif [ "$paper" = "exec" ] then # paper size : exec echo "\033*p0x100Y\033*c3000a1b0P\033*p0x2118Y\033*c0P\c" echo "\033*p0x100Y\033*c1a2050b0P\033*p1492x100Y\033*c0P\c" echo "\033*p3000x100Y\033*c0P\c" echo "\033*p750x100Y\033*c0P\c" echo "\033*p2230x100Y\033*c0P\c" echo "\033*p0x1120Y\033*c3000a1b0P\c" elif [ "$paper" = "ISOA3" ] then # A3 paper size ( Calculated as double the size of A4 in portrait form) echo "\033*p0x100Y\033*c4676a1b0P\033*p0x3184Y\033*c0P\c" echo "\033*p0x1654Y\033*c4676a1b0P\c" echo "\033*p0x100Y\033*c1a3083b0P\033*p2329x100Y\033*c0P\c" echo "\033*p4676x100Y\033*c0P\c" echo "\033*p1170x100Y\033*c0P\c" echo "\033*p3491x100Y\033*c0P\c" fi # pop previously saved cursor position echo "\033&f1S\c" # end macro definition echo "\033&f1x2y\c" # enable macro # echo "\033&f4X\c" # lineperpage is the total no. of lines per page. # lineperhalf is the no. of lines for each half of the page. if [ "$paper" = "ISOA3" ] then lineperpage=176 # 88*2 # [ Modified by Vijay to solve 8up portrait problem on 27/7/99 # lineperhalf=89 lineperhalf=88 # End of change by Vijay ] width8up=475 # 118*4 + 3 elif [ "$paper" = "legal" ] then lineperpage=132 # 66*2 # [ Modified by Vijay to solve 8up portrait problem on 27/7/99 # lineperhalf=67 lineperhalf=66 # End of change by Vijay ] width8up=407 # 101*4 + 3 elif [ "$paper" = "exec" ] then lineperpage=114 # 57*2 # [ Modified by Vijay to solve 8up portrait problem on 27/7/99 # lineperhalf=58 lineperhalf=57 # End of change by Vijay ] width8up=303 # 75*4 + 3 elif [ "$paper" = "ISOA4" -o "$paper" = "def" -o "$paper" = "letter" ] then lineperpage=132 # 66*2 # [ Modified by Vijay to solve 8up portrait problem on 27/7/99 # lineperhalf=67 lineperhalf=66 # End of change by Vijay ] width8up=323 # 80*4 + 3 fi if [ "$OS" = "SOLARIS" ] then NAWK=/usr/bin/nawk else NAWK=/usr/bin/awk fi #[Commented by Devu to fix problems in 8up printing jul 16 1999 # expand $file | # expands tabs and whitespace characters # pr -l$lineperpage -t -f -4 -w$width8up | #end of Comment Devu jul 16 1999 ] #[Added by Devu to fix problems in 8up printing jul 16 1999 # [Modified by Kumaresan for 2/4/8up printing on 29th July 99 #expand $file | Page_Break_Filter | pr -e4 -t -l$lineperpage | adjustlength4 | # Sed is used to handle line feed characters expand $file | sed 's/ //g' | Page_Break_Filter_4up8up | pr -e4 -t -l$lineperpage | adjustlength4 | # ] pr -l$lineperpage -t -f -4 -w$width8up | #end Addition Devu jul 16 1999 ] $NAWK -v lineperhalf=$lineperhalf ' { # [Modified by Kumaresan for 2/4/8up printing on 29th July 99 # if ( NR%lineperhalf == 0 ) { if ( NR%(lineperhalf+1) == 0 ) { # ] printf "\n" # Insert empty line at every half page. NR++ } print } ' # Finally it splits into different pages using -f echo "\033E\c" } # ] #---------------------------------------------------------------- # 2up functions. expfilen is not used # This function takes care of the border lines based on the paper # sizes for 2up and 2+ options, on different orientations and # the font type based on the media size. #---------------------------------------------------------------- setprinter() { # [Modified by Amit R for fixing problem of not printing 2up for A4 # on 22nd Dec97 # if [ "$paper" = "letter" -o "$paper" = "def" ] # [ Modified by Vijay for not printing 2up option for other paper sizes # Defect No : 51657 Date : 4/9/98 # # The following are the old source codes --- Vijay # # if [ "$paper" = "letter" -o "$paper" = "def" -o "$paper" = "ISOA4" ] # # Modified Source code --- Vijay # if [ "$paper" = "letter" -o "$paper" = "def" -o "$paper" = "ISOA4" -o "$paper" = "exec" -o "$paper" = "legal" ] # ] # End of change by Vijay ] then # landscape, symbolset 8U, font matrix if [ "$rotate" = "yes" ] then echo "\033&l3O\033(8U\033(s0p8.5v0s0b0t16.66H\033)s16.66H\033&l5.59C\c" else echo "\033&l1O\033(8U\033(s0p8.5v0s0b0t16.66H\033)s16.66H\033&l5.59C\c" fi # HMI, disable perforation, top margin 4, text length 66, left margin 1 # [ Modified by Amit Raval to fix the defect 57425 on Apr. 22nd 1999 # echo "\033&k7.10H\033&l0l4e66F\033&a1L\c" echo "\033&k7.10H\033&l0l3e66F\033&a1L\c" # Change top margin to 3 # ] else # 11x17 size: landscape, symbolset 8U, 10.7 pitch, 7.4 vsi if [ "$rotate" = "yes" ] then echo "\033&l3O\033(8U\033(s10.7H\033&l7.4C\c" else echo "\033&l1O\033(8U\033(s10.7H\033&l7.4C\c" fi # disable perforation, top margin 3, text length 66, left margin 3 # [ Modified by Amit Raval to fix the defect# 57426 on Apr. 21th 1999 # echo "\033&l0l3e66F\033&a3L\c" if [ "$paper" = "ISOA3" ] then echo "\033&l0l3e66F\033&a0L\c" else echo "\033&l0l3e66F\033&a3L\c" fi # ] fi # [ Modified by Vijay for not printing 2up option for other paper sizes # Defect No : 51657 Date : 4/9/98 # The following lines defines the length and width for different paper sizes for 2up option. case "$paper" in "exec") length2up="-l55" halfwidth2up=65 width2up=170;; "legal" ) length2up="-l63" halfwidth2up=132 width2up=226;; "ISOA3") length2up="-l66" halfwidth2up=78 # [ Modified by Amit Raval to fix the defect 57426 on Apr. 21th 1999 # width2up=162;; width2up=167;; # ] *) halfwidth2up=88;; esac # End of change by Vijay ] # # define overlay macro # # draw boundary # macro id = 2, start macro definition echo "\033&f2y0X\c" # push cursor position, vertical motion index, full logical page echo "\033&f0S\033&l1c0E\c" # [Modified by Amit R for fixing problem of not printing 2up for A4 # on 22nd Dec97 # if [ "$paper" = "letter" -o "$paper" = "def" ] if [ "$paper" = "letter" -o "$paper" = "def" -o "$paper" = "ISOA4" ] # ] then # for letter size # [ The following line is modified on 19/1/98 to fix the problem of # non printing of bottom line with 2up option # echo "\033*p0x100Y\033*c3178a1b0P\033*p0x2436Y\033*c0P\c" # [ Modified by Amit Raval to fix the defect 57425 on Apr. 22nd 1999 # echo "\033*p0x100Y\033*c3178a1b0P\033*p0x2428Y\033*c0P\c" echo "\033*p0x50Y\033*c3178a1b0P\033*p0x2416Y\033*c0P\c" # Adjust Top-Line # ] # ] # [ Modified by Amit Raval to fix the defect 57425 on Apr. 22nd 1999 # echo "\033*p0x100Y\033*c1a2336b0P\033*p1587x100Y\033*c0P\c" # echo "\033*p3178x100Y\033*c0P\c" echo "\033*p0x50Y\033*c1a2366b0P\033*p3178x50Y\033*c0P\c" # Adjust vertical lines echo "\033*p1587x50Y\033*c0P\c" # Adjust bottom line # ] # shading if [ "$dividing" = "-hh" ] then # Solaris 2up may reach here. Use -hh to differentiate # [ Modified by Amit Raval to fix the defect 57425 on Apr. 22nd 1999 # echo "\033*p0x100Y\033*c3178a125b10g2P\c" # echo "\033*p1x101Y\033*c120a2334b2P\033*p1589x101Y\033*c2P\c" echo "\033*p0x50Y\033*c3178a125b10g2P\c" # Adjust Shedow echo "\033*p1x51Y\033*c120a2364b2P\033*p1589x51Y\033*c2P\c" # ] fi # [ Modified by Vijay for not printing 2up option for other paper sizes # Defect No : 51657 Date : 4/9/98 # # The following are the old source codes --- Vijay # # else # # for 11x17 size, top and bottom horizontal lines # echo "\033*p47x100Y\033*c4932a1b0P\033*p47x3206Y\033*c0P\c" # # 3 vertical lines # echo "\033*p47x100Y\033*c1a3106b0P\033*p2492x100Y\033*c0P\c" # echo "\033*p4979x100Y\033*c0P\c" # # shading # if [ "$dividing" = "-hh" ] # then # echo "\033*p47x100Y\033*c4932a125b10g2P\c" # echo "\033*p48x101Y\033*c180a3106b2P\033*p2494x101Y\033*c240a3106b2P\c" # fi # fi # # Modified code --- Vijay # elif [ "$paper" = "11x17" -o "$paper" = "ledger" ] then # for 11x17 size, top and bottom horizontal lines echo "\033*p47x100Y\033*c4932a1b0P\033*p47x3206Y\033*c0P\c" # 3 vertical lines echo "\033*p47x100Y\033*c1a3106b0P\033*p2492x100Y\033*c0P\c" echo "\033*p4979x100Y\033*c0P\c" # shading if [ "$dividing" = "-hh" ] then echo "\033*p47x100Y\033*c4932a125b10g2P\c" echo "\033*p48x101Y\033*c180a3106b2P\033*p2494x101Y\033*c240a3106b2P\c" fi elif [ "$paper" = "legal" ] then # for 11x17 size, top and bottom horizontal lines echo "\033*p0x100Y\033*c4000a1b0P\033*p0x2428Y\033*c0P\c" # 3 vertical lines echo "\033*p0x100Y\033*c1a2336b0P\033*p2000x100Y\033*c0P\c" echo "\033*p4000x100Y\033*c0P\c" # shading if [ "$dividing" = "-hh" ] then echo "\033*p0x100Y\033*c4000a125b10g2P\c" echo "\033*p1x101Y\033*c120a2336b2P\033*p2002x101Y\033*c2P\c" fi elif [ "$paper" = "exec" ] then # paper size : exec # [ Modified by Amit Raval to fix the defect# 57426 on Apr. 21th 1999 # echo "\033*p0x100Y\033*c3000a1b0P\033*p0x2118Y\033*c0P\c" # echo "\033*p0x100Y\033*c1a2336b0P\033*p1500x100Y\033*c0P\c" # echo "\033*p3000x100Y\033*c0P\c" echo "\033*p0x100Y\033*c3017a1b0P\033*p0x2124Y\033*c0P\c" echo "\033*p0x100Y\033*c1a2336b0P\033*p1509x100Y\033*c0P\c" echo "\033*p3017x100Y\033*c0P\c" # ] # shading if [ "$dividing" = "-hh" ] then # [ Modified by Amit Raval to fix the defect# 57426 on Apr. 21th 1999 # echo "\033*p0x100Y\033*c3000a125b10g2P\c" # echo "\033*p1x101Y\033*c120a2336b2P\033*p1502x101Y\033*c2P\c" echo "\033*p0x100Y\033*c3017a125b10g2P\c" echo "\033*p1x101Y\033*c110a2336b2P\033*p1510x101Y\033*c2P\c" # ] fi else # A3 paper size ( Calculated as double the size of A4 in portrait form) # [ Modified by Amit Raval to fix the defect# 57426 on Apr. 21th 1999 # echo "\033*p0x100Y\033*c4676a1b0P\033*p0x3184Y\033*c0P\c" # echo "\033*p0x100Y\033*c1a3078b0P\033*p2336x100Y\033*c0P\c" echo "\033*p0x100Y\033*c4676a1b0P\033*p0x3176Y\033*c0P\c" echo "\033*p0x100Y\033*c1a3078b0P\033*p2351x100Y\033*c0P\c" # ] echo "\033*p4676x100Y\033*c0P\c" if [ "$dividing" = "-hh" ] then echo "\033*p0x100Y\033*c4676a125b10g2P\c" # [ Modified by Amit Raval to fix the defect# 57426 on Apr. 21th 1999 # echo "\033*p1x101Y\033*c120a3078b2P\033*p2338x101Y\033*c2P\c" echo "\033*p1x101Y\033*c140a3078b2P\033*p2352x101Y\033*c2P\c" # ] fi # End of change by Vijay ] fi # pop previously saved cursor position echo "\033&f1S\c" # end macro definition echo "\033&f1x2y\c" # enable macro # echo "\033&f4X\c" } #---------------------------------------------------------------- # Adjust Length #---------------------------------------------------------------- adjustlength1() { awk ' NR>0 { print } END { if( NR % 140 > 0 ) { printf "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" printf "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" printf "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" printf "\n\n\n\n\n\n\n\n\n\n" } print } ' } # This function is executed when 2up option is specified. # This function makes use of the text length and the column width given, # and prepares the output accordingly. prepfile1() { [ X$fname = X ] && head="STDIN" || head="$fname" if [ "$OS" = "HP-UX" ] then head=${title:-$head} size=`expr length "$head"` numdots=`expr 28 - $size / 2` pad=`expr substr "$white" 1 $numdots` head="$pad$head $pad" fi if [ "$OS" = "SOLARIS" ] then size=`echo "$head" | wc -c` numdots=`expr 28 - $size / 2` pad=`echo "$white" | cut -c1-$numdots` head="$pad$head $pad" fi # [ Modified by Vijay for solving the defect #51657. # Problem : 2up option not working for any other paper sizes other than # A4 and Letter. # Date : 7/9/98 # Old Code --- Vijay # # expand $file | # pr -e4 -n" " -h "$head" -w88 -l70 | # adjustlength1 | # need this to do padding # $PR -l70 -t -2 -w178 | # sed -e ' 2,$ { /^[A-Z]/ { N # N # n # } # /^$/d # }' # [ Modified by Vijay on 30/7/99 to fix the 2+ & 2up problem for not printing # properly. if [ "$OS" = "HP-UX" ] then NAWK=/usr/bin/awk else NAWK=/usr/bin/nawk fi case "$paper" in "exec") lineperhalf=45;; "legal") lineperhalf=53;; "ISOA3") lineperhalf=56;; *) lineperhalf=56;; esac # End of change by Vijay ] expand $file | # [ Modified by Vijay on 30/7/99 to fix the 2+ & 2up problem for not printing # properly. Page_Break_Filter_4up8up | # End of change by Vijay ] pr -e4 -n" " -h "$head" -w$halfwidth2up $length2up | adjustlength1 | # need this to do padding $PR $length2up -t -2 -w$width2up | sed -e ' 2,$ { /^[A-Z]/ { N N n } /^$/d }' echo "\033E" } #---------------------------------------------------------------- # Adjust Length #---------------------------------------------------------------- adjustlength2() { awk ' NR>0 { print } # if NR > 1, but it will lose the first line END { if( NR % 132 > 0 ) { printf "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" printf "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" printf "\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n" printf "\n\n\n\n\n\n" } print }' } # This function is executed when 2+ option is specified. # This function makes use of the text length and the column width given, # and prepares the output accordingly. prepfile2() { # [ The function is modified by Ramki on 15/1/98 to fix the problem related # to non working of 2up option in solaris # expand $file | # adjustlength2 | # definite need this to do padding # $PR $length2up -t -2 -w$width2up # removing sed fixes a problem "loosing # a blank line at the beginning # [ Modified by Vijay for solving the defect #51657. # Problem : 2up option not working for any other paper sizes other than # A4 and Letter. # Date : 7/9/98 # Old Code --- Vijay # #expand $file | # pr -e4 -t -w88 -l66 | # adjustlength2 | # need this to do padding # $PR -l66 -t -2 -w178 | # sed -e ' 2,$ { /^[A-Z]/ { N # N # n # } # /^$/d # }' # # Modified code --- Vijay # # [ Modified by Vijay on 30/7/99 to fix the 2+ & 2up problem for not printing # properly. if [ "$OS" = "HP-UX" ] then NAWK=/usr/bin/awk else NAWK=/usr/bin/nawk fi case "$paper" in "exec") lineperhalf=55;; "legal") lineperhalf=63;; "ISOA3") lineperhalf=66;; *) lineperhalf=66;; esac # End of change by Vijay ] expand $file | # [ Modified by Vijay on 30/7/99 to fix the 2+ & 2up problem for not printing # properly. Page_Break_Filter_4up8up | # End of change by Vijay ] pr -e4 -t -w$halfwidth2up $length2up | adjustlength2 | # need this to do padding $PR $length2up -t -2 -w$width2up | sed -e ' 2,$ { /^[A-Z]/ { N N n } /^$/d }' # End of change by Vijay ] # End of modification ] echo "\033E" } #---------------------------------------------------------------- # Print File #---------------------------------------------------------------- printfile() { # [ Modified by Vijay on 16/2/99 to fix the defect #55274. (2up with landscape # is not working properly). if [ "$orientation" = "l" ] # If orientation is landscape then if [ "$paper" = "ISOA4" -o "$paper" = "ISOA3" -o "$paper" = "letter" -o "$paper" = "legal" -o "$paper" = "exec" -o "$paper" = "def" ] then # and if the paper size is A4, letter, legal, exec or def setprinter_landscape return fi fi # if orientation is portrait or if the orientation is landscape and the # paper sizes are the ones that are not supported by setprinter_landscape # End of change by Vijay ] setprinter ; if [ "$dividing" = "-hh" ] then # 2up with shading prepfile1 $file else # 2up w/o shading prepfile2 $file fi } # [ Added by Raju on 04/09/98 to support lj8100-m320 #---------------------------------------------------------------- # Proof and Hold, Private Printing #---------------------------------------------------------------- ProofNHold_Print() { echo "@PJL SET USERNAME = \"$user\"" # User Name echo "@PJL SET JOBNAME = \"$jobid\"" # Job Name if [ "$debug" = "yes" ] then echo "@PJL COMMENT **** User ($user) Job ($jobid) ****" fi topaz="yes" # Must be yes to print multiple copies collate="on" case "$hold" in # Job Retention nohold|nhold|OFF) echo "@PJL SET HOLD = OFF";; printhold|phold) echo "@PJL SET HOLD = ON";; hold) echo "@PJL SET HOLD = STORE";; proof) echo "@PJL SET HOLD = PROOF";; *) invalidopt="$invalidopt $i";; esac if [ "$debug" = "yes" -a $hold != "def" ] then echo "@PJL COMMENT **** Job Retention Mode ($hold) ****" fi if [ $holdtype = "private" ] then echo "@PJL SET HOLDTYPE = PRIVATE" echo "@PJL SET HOLDKEY = \"$holdkey\"" # Set PIN (Passwd) if [ "$debug" = "yes" ] then echo "@PJL COMMENT **** Job Retention Type ($holdtype) ****" echo "@PJL COMMENT **** Personal Identification Number ($holdkey ) ****" fi fi } # end of the function ProofNHold_Print() # [ Added by Amit Raval to fix the problem of not working watermark for ps1 # on 25th Nov 1998. #Print watermark string on all the pages of document is specified. #Iff numeral value is specified it prints standard text as watermark else #it will print the string which specified along with wmnum option WaterMark() { # For Watermark Printing. Check whether wmstr or wmnum is given. if wmnum is # given then display the standard watermark messages. if wmstr is given then # display the given string as watermark. # if [ "$wmstdstr" != "def" ] # then case "$wmstdstr" in 1) wname="Company Confidential";; 2) wname="Company Proprietary";; 3) wname="Company Private";; 4) wname="Confidential";; 5) wname="Copy";; 6) wname="Draft";; 7) wname="File Copy";; 8) wname="Final";; 9) wname="For Internal Use Only";; 10) wname="Preliminary";; 11) wname="Proof";; 12) wname="Review Copy";; 13) wname="Sample";; 14) wname="Top Secret";; 15) wname="Urgent";; # *) invalidopt="$invalidopt $i";; # commented by Amit on 20/11/98 esac # fi # [ Modified by Amit Raval for fixing the defect of printing 'def' on 20/11/98. if [ -n "$wname" ] then # ] echo "userdict /HPwmText ($wname) put" # [ Modified by Amit Raval for fixing the defect of printing 'def' on 20/11/98. fi # ] } # ] #---------------------------------------------------------------- # For Watermark Printing : This is used by Output_PS2options to # print the watermark. This function defines the default font, # style, location, size and angle. #---------------------------------------------------------------- User_Dict_Setup() { # [Modified by Kumaresan on 8th Nov'98 to fix the problem of printing bigger # fonts when water mark and -oascii is selected if [ -z "$ascii" ] then # ] echo "%%BeginFeature: *HPNup OneUp" echo "% Copyright (c) Hewlett-Packard Co 1997" echo "userdict begin" echo "true setglobal /HPwm 5 dict dup begin /HPwmOn true def /HPwmOdd true def end def false setglobal " echo "userdict /HPwmAngle known not {/HPwmAngle 45 def} if" echo "userdict /HPwmSize known not {/HPwmSize 48 def} if" echo "userdict /HPwmLocation known not {/HPwmLocation true def} if" echo "userdict /HPwmStyle known not {/HPwmStyle .48 def} if" echo "userdict /HPwmDuplex known not {/HPwmDuplex 0 def} if" echo "/HPwmEOP {HPwmDuplex 0 eq {true}{HPwmDuplex 1 eq HPwmOdd eq dup not {erasepage}if" echo "true setglobal /HPwmOdd HPwmOdd not def false setglobal}ifelse} bind def" echo "end" echo "<<" echo "/EndPage {userdict begin" echo "userdict /HPwmText known HPwm /HPwmOn get and" echo "{initmatrix" echo "0 setgray 1 setlinewidth true setstrokeadjust 0 setlinejoin 0 setlinecap [] 0 setdash" echo "currentpagedevice /PageSize get aload pop 2 div exch 2 div exch translate" echo "HPwmAngle rotate /HPwmFont userdict /HPppScale known {HPwmSize HPppScale mul}{HPwmSize}ifelse selectfont" echo "HPwmText stringwidth 2 div neg exch 2 div neg exch" echo "userdict /HPppScale known {HPwmSize HPppScale mul}{HPwmSize}ifelse .25 mul sub moveto" echo "HPwmText false charpath userdict /HPwmStyle1 known" echo "{gsave 1 setgray HPwmStyle1 HPwmStyle add setlinewidth stroke grestore} if" echo "0 setgray HPwmStyle setlinewidth stroke" echo "HPwmLocation not {true setglobal HPwm /HPwmOn false put false setglobal} if" echo "} if" echo "2 eq {pop false}{pop HPwm begin HPwmEOP end} ifelse" echo "end } bind" echo ">> setpagedevice" echo "%%EndFeature" # [Modified by Kumaresan on 8th Nov'98 to fix the problem of printing bigger # fonts when water mark and -oascii is selected fi # ] } # End of addition by Raju ] # ------ Part II Main Body ------- # [ Modified by Amit Raval to fix the defect# 57429 on Apr. 20th 1999 #PATH="$PATH:/usr/bin:/usr/lbin" PATH="/usr/bin:$PATH:/usr/lbin" # ] export PATH rm -f $TMP/ljx000* # set up redirection of stderr exec 2>>$log # Save the arguments to the model jobid=$1 user=$2 title=$3 # CHANGE TITLE copies=$4 # CHANGE COPIES options=$5 # CHANGE OPTIONS opt6=$6 # Assume that the rest of the arguments are files shift 5 files="$*" if [ "$OS" != "SOLARIS" ] then echo "Start: $jobid `date`" >> $log fi # find out orignal submitted system, and real file names if [ "$OS" = "HP-UX" ] then dfname=`basename $opt6` cfname=`dirname $opt6`/c`expr match $dfname '\d\(.*\)'` syst=`sed -n "/^H/s/H//p" $cfname` fnamelist=`grep "^N" $cfname | sed 's/^N//'` fi # Handle non-JetDirect interface and cancel traps. Setup_iface trap CancelJob 15 # Initialization internal variables Init_variables # [ Added by Devu to handle Banner Tray and Duplex print options 23 sept 1999 Handle_Ban_Tray Handle_dupprint # end of Devu ] # Determine which options have been invoked Parsing_Options # ********** Start sending bytes out **************** echo "\033%-12345X\c" echo "@PJL USTATUS PAGE = OFF" # turn off, to prevent page # fluctuat Profile1 # banner page ; if [ -n "$banner" ] then echo "@PJL JOB" closejob="true" echo "@PJL SET COPIES = 1" # this is to prevent front panel from if [ -z "$reverse" ] then do_pcl_banner banner="" # keep this for back banner fi if [ "$listopt" = "yes" ] then all_options fi else if [ "$listopt" = "yes" ] then echo "@PJL JOB" closejob="true" echo "@PJL SET COPIES = 1" all_options fi fi # turn on upage here, not before banner # to avoid fluctuation if [ "$TEOJ" = "on" ] then echo "@PJL USTATUS PAGE=ON" fi echo "@PJL JOB NAME = \"User: $user; Job: $jobid\" $STARTPAGE $ENDPAGE" if [ "$debug" = "yes" ] then echo "@PJL COMMENT Start Page : $startpg " if [ "$endpg" -eq 0 ] then echo "@PJL COMMENT End Page : Last Page" else echo "@PJL COMMENT End Page : $endpg" fi fi # set up PJL env. if [ "$staple" = "yes" ] then echo "@PJL SET FINISH = STAPLE" fi # [ Added by Raju on 04/09/98 to support lj8100-m320 if [ $PRINTMODEL = "lj8100-m320" ] then if [ $hold != "def" -o $holdtype != "def" ] then ProofNHold_Print # Set Type of Job Retention fi fi # End of addition by Raju ] # [ Modified by Raju on 04/09/98 to support lj8100-m320 # if [ "$topaz" = "yes" ] # then # echo "@PJL SET QTY = $copies" # copies="1" # fi if [ "$topaz" = "yes" ] # collate must be given along with topaz then if [ $collate = "on" ] then echo "@PJL SET QTY = $copies" # collated copies echo "@PJL SET COPIES = 1" elif [ $collate = "off" ] then echo "@PJL SET QTY = 1" echo "@PJL SET COPIES = $copies" # Non-collated copies fi copies=1 fi # End of modification by Raju ] case "$resolution" in # Resolution (dpi) 3 | 300) echo "@PJL SET RESOLUTION = 300" echo "@PJL SET BITSPERPIXEL =1" ;; 6 | 600) echo "@PJL SET RESOLUTION = 600" echo "@PJL SET BITSPERPIXEL =1" ;; 12 | 1200pro | 1200) echo "@PJL SET RESOLUTION = 1200" echo "@PJL SET BITSPERPIXEL =1" ;; 1200fast) echo "@PJL SET RESOLUTION = 600" echo "@PJL SET BITSPERPIXEL =2" ;; esac case "$econo" in # Econo Mode on) echo "@PJL SET ECONOMODE = ON" ;; off) echo "@PJL SET ECONOMODE = OFF";; esac case "$printqty" in # Print Quality draft | normal | high) echo "@PJL SET PRINTQUALITY = $printqty" ;; esac # Set the toner density case "$tdensity" in light) echo "@PJL SET DENSITY = 1" ;; medium) echo "@PJL SET DENSITY = 3" ;; dark) echo "@PJL SET DENSITY = 5" ;; esac case "$rendermode" in # Render Mode color) echo "@PJL SET RENDERMODE = COLOR" ;; gray) echo "@PJL SET RENDERMODE = GRAYSCALE";; esac # This is not used # case "$mediatype" in # paper|glossy|TRANSPARENCY|special) # echo "@PJL SET MEDIATYPE = $mediatype" ;; # esac # Setting fuser mode case "$fuser" in # [ Modified by Raju on 04/09/98 to support lj8100-m320 # normal | low | high | vellum) # high1, high2, high3 are available for lj8100-m320 only normal | low | high | vellum | high1 | high2 | high3) # End of modification by Raju ] case "$mtype" in def) ;; # don't do anything *) Fuser_mode_set ;; esac ;; esac # outbin mailbox using aliases case "$outb" in def ) ;; # do nothing *) echo "@PJL SET OUTBIN = $outb" ;; esac # paper size # note: 10/18/95 it will output in PCL or PS commands, not PJL # due to a few "paper" is not recognized by PJL (e.g. ISOA3) # [ Modified by Raju on 10/09/98 to support lj8100-m320 # echo "@PJL SET COPIES = 1" # this is to prevent front panel from if [ $topaz = "def" ] then echo "@PJL SET COPIES = 1" # this is to prevent front panel from fi # End of Modification by Raju ] copy=1 fno=1 while [ $copy -le $copies ] # until no. of copies do for file in $files # parse and print all files do WRONGTYPE="false" if [ "$lang_user" = "AUTO" ] then Resolve_Lang fi # moved to here from 2up area, so that it can be shared by # both. if [ "$OS" = "HP-UX" ] then fname=`echo $fnamelist | cut -f$fno -d" "` if [ -f /usr/bin/file ] then if /usr/bin/file $file | cut -f2 -d: | $GREP > /dev/null then # let it print WRONGTYPE="true" fi fi fi Profile2 # [Added by Devu to stop PDF files here we dont support them now. # Sept 26 1999 PDFFILE=`head -1 $file | cut -c1-4` if [ "$PDFFILE" = "%PDF" ] then WRONGTYPE="true" fi # end of PDF stop by Devu ] if [ "$WRONGTYPE" = "true" ] then # skip the rest, go to next file echo "@PJL ENTER LANGUAGE=PCL" echo "\033&k2G\c" echo " ERROR!: " echo " -----------------------------" echo " $fname is not a printable file!" echo " It may be one of the following file types: " #[Devu added for PDF problem echo " shar, object, executable, archive, library, compressed" echo " or pdf file. " #end Devu] echo "\033E\033%-12345X@PJL" # Reset Printer; end of PCL file else case "$lang" in RELAY) banner="" cat "$file";; # straight to the printer PS) echo "@PJL ENTER LANGUAGE=POSTSCRIPT" #[ Added by Ramki on 6th Nov 1998 to set the user dict when watermark options # are specified. #User_Dict_Setup is called to set the dictnory to be used by watermark function #This will be called only when either of wmstring or wname options is specified if [ "$wmstdstr" != "def" -o "$wname" != "" ] then User_Dict_Setup # [ Added by Amit Raval to fix the problem of not working watermark for ps1 # on 25th Nov 1998. WaterMark # ] fi #] if [ "$PSLEVEL" = "2" ] then Output_PS2_Options else Output_PS_Options fi #[ Added by Ramki on 6/11/98 for supporting legal,letter in PSNUP case $paper in legal) nuppaper="Legal";; letter) nuppaper="Letter";; *) nuppaper="A4";; esac #] #[ Commented by Ramki on 30 Oct 98 for supporting PSNUP # if [ -z "$ascii" ] # a postscript file, dump it # then # cat "$file" # else # pslp # print ASCII file # fi #] #[ Modified by Ramki to support PSNUP on 30 Oct 1998 if [ -z "$ascii" ] # a postscript file, dump it then # if psnup is set no need of cat'ing the file separately if [ -n "$psnup" ] then $MPAGE -b${nuppaper} -${psnup} $file else cat "$file" fi else #if file to be dumped without interpretting, print PSNUP commands too if [ -n "$psnup" ] then #[ Modified by Devu to fix n-up for PS to ascii conversion # NOV 25 1999 pslp | $MPAGE -b${nuppaper} -${psnup} #$MPAGE -b${nuppaper} -${psnup} $file > $TMP/mpage.$$ #pslp $TMP/mpage.$$ #rm -f $TMP/mpage.$$ # end of changes Devu ] else pslp # print ASCII file fi fi #] echo "\004\033%-12345X\c";; PCL|HPGL2) echo "@PJL ENTER LANGUAGE=PCL" if [ -z "$outputmode_specify" ] then Resolve_Lang # cooked or raw , in case only -opcl if [ "$lang" = "RELAY" -o "$lang" = "PS" ] then outputmode="cooked" fi fi if [ "$OS" = "HP-UX" -a $outputmode = "divide" ] then Setup_Nup fi Output_PCL_Options case "$outputmode" in raw) case "$lang_user" in # [[ Changed by Devu on Sept 25 1999 to fix problems # with -ohpgl* options resetting all previous PCL commands #HPGL2_P) echo "\033E\033&l3O\033%1B\c";; #HPGL2) echo "\033E\033%1B\c";; HPGL2_P) echo "\033&l3O\033%1B\c";; HPGL2) echo "\033%1B\c";; # end of change Devu]] *) ;; esac cat "$file" 2>>$TMP/ljx000$$;; cooked) echo "\033&k2G\c" if [ "$pescfile" = "yes" ] then #[ Modified by Ramki to fix pesc problem on 17/11/98 # sed "s/$esc//g" "$file" | sed 's/\\033//g' | cat cat "$file" | sed 's//\/g' | sed -e 's/\\033/\/g' #] else if [ "$OS" = "HP-UX" ] then if [ -n "$reverse" ] then lprpp $italic $length $nroff < "$file" 2>&1 | reverse $length else if [ "$nroff" = "" ] # only use lprpp when nroff is set then cat "$file" 2>>$TMP/ljx000$$ else lprpp $italic $length $nroff < "$file" 2>&1 fi fi else # Solaris and others cat "$file" 2>>$log fi fi;; mdouble) # only for HP-UX echo "\033&k2G\c" if [ -n "$reverse" ] then lprpp $italic $length $nroff -o < "$file" 2>&1 | reverse $length else lprpp $italic $length $nroff -o < "$file" 2>&1 fi echo "\033&l2H\c" lprpp $italic $length $nroff -e < "$file" 2>&1;; divide) echo "\033&k2G\c" if [ "$OS" = "HP-UX" ] then # [ Modified by Amit Raval to fix the defect# 57427 on Apr 16. 1999 if [ "$dividing" = "8up" ] then if [ "$orientation" = "l" ] then setprinter_8up_landscape else setprinter_8up_portrait fi else # ] if [ "$dividing" != "-hh" ] then if [ "$pescfile" = "yes" ] then #[ Modified by Ramki to fix pesc problem on 25/11/98 # sed "s/$esc//g" "$file" | sed 's/\\033//g' > $TMP/tp sed 's//\/g' "$file" | sed -e 's/\\033/\/g' > $TMP/tp #] mv $TMP/tp $file fi # [Modified by Amit R for fixing problem of not printing 2up for A4 # on 22nd Dec97 # if [ "$paper" = "letter" -o "$paper" = "def" ] if [ "$paper" = "letter" -o "$paper" = "def" -o "$paper" = "ISOA4" ] # ] then # [ Modified by Vijay for rotate option in A4 and letter on 5/10/98 # divpage -$orientation "$dividing" "$file" 2>&1 if [ "$rotate" = "yes" -a "$dividing" = "-h" ] then printfile # divpage doesn't handle rotate option # [ Modified by Devu on May 19, 1999 to solve th 4up problem in HP-UX elif [ "$dividing" = "-q" ] then if [ "$orientation" = "p" ] then Setup_4up_portrait else Setup_4up_landscape fi # End of change by Devu ] else # Changed by Devu to fix 2up landscape problems # divpage -$orientation "$dividing" "$file" 2>&1 printfile # end of change by Devu fi # End of change by Vijay ] #[ Added by Devu to to fix problems in 4up printing for # all other paper sizes. jul 16 1999 elif [ "$dividing" = "-q" ] then if [ "$orientation" = "p" ] then Setup_4up_portrait else Setup_4up_landscape fi #[end of Addition by Devu ] else printfile fi else if [ "$pescfile" = "yes" ] then #[ Modified by Ramki to fix pesc problem on 25/11/98 # sed "s/$esc//g" "$file" | sed 's/\\033//g' > $TMP/tp sed 's//\/g' "$file" | sed -e 's/\\033/\/g' > $TMP/tp #] mv $TMP/tp $file fi printfile fi # [ Modified by Amit Raval to fix the defect# 57427 on Apr 16. 1999 fi # ] else # Solaris or others # [ Modified by Amit Raval to fix the defect# 57427 on Apr 16. 1999 if [ "$dividing" = "8up" ] then if [ "$orientation" = "l" ] then setprinter_8up_landscape else setprinter_8up_portrait fi elif [ "$dividing" = "-q" ] then if [ "$orientation" = "l" ] then Setup_4up_landscape else Setup_4up_portrait fi else # ] printfile $file # [ Modified by Amit Raval to fix the defect# 57427 on Apr 16. 1999 fi # ] fi;; esac # end of output data echo "\033E\033%-12345X@PJL";; # Reset Printer; end of PCL file # back to known state: UEL esac # end of one file (PCL/PS) fi # only correct file type will outptu fno=`expr $fno + 1` # get ready for next copy done # end of one copy of one file copy=`expr $copy + 1` # get ready for next copy fno=1 done if [ -s "$TMP/ljx000$$" ] then cat $TMP/ljx000$$ >> $log rm -f $TMP/ljx000$$ fi echo "@PJL RESET" echo "@PJL EOJ NAME = \"User: $user; Job: $jobid\"" # end-of-job, if [ -n "$banner" ] then if [ "$debug" = "yes" ] then echo "@PJL COMMENT Banner page : Back" fi do_pcl_banner fi # end of job if [ "$closejob" = "true" ] then echo "@PJL RESET" echo "@PJL EOJ" fi if [ "$debug" = "yes" ] then echo "@PJL COMMENT End of Job" fi echo "\033%-12345X\c" # RS-232 interface insure all buffers are flushed to printer if [ -t 1 ] then stty raw $baudrate -parenb cs8 ixon -istrip clocal <&1 2>/dev/null fi if [ "$OS" != "SOLARIS" ] then echo "End: $jobid `date`" >> $log fi exit 0