⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 foo2qpdl-wrapper.in

📁 Linux下的无线网卡通用驱动程序
💻 IN
📖 第 1 页 / 共 2 页
字号:
#	Figure out the paper dimensions in pixels/inch, and set the#	default clipping region.  Unfortunately, this is a trouble#	area for ZjStream printers.  Various versions of ZjS print#	engines react differently when asked to print into their#	unprintable regions.#set_clipping() {    ulx=$1; uly=$2    lrx=$3; lry=$4    # Set clipping region if it isn't already set    if [ "$CLIP_UL" = "" ]; then	case "$RES" in	600x600)	ulx=`expr $ulx / 2`;;	2400x600)	ulx=`expr $ulx \* 2`;;	esac	CLIP_UL="-u ${ulx}x${uly}"    fi    if [ "$CLIP_LR" = "" ]; then	case "$RES" in	600x600)	lrx=`expr $lrx / 2`;;	2400x600)	lrx=`expr $lrx \* 2`;;	esac	CLIP_LR="-l ${lrx}x${lry}"    fi}case "$PAPER" inCustom*)		#%%BeginFeature: *CustomPageSize True		#216		#360		#0		#0		#0		#pop pop pop pop pop		TMPFILE=/tmp/cus$$		cat >$TMPFILE		exec <$TMPFILE		XDIM=`head -n 1000 $TMPFILE | sed -n '/CustomPageSize/{n;p;}'`		case "$XDIM" in		""|0*)		    rm -f $TMPFILE		    error "Custom page size XDIM != 1-99999"		    ;;		esac		XDIM=`dc -e "$XDIM 1200* 72/p"`		YDIM=`head -n 1000 $TMPFILE | sed -n '/CustomPageSize/{n;n;p;}'`		case "$YDIM" in		""|0*)		    rm -f $TMPFILE		    error "Custom page size YDIM != 1-99999"		    ;;		esac		YDIM=`dc -e "$YDIM 600* 72/p"`		PAPER=21;        paper=letter;                set_clipping 2 100     2 100		;;0|letter)	PAPER=0;	paper=letter;    XDIM="10200"; YDIM="6600"		set_clipping 150 100	150 100		;;1|legal)	PAPER=1;	paper=legal;     XDIM="10200"; YDIM="8400"		set_clipping 150 100	150 100		;;3|executive)	PAPER=3;	paper=executive; XDIM="8700";  YDIM="6300"		set_clipping 150 100	150 100		;;2|a4|A4)	PAPER=2;	paper=a4;        XDIM="9920";  YDIM="7016"		set_clipping 150 100	150 100		;;16|a5|A5)	PAPER=16;	paper=a5;        XDIM="6992";  YDIM="4960"		set_clipping 150 100	150 100		;;11|b5jis|B5jis)	PAPER=11;	paper=b5;        XDIM="8598";  YDIM="6070"		set_clipping 150 100	150 100		;;24|folio)	PAPER=24;	paper=folio;     XDIM="10200"; YDIM="7800"		set_clipping 150 100	150 100		;;26|"env#9")	PAPER=26;	paper=env9;      XDIM="4496";  YDIM="5324"		set_clipping 150 100	150 100		;;6|"env#10")	PAPER=6;	paper=env10;     XDIM="4950";  YDIM="5700"		set_clipping 150 100	150 100		;;9|envDL)	PAPER=9;	paper=envDL;     XDIM="5200";  YDIM="5200"		set_clipping 150 100	150 100		;;8|envC5)	PAPER=8;	paper=envC5;     XDIM="7650";  YDIM="5408"		set_clipping 150 100	150 100		;;23|envC6)	PAPER=23;	paper=envC6;     XDIM="5386";  YDIM="3826"		set_clipping 150 100	150 100		;;12|b5iso|B5iso)	PAPER=12;	paper=b5;        XDIM="8314";  YDIM="5906"		set_clipping 150 100	150 100		;;7|envMonarch)	PAPER=7;	paper=envMonarch;XDIM="4650";  YDIM="4500"		set_clipping 150 100	150 100		;;25|env6.75)	PAPER=25;	paper=env6.75;   XDIM="4348";  YDIM="3900"		set_clipping 150 100	150 100		;;17|a6|A6)	PAPER=17;	paper=a6;        XDIM="4960";  YDIM="3496"		set_clipping 150 100	150 100		;;28|oficio)	PAPER=28;	paper=a6;        XDIM="10200"; YDIM="8100"		set_clipping 150 100	150 100		;;*)		error "Unimplemented paper code $PAPER";;esac# e.g. /usr/share/ghostscript/7.07/lib/gs_statd.psPAPERSIZE="-sPAPERSIZE=$paper";case "$RES" in600x600)	XDIM=`expr $XDIM / 2`;;1200x600)	;;1200x1200)	YDIM=`expr $YDIM \* 2`;;esacDIM="${XDIM}x${YDIM}"## Filter thru psnup if N-up printing has been requested#case $NUP in[234689]|1[024568])	PREFILTER="nup";;*)			PREFILTER=cat;;esac##	Overload -G.  If the file name ends with ".icm" or ".ICM"#	then convert the ICC color profile to a Postscript CRD,#	then prepend it to the users job.  Select the intent#	using the -I option.#create_crd() {    #    # Create a Postscript CRD    #    ICC2PS=$PREFIX/bin/foo2zjs-icc2ps    if [ -x $ICC2PS ]; then	case "$GAMMAFILE" in	none | none.icm | */none.icm)	    ;;	*)	    $ICC2PS -o $GAMMAFILE -t$INTENT > $ICCTMP.crd.ps 2>$ICCTMP.log \	    || error "Problem converting .ICM file to Postscript"	    ;;	esac	cat > $ICCTMP.usecie.ps <<-EOF		%!PS-Adobe-3.0		<</UseCIEColor true>>setpagedevice	EOF	if [ "$QUALITY" = wts ]; then	    cat >> $ICCTMP.usecie.ps <<-EOF		<< /UseWTS true >> setuserparams		<<		    /AccurateScreens true		    /HalftoneType 1		    /HalftoneName (Round Dot Screen) cvn		    /SpotFunction { 180 mul cos exch 180 mul cos add 2 div}		    /Frequency 137		    /Angle 37		>> sethalftone		EOF	fi	cat > $ICCTMP.selcrd.ps <<-EOF		/Current /ColorRendering findresource setcolorrendering	EOF	case "$GAMMAFILE" in	none | none.icm | */none.icm) GAMMAFILE="$ICCTMP.usecie.ps";;	*)	GAMMAFILE="$ICCTMP.usecie.ps $ICCTMP.crd.ps $ICCTMP.selcrd.ps";;	esac    else	GAMMFILE=    fi}if [ $DEBUG -gt 0 ]; then    ICCTMP=/tmp/iccelse    ICCTMP=/tmp/icc$$fiif [ "" = "$COLOR" ]; then    COLORMODE=    GAMMAFILE=else    case "$COLORMODE" in    default)	COLORMODE=$DEFAULTCOLORMODE;;    esacfiCRDBASE="$PREFIX/share/foo2qpdl/crd"case "$MODEL" in    0)	model=CLP-300;;    1)	model=CLP-600;;esaccase "$RES" in    600x600)	SCREEN=$model-600x600cms2;;    1200x600)	SCREEN=$model-1200x600cms2;;    1200x1200)	SCREEN=$model-1200x1200cms2;;esaccase "$COLORMODE" in0|"")    # Monochrome    ;;10|icm)    # Use old ICM method    AIB=-A    BC=-B    case "$GAMMAFILE" in    none | none.icm | */none.icm)	create_crd	;;    *.icm|*.ICM|*.icc|*.ICC)	#	# Its really an .ICM file, not a gamma file.	#	# The file can be a full path name, or the name of a file in $SHARE/icm/	#	if [ -r "$GAMMAFILE" ]; then	    create_crd	elif [ -r "$SHARE/icm/$GAMMAFILE" ]; then	    GAMMAFILE="$SHARE/icm/$GAMMAFILE"	    create_crd	else	    GAMMAFILE=	fi	;;    esac    ;;1|crd)    # CRD    GAMMAFILE=""    GAMMAFILE="$GAMMAFILE $CRDBASE/${model}cms"    GAMMAFILE="$GAMMAFILE $CRDBASE/$SCREEN"    # Black text...    TMPFILE2=/tmp/black$$    cat $CRDBASE/black-text.ps - >$TMPFILE2    exec <$TMPFILE2    ;;*.crd)    GAMMAFILE="$CRDBASE/prolog.ps"    if [ -f $COLORMODE ]; then	GAMMAFILE="$GAMMAFILE $COLORMODE"    elif [ -f $CRDBASE/$COLORMODE ]; then	GAMMAFILE="$GAMMAFILE $CRDBASE/$COLORMODE"    else	error "Can't find CRD '$COLORMODE' in . or in $CRDBASE"    fi    GAMMAFILE="$GAMMAFILE $CRDBASE/$SCREEN"    ;;*)    error "Unknown color method '$COLORMODE'"    ;;esacif [ "" != "$COLOR" ]; then    if [ "" = "$AIB" -a "" = "$BC" ]; then	# Faster, but can't handle AllIsBlack or BlackClears	GSDEV=-sDEVICE=pksmraw    else	# Can't handle different size pages	GSDEV=-sDEVICE=bitcmyk    fifi##	Figure out USERNAME#if [ "$LPUSER" != "" ]; then    USER="$LPUSER@$LPHOST"else    USER=""fi##	Main Program, just cobble together the pipeline and run it##	The malarky with file descriptors 1 and 3 is to avoid a bug in#	(some versions?) of Ghostscript where Postscript's stdout gets#	intermingled with the printer drivers output, resulting in#	corrupted image data.#GS="$GSBIN -q -dBATCH -dSAFER -dQUIET -dNOPAUSE"sed 's#^[^/]*cupsPSLevel2#false#' | \$PREFILTER \| ($GS $PAPERSIZE -g$DIM -r$RES $GSDEV $GSOPTS \    -sOutputFile="|cat 1>&3" $GAMMAFILE - >/dev/null) 3>&1 \| foo2qpdl -r$RES -g$DIM -p$PAPER -m$MEDIA -n$COPIES -d$DUPLEX -s$SOURCE \	    $COLOR $CLIP_UL $CLIP_LR $CLIP_LOG $SAVETONER \	    -J "$LPJOB" -U "$USER" \	    $BC $AIB $COLOR2MONO $NOPLANES $EXTRAPAD -D$DEBUG##	Log the command line, for debugging and problem reports#if [ -x /usr/bin/logger ]; then    logger -t "$BASENAME" -p lpr.info -- \	"$GSBIN $PAPERSIZE -g$DIM -r$RES $GSDEV $GSOPTS $GAMMAFILE"    logger -t "$BASENAME" -p lpr.info -- \	"foo2qpdl -r$RES -g$DIM -p$PAPER -m$MEDIA \-n$COPIES -d$DUPLEX -s$SOURCE $COLOR $CLIP_UL $CLIP_LR $CLIP_LOG \$SAVETONER $BC $AIB $COLOR2MONO $NOPLANES $EXTRAPAD"fi##	Remove cruft#if [ $DEBUG -eq 0 ]; then    for i in crd.ps log usecie.ps selcrd.ps    do	file="$ICCTMP.$i"	[ -f $file ] && rm -f $file    done    [ -f "$TMPFILE" ] && rm -f $TMPFILE    [ -f "$TMPFILE2" ] && rm -f $TMPFILE2fiexit 0

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -