diff --git a/arm2hpdl b/arm2hpdl deleted file mode 100755 index af0cace..0000000 Binary files a/arm2hpdl and /dev/null differ diff --git a/arm2hpdl.1 b/arm2hpdl.1 deleted file mode 100644 index 182176d..0000000 --- a/arm2hpdl.1 +++ /dev/null @@ -1,220 +0,0 @@ -'\" t -'\" -'\" DO NOT EDIT! This file is generated from arm2hpdl.1in -'\" -.TH arm2hpdl 1 "Sun May 26 18:25:20 2024" "arm2hpdl 0.0" -'\" -'\" -'\"========================================================================== -'\" STRINGS and MACROS -'\"========================================================================== -'\" -'\" Define strings for special characters that nroff doesn't have -'\" -'\" N.B. using .if cua to test for special characters did not work. -'\" -.if !'\*[.T]'ps' .ds ua up -.if '\*[.T]'ps' .ds ua \(ua -.if !'\*[.T]'ps' .ds da down -.if '\*[.T]'ps' .ds da \(da -.if !'\*[.T]'ps' .ds <- left -.if '\*[.T]'ps' .ds <- \(<- -.if !'\*[.T]'ps' .ds -> right -.if '\*[.T]'ps' .ds -> \(-> -'\" -'\" bx - box a Courier string for making keycaps -'\" -'\" N.B. this mess is to make the line drawing come out only -'\" if we are really generating postscript -'\" -.de bx -.ie !'\*[.T]'ps' \{\ -. RB [ \\$1 ]\\$2 -.\} -.el \{\ -. ie !r ps4html \{\ -'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul' -. ft CW -. nr par*bxw \w'\\$1'+.4m -\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\ -\Z'\h'.2m'\s-1\\$1\s+1'\ -\h'\\n[par*bxw]u'\\$2 -. ft P -. \} -. el \{\ -. RB [ \\$1 ]\\$2 -. \} -.\} -.. -'\" -'\" strings to set current color (null with old groff) -'\" -.if mred .ds red \m[red] -.if mgreen .ds green \m[green] -.if mblue .ds blue \m[blue] -.if mblack .ds black \m[black] -.if mblack .ds mP \mP -'\" -'\" fix for grotty + xterm. We call for orange, grotty outputs yellow, -'\" but xterm displays yellow as orange. The cycle is complete. -'\" -.if n .defcolor orange rgb #ffff00 -'\" -'\" color - set the current color (ignores request with old groff) -'\" -.de color -.if mred \m[\\$1]\c -.. -'\" -'\" colorword - colorize a word (ignored by old groff) -'\" -.de colorword -.ie m\\$1 \m[\\$1]\\$2\mP\c -.el \\$2\c -.. -'\" -'\" colbox - colorize a word in a filled box -'\" -.de colbox -.ie mred \M[\\$2]\ -\v'+.167v'\ -\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\ -\v'-.167v'\ -\m[\\$1]\\$3\mP\MP -.el \\$3\c -.. -'\" -'\" Macros for doing pdfmarks -'\" -.de specialps -.if '\*[.T]'ps' \\k_\X'ps: \\$*'\h'|\\n_u'\c -.. -'\" -'\" pdfmark PDFMARKCODE -'\" -.ds pdfmarks -.if d pdfmarks \{\ -.de pdfmark -. specialps exec [\\$1 pdfmark -.. -'\" -'\" pdfdest LINKNAME -'\" -.de pdfdest -.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST" -.. -'\" -'\" pdfbookmark COUNT LINKNAME STRING -'\" -.de pdfbookmark -. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT" -.. -'\" -'\" Define the SH and SS macros to save pdfmark information -'\" in "arrays" of numbers and strings. -'\" -.if !r rr_n \{\ -.nr rr_n 0 1 -.am SH -. nr rr_levels!\\n+[rr_n] 2 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.am SS -. nr rr_levels!\\n+[rr_n] 3 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.\} -'\" -'\" Called at the end of the document to generate the pdfmark outline -'\" -.de pdf_outline -.nr rr_levels!\\n+[rr_n] 1 -.nr rr_i 0 1 -.while \\n+[rr_i]<\\n[rr_n] \{\ -. nr rr_ip1 \\n[rr_i]+1 -. nr rr_count 0 -. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\ -. nr rr_j \\n[rr_i] 1 -. while \\n+[rr_j]<\\n[rr_n] \{\ -. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\ -. break -. \} -. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\ -. nr rr_count \\n[rr_count]+1 -. \} -. \} -. \} -. ds hhh \\*[rr_labels!\\n[rr_i]] -. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]" -.\} -.. -'\" -'\" Some postscript to make pdfmarks harmless on old interpreters... -'\" -.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse" -'\" -'\" Force display of Bookmarks in Acrobat when document is viewed. -'\" -.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW" -'\" -'\" Output the document info in pdfmarks -'\" -.pdfmark "\ - /Title (\*[an-title](\*[an-section])) \ - /Subject (\*[an-title] Manual Page) \ - /Author (Rick Richardson) \ - /Keywords (printing) \ - /Creator (groff \n(.x.\n(.y.\n(.Y -man) \ - /CreationDate (\*[an-extra1]) \ - /ModDate (\*[an-extra1]) \ - /DOCINFO" -\} -'\" -'\" The manual page name is only 1st level mark -'\" -.nr rr_levels!\n+[rr_n] 1 -.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section]) -.pdfdest Link\n[rr_n] -'\" -'\"========================================================================== -'\" MANUAL PAGE SOURCE -'\"========================================================================== -.SH NAME -arm2hpdl \- Add HP download header/trailer to an ARM ELF binary. -.SH SYNOPSIS -.B arm2hpdl -.RI [ options "] arm-binary.img > hpdl.dl" -.SH DESCRIPTION -.B arm2hpdl -adds an HP download header/trailer to an ARM ELF binary. -If the file already has an HP header, just copy it to stdout. -.SH COMMAND LINE OPTIONS -These are the options that can appear on the command line. -.TP -.BI \-D\0 level -Set Debug level [0]. - -.SH EXAMPLES -Add an HPDL header to a HP LaserJet 1005. - -.nf -.ft CW -$ arm2hpdl sihp1005.img > sihp1005.dl -.ft P -.fi - -.SH FILES -.BR /usr/bin/arm2hpdl, -.BR /usr/share/foo2*/firmware/ -.SH SEE ALSO -.BR foo2zjs (1) -.SH "AUTHOR" -Rick Richardson -.br -http://foo2zjs.rkkda.com/ -'\" -'\" -'\" -.em pdf_outline diff --git a/crd/zjs/prolog.ps b/crd/zjs/prolog.ps index 4b87922..cebce2d 100644 Binary files a/crd/zjs/prolog.ps and b/crd/zjs/prolog.ps differ diff --git a/crd/zjs/screen1200.ps b/crd/zjs/screen1200.ps index 12e00bf..a468bdf 100644 Binary files a/crd/zjs/screen1200.ps and b/crd/zjs/screen1200.ps differ diff --git a/foo2hbpl1 b/foo2hbpl1 deleted file mode 100755 index 8347674..0000000 Binary files a/foo2hbpl1 and /dev/null differ diff --git a/foo2hbpl1-wrapper b/foo2hbpl1-wrapper deleted file mode 100755 index 474972d..0000000 --- a/foo2hbpl1-wrapper +++ /dev/null @@ -1,577 +0,0 @@ -#!/bin/sh - -#* Copyright (C) 2013 Rick Richardson -#* -#* This program is free software; you can redistribute it and/or modify -#* it under the terms of the GNU General Public License as published by -#* the Free Software Foundation; either version 2 of the License, or -#* (at your option) any later version. -#* -#* This program is distributed in the hope that it will be useful, -#* but WITHOUT ANY WARRANTY; without even the implied warranty of -#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -#* GNU General Public License for more details. -#* -#* You should have received a copy of the GNU General Public License -#* along with this program; if not, write to the Free Software -#* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#* -#* Authors: Rick Richardson - -VERSION='$Id: foo2hbpl1-wrapper.in,v 1.3 2014/03/24 23:14:24 rick Exp $' - -# -# Printer Notes: -# -# Dell 1250c -# Dell C1660w -# Dell C1760w -# Epson AcuLaser C1700 -# Fuji-Xerox DocuPrint CP105b -# - -PROGNAME="$0" -BASENAME=`basename $PROGNAME` -PREFIX=/usr -SHARE=$PREFIX/share/foo2hbpl -PATH=$PATH:/sw/bin:/opt/local/bin - -# -# Log the command line, for debugging and problem reports -# -if [ -x /usr/bin/logger -o -x /bin/logger ]; then - logger -t "$BASENAME" -p lpr.info -- "$BASENAME $@" &2 - exit 1 -} - -dbgcmd() { - if [ $DEBUG -ge 1 ]; then - echo "$@" >&2 - fi - "$@" -} - -# -# N-up-ify the job. Requires psnup from psutils package -# -nup() { - case "$NUP" in - [2368]|1[0458]) - tr '\r' '\n' | psnup $NUP_ORIENT -d2 -$NUP -m.3in -p$paper -q - ;; - [49]|1[26]) - tr '\r' '\n' | psnup $NUP_ORIENT -d2 -$NUP -m.5in -p$paper -q - ;; - *) - error "Illegal call to nup()." - ;; - esac -} - -# -# Process the options -# - -# Try to use a local copy of GhostScript 8.54, if available. Otherwise, -# fallback to whatever the Linux distro has installed (usually 7.07) -# -# N.B. := operator used here, when :- would be better, because "ash" -# doesn't have :- -if eval gs.foo -v >/dev/null 2>&1; then - GSBIN=${GSBIN:-gs.foo} -else - GSBIN=${GSBIN:-gs} -fi - -CMDLINE="$*" -DEBUG=0 -COLOR= -COLORMODE=default -MODEL=0 -MEDIA=1 # plain -COPIES=1 -PAPER=letter -RES=600x600 # do not change this -SOURCE=1 -NUP= -CLIP_ALL= -BC= -AIB= -NOPLANES= -COLOR2MONO= -GAMMAFILE=default -INTENT=0 -GSOPTS= -EXTRAPAD= -SAVETONER= -NUP_ORIENT= -GSDEV=-sDEVICE=pgmraw -# What mode to use if the user wants us to pick the "best" mode -case `$GSBIN --version` in -7*) DEFAULTCOLORMODE=10 - DEFAULTCOLORMODE=1 - ;; -8.1*) - DEFAULTCOLORMODE=1 - QUALITY=1 - ;; -*) DEFAULTCOLORMODE=1 - ;; -esac -while getopts "1:23456789o:b:cC:d:g:l:u:L:m:n:p:q:s:tz:ABS:D:G:I:PX:Vh?" opt -do - case $opt in - b) GSBIN="$OPTARG";; - c) COLOR=-c;; - d) DUPLEX="$OPTARG";; - g) GSOPTS="$GSOPTS $OPTARG";; - m) MEDIA="$OPTARG";; - n) COPIES="$OPTARG";; - p) PAPER="$OPTARG";; - q) QUALITY="$OPTARG";; - s) SOURCE="$OPTARG";; - t) SAVETONER="-t";; - z) MODEL="$OPTARG";; - u) CLIP_ALL="-u $OPTARG";; - A) AIB=-A;; - B) BC=-B;; - C) COLORMODE="$OPTARG";; - S) COLOR2MONO="-S$OPTARG";; - D) DEBUG="$OPTARG";; - G) GAMMAFILE="$OPTARG";; - I) INTENT="$OPTARG";; - P) NOPLANES=-P;; - X) EXTRAPAD="-X $OPTARG";; - [234689]) NUP="$opt";; - [57]) error "Can't find acceptable layout for $opt-up";; - 1) case "$OPTARG" in - [024568]) NUP="1$OPTARG";; - *) error "Can't find acceptable layout for 1$OPTARG-up";; - esac - ;; - o) case "$OPTARG" in - l*) NUP_ORIENT=-l;; - s*) NUP_ORIENT=-r;; - p*|*) NUP_ORIENT=;; - esac;; - V) echo "$VERSION"; foo2hbpl -V; foo2zjs-pstops -V; exit 0;; - h|\?) - if [ "$CMDLINE" != "-?" -a "$CMDLINE" != -h ]; then - echo "Illegal command:" - echo " $0 $CMDLINE" - echo - fi - usage;; - esac -done -shift `expr $OPTIND - 1` - -# -# If there is an argument left, take it as the file to print. -# Else, the input comes from stdin. -# -if [ $# -ge 1 ]; then - if [ "$LPJOB" = "" ]; then - : # LPJOB="$1" - fi - exec < $1 -fi - -# -# Validate media code -# -case "$MEDIA" in -1|plain) MEDIA=1;; -2|bond) MEDIA=2;; -3|lwcard) MEDIA=3;; -4|lwgcard) MEDIA=4;; -5|labels) MEDIA=5;; -6|envelope) MEDIA=6;; -7|recycled) MEDIA=7;; -8|plain2) MEDIA=8;; -9|bond2) MEDIA=9;; -10|lwcard2) MEDIA=10;; -11|lwgcard2) MEDIA=11;; -12|recycled2) MEDIA=12;; -[0-9]*) ;; -*) error "Unknown media code $MEDIA";; -esac - -# -# Validate source (InputSlot) code -# -case "$SOURCE" in -1|auto) SOURCE=1;; -2|manual) SOURCE=2;; -3|multi) SOURCE=3;; -4|tray1) SOURCE=4;; -[0-9]*) ;; -*) error "Unknown source code $SOURCE";; -esac - -# -# 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() { - - # Set clipping region if it isn't already set - if [ "$CLIP_ALL" = "" ]; then - CLIP_ALL="-u $1,$2,$3,$4" - fi -} - -case "$PAPER" in -Custom*x*) - # Command line only - XDIM=`echo "$PAPER" | sed -e "s/Custom.//" -e "s/x.*//" ` - YDIM=`echo "$PAPER" | sed -e "s/.*x//" ` - if [ "$XDIM" = "" -o "$YDIM" = "" ]; then - error "Custom page size '$PAPER' != 1-99999" - fi - if [ "$XDIM" -eq 0 -o "$YDIM" -eq 0 ]; then - error "Custom page size '$PAPER' != 1-99999" - fi - XDIM=`dc -e "$XDIM 600* 72/p"` - YDIM=`dc -e "$YDIM 600* 72/p"` - PAPER=21; paper=letter; - DIM="${XDIM}x${YDIM}" - ;; -Custom*) - #%%BeginFeature: *CustomPageSize True - #216 - #360 - #0 - #0 - #0 - #pop pop pop pop pop - - #%%BeginFeature: *CustomPageSize True - #792.000000 612.000000 1 0.000000 0.000000 - #pop pop pop pop pop - - if [ $DEBUG = 0 ]; then - TMPFILE=/tmp/cus$$ - else - TMPFILE=/tmp/custom.ps - fi - cat >$TMPFILE - exec <$TMPFILE - - tmp=`head -n 10000 $TMPFILE \ - | sed -n '/CustomPageSize/{n;p;n;p;}' \ - | tr '\n' ' '` - case "$tmp" in - [0-9]*\ [0-9]*) - XDIM=`echo "$tmp" | sed 's/ .*//'` - YDIM=`echo "$tmp" | sed -e 's/^[^ ]* //' -e 's/ .*//'` - ;; - *) - if [ $DEBUG = 0 ]; then rm -f $TMPFILE; fi - error "Custom page size [XY]DIM != 1-99999" - ;; - esac - XDIM=`dc -e "$XDIM 600* 72/p"` - YDIM=`dc -e "$YDIM 600* 72/p"` - PAPER=21; paper=letter; - DIM="${XDIM}x${YDIM}" - ;; - -# Use names that Ghostscript recognizes, referring to -# /usr/share/ghostscript/9.10/Resource/Init/gs_statd.ps -# foo2hbpl1 will provide the appropriate numeric value - -4|letter|Letter) DIM=5100x6600 ;; -7|legal|Legal) DIM=5100x8400 ;; -1|a4|A4) DIM=4961x7016 ;; -5|executive|Executive) DIM=4350x6300 ;; -9|env10|Env10) DIM=2475x5700 ;; -10|monarch|EnvMonarch) DIM=2325x4500 ;; -11|c5|EnvC5) DIM=3827x5409 ;; -12|envDL|EnvDL) DIM=2599x5197 ;; -isob5|b5) DIM=4158x5906 ;; -2|jisb5|B5jis) DIM=4299x6071 ;; -3|a5|A5) DIM=3496x4961 ;; -6|folio|Folio) DIM=5100x7800 ;; -pa4) DIM=4961x6600 ;; -archA) DIM=5400x7200 ;; -*) error "Unimplemented paper code $PAPER";; -esac - -#set_clipping 47 48 51 46 # exact values for Dell C1660w on letter paper - set_clipping 51 51 51 51 # default is 0.085 inches all around - -PAPERSIZE="-sPAPERSIZE=$PAPER"; - -# -# Filter thru psnup if N-up printing has been requested -# -case $NUP in -[234689]|1[024568]) PREFILTER="nup";; -*) PREFILTER=cat;; -esac -if [ "$DEBUG" -ge 9 ]; then - PREFILTER="tee /tmp/$BASENAME.ps" -fi - -# -# 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) - ;; - *) - if [ -x /usr/bin/logger ]; then - logger -t "$BASENAME" -p lpr.info -- \ - "`basename $ICC2PS` -o $GAMMAFILE -t$INTENT > $ICCTMP.crd.ps" - fi - $ICC2PS -o $GAMMAFILE -t$INTENT > $ICCTMP.crd.ps 2>$ICCTMP.log \ - || error "Problem converting .ICM file to Postscript" - ;; - esac - - PSTOPS_OPTS="$PSTOPS_OPTS -c" - cat > $ICCTMP.usecie.ps <<-EOF - %!PS-Adobe-3.0 - <>setpagedevice - EOF - if [ "$QUALITY" = wts -o "$QUALITY" = as ]; then - if [ "$QUALITY" = wts ]; then - cat >> $ICCTMP.usecie.ps <<-EOF - << /UseWTS true >> setuserparams - EOF - else - cat >> $ICCTMP.usecie.ps <<-EOF - << /UseWTS false >> setuserparams - EOF - fi - cat >> $ICCTMP.usecie.ps <<-EOF - << - /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 - GAMMAFILE= - fi -} - -if [ $DEBUG -gt 0 ]; then - ICCTMP=/tmp/icc -else - ICCTMP=/tmp/icc$$ -fi - -if [ "" = "$COLOR" ]; then - COLORMODE= - GAMMAFILE= -else - case "$COLORMODE" in - default) COLORMODE=$DEFAULTCOLORMODE;; - esac - case "$GAMMAFILE" in - default) GAMMAFILE=samclp300-0.icm;; - esac -fi - -CRDBASE="$PREFIX/share/foo2hbpl/crd" -case "$MODEL" in - 0) model=CLP-300;; - 1) model=CLP-600;; - 2) model=CLP-600;; - 3) model=CLP-600;; -esac - -PSTOPS_OPTS="-n" - -case "$COLORMODE" in -0|"") - # 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'" - ;; -esac - -if [ "" != "$COLOR" ]; then - GSDEV=-sDEVICE=pamcmyk32 - $GSBIN --help | grep -q pamcmyk32 || GSDEV=-sDEVICE=ppmraw -fi - -# -# 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" - -foo2zjs-pstops $PSTOPS_OPTS | \ -$PREFILTER \ -| ($GS $PAPERSIZE -g$DIM -r$RES $GSDEV $GSOPTS \ - -sOutputFile="|cat 1>&3" $GAMMAFILE -_ >/dev/null) 3>&1 \ -| foo2hbpl1 -m$MEDIA $CLIP_ALL -J "$LPJOB" -U "$USER" - -# -# 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 -- \ - "foo2hbpl1 -m$MEDIA $CLIP_ALL" -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 $TMPFILE2 -fi - -exit 0 diff --git a/foo2hbpl1-wrapper.1 b/foo2hbpl1-wrapper.1 deleted file mode 100644 index d9c3f24..0000000 --- a/foo2hbpl1-wrapper.1 +++ /dev/null @@ -1,416 +0,0 @@ -'\" t -'\" -'\" DO NOT EDIT! This file is generated from foo2hbpl1-wrapper.1in -'\" -'\" t -.TH foo2hbpl1-wrapper 1 "Sun May 26 18:25:20 2024" "foo2hbpl1-wrapper 0.0" -'\" -'\" -'\"========================================================================== -'\" STRINGS and MACROS -'\"========================================================================== -'\" -'\" Define strings for special characters that nroff doesn't have -'\" -'\" N.B. using .if cua to test for special characters did not work. -'\" -.if !'\*[.T]'ps' .ds ua up -.if '\*[.T]'ps' .ds ua \(ua -.if !'\*[.T]'ps' .ds da down -.if '\*[.T]'ps' .ds da \(da -.if !'\*[.T]'ps' .ds <- left -.if '\*[.T]'ps' .ds <- \(<- -.if !'\*[.T]'ps' .ds -> right -.if '\*[.T]'ps' .ds -> \(-> -'\" -'\" bx - box a Courier string for making keycaps -'\" -'\" N.B. this mess is to make the line drawing come out only -'\" if we are really generating postscript -'\" -.de bx -.ie !'\*[.T]'ps' \{\ -. RB [ \\$1 ]\\$2 -.\} -.el \{\ -. ie !r ps4html \{\ -'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul' -. ft CW -. nr par*bxw \w'\\$1'+.4m -\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\ -\Z'\h'.2m'\s-1\\$1\s+1'\ -\h'\\n[par*bxw]u'\\$2 -. ft P -. \} -. el \{\ -. RB [ \\$1 ]\\$2 -. \} -.\} -.. -'\" -'\" strings to set current color (null with old groff) -'\" -.if mred .ds red \m[red] -.if mgreen .ds green \m[green] -.if mblue .ds blue \m[blue] -.if mblack .ds black \m[black] -.if mblack .ds mP \mP -'\" -'\" fix for grotty + xterm. We call for orange, grotty outputs yellow, -'\" but xterm displays yellow as orange. The cycle is complete. -'\" -.if n .defcolor orange rgb #ffff00 -'\" -'\" color - set the current color (ignores request with old groff) -'\" -.de color -.if mred \m[\\$1]\c -.. -'\" -'\" colorword - colorize a word (ignored by old groff) -'\" -.de colorword -.ie m\\$1 \m[\\$1]\\$2\mP\c -.el \\$2\c -.. -'\" -'\" colbox - colorize a word in a filled box -'\" -.de colbox -.ie mred \M[\\$2]\ -\v'+.167v'\ -\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\ -\v'-.167v'\ -\m[\\$1]\\$3\mP\MP -.el \\$3\c -.. -'\" -'\" Macros for doing pdfmarks -'\" -.de specialps -.if '\*[.T]'ps' \\k_\X'ps: \\$*'\h'|\\n_u'\c -.. -'\" -'\" pdfmark PDFMARKCODE -'\" -.ds pdfmarks -.if d pdfmarks \{\ -.de pdfmark -. specialps exec [\\$1 pdfmark -.. -'\" -'\" pdfdest LINKNAME -'\" -.de pdfdest -.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST" -.. -'\" -'\" pdfbookmark COUNT LINKNAME STRING -'\" -.de pdfbookmark -. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT" -.. -'\" -'\" Define the SH and SS macros to save pdfmark information -'\" in "arrays" of numbers and strings. -'\" -.if !r rr_n \{\ -.nr rr_n 0 1 -.am SH -. nr rr_levels!\\n+[rr_n] 2 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.am SS -. nr rr_levels!\\n+[rr_n] 3 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.\} -'\" -'\" Called at the end of the document to generate the pdfmark outline -'\" -.de pdf_outline -.nr rr_levels!\\n+[rr_n] 1 -.nr rr_i 0 1 -.while \\n+[rr_i]<\\n[rr_n] \{\ -. nr rr_ip1 \\n[rr_i]+1 -. nr rr_count 0 -. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\ -. nr rr_j \\n[rr_i] 1 -. while \\n+[rr_j]<\\n[rr_n] \{\ -. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\ -. break -. \} -. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\ -. nr rr_count \\n[rr_count]+1 -. \} -. \} -. \} -. ds hhh \\*[rr_labels!\\n[rr_i]] -. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]" -.\} -.. -'\" -'\" Some postscript to make pdfmarks harmless on old interpreters... -'\" -.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse" -'\" -'\" Force display of Bookmarks in Acrobat when document is viewed. -'\" -.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW" -'\" -'\" Output the document info in pdfmarks -'\" -.pdfmark "\ - /Title (\*[an-title](\*[an-section])) \ - /Subject (\*[an-title] Manual Page) \ - /Author (Rick Richardson) \ - /Keywords (printing) \ - /Creator (groff \n(.x.\n(.y.\n(.Y -man) \ - /CreationDate (\*[an-extra1]) \ - /ModDate (\*[an-extra1]) \ - /DOCINFO" -\} -'\" -'\" The manual page name is only 1st level mark -'\" -.nr rr_levels!\n+[rr_n] 1 -.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section]) -.pdfdest Link\n[rr_n] -'\" -'\"========================================================================== -'\" MANUAL PAGE SOURCE -'\"========================================================================== -.SH NAME -foo2hbpl1-wrapper \- Convert Postscript into a ZJS printer stream -.SH SYNOPSIS -.B foo2hbpl1-wrapper -.RI [ options "] [" ps-file ] -.SH DESCRIPTION -.B foo2hbpl1-wrapper -is a Foomatic compatible printer wrapper for the \fBfoo2hbpl1\fP printer driver. -This script reads a Postscript \fIps-file\fP or standard input -and converts it to Zenographics ZjStream printer format -for driving the -Dell 1250c, Dell C1660w, Dell C1760w, -Epson AcuLaser C1700, -and Fuji-Xerox CP105b printers. -.P -This script can be used in a standalone fashion, but is intended to -be called from a printer spooler system which uses the Foomatic -printer database. - -.SH COMMAND LINE OPTIONS -.SS Normal Options -These are the options used to select the parameters of a -print job that are usually controlled on a per job basis. -.TP -.BI \-c -Print in color (else monochrome). -.TP -.BI \-C\0 colormode -Color correction mode [0]. -.TS -n l . -10 ICM color profile (using -G *.icm file) -.TE -.TP -.BI \-d\0 duplex -Duplex code to send to printer [1]. -.TS -| n l | n l | n l . -1 off 2 long edge 3 short edge -.TE -.TP -.BI \-m\0 media -Media code to send to printer [1]. -.TS -l r. -_ -Media HBPL -_ -plain 1 -bond 2 -lwcard 3 -lwgcard 4 -labels 5 -envelope 6 -recycled 7 -plain2 8 -bond2 9 -lwcard2 10 -lwgcard2 11 -recycled2 12 -.TE -.TP -.BI \-p\0 paper -Paper size code to send to printer [1]. -.TS -l r. -_ -Paper HBPL -_ -A4 1 -B5jis 2 -letter 4 -executive 5 -fanfold german legal 6 -folio 6 -legal 7 -env#10 9 -envMonarch 10 -envC5 11 -envDL 12 -.TE -.TP -.BI \-n\0 copies -Number of copies [1]. -.TP -.BI \-r\0 xres x yres -Set device resolution in pixels/inch [1200x600]. -.TP -.BI \-s\0 source -Source (Input Slot) code to send to printer [7]. -.TS -| n l | n l. -1 upper 4 manual -2 lower 7 auto -.TE -.TP -.BI \-t -Draft mode. Every other pixel is white. -.TP -.BI \-T\0 density -Print density (1-5). The default is 3 (medium). -.TP -.BI "\-2 \-3 \-4 \-5 \-6 \-8 \-9 \-10 \-12 \-14 \-15 \-16 \-18" -Print in N-up. Requires the \fBpsutils\fP package. -.TP -.BI \-o\0 orient -Orientation used for N-up. -.TS -l l l. -Portrait -op (normal) -Landscape -ol (rotated 90 degrees anticlockwise) -Seascape -os (rotated 90 degrees clockwise) -.TE -.SS Printer Tweaking Options -These are the options used to customize the operation of \fBfoo2hbpl1\fP -for a particular printer. -.TP -.BI \-u\0 xoff x yoff -Set the offset of the start of the printable region from the -upper left corner, in pixels [varies with paper size]. -The defaults should work on the 2200DL and 2300DL, and have not -been tested on any other printers. -.TP -.BI \-l\0 xoff x yoff -Set the offset of the end of the printable region from the -lower right corner, in pixels [varies with paper size]. -The defaults should work on the 2200DL and 2300DL, and have not -been tested on any other printers. -.TP -.BI \-L\0 mask -Send the logical clipping values from -u/-l in the ZjStream. -\fBfoo2hbpl1-wrapper\fP always runs Ghostscript with the ideal page dimensions, -so that the scale of the image is correct, -regardless whether or not the printer has unprintable regions. -This option is used to move the position of the clipped image -back to where it belongs on the page. The default is to send -the amount which was clipped by -u and -l, and should be -good in most cases. -.TS -l l. -0 don't send any logical clipping amounts -1 only send Y clipping amount -2 only send X clipping amount -3 send both X and Y clipping amounts -.TE -.TP -.BI \-P -Do not send START_PLANE codes on monochrome output. May be -needed by some monochrome-only printers, such as the -HP LaserJet 1000. -.TP -.BI \-X\0 padlen -Add extra zero padding to the end of BID segments. The default is -16 bytes. Padding 16 bytes of zeroes -is needed for older ZjStream printers, such as the Minolta 2200DL -and HP LaserJet 1000, and seems harmless to newer ones, such as -the Minolta 2300DL. So the default should be good for all cases. -.SS Color Tweaking Options -These are the options used to control the quality of color output. -Color correction is currently a WORK IN PROGRESS. -.TP -.BI \-g\0 gsopts -Additional options to pass to Ghostscript, such as -g\(lq-dDITHERPPI=nnn\(rq, -etc. This option may appear more than once. -.TP -.BI \-G\0 profile.icm -Convert \fIprofile.icm\fP to a Postscript color rendering -dictionary (CRD) using \fBfoo2zjs-icc2ps\fP and -adjust the printer colors by using the Postscript \fBsetcolorrendering\fP -operator. (WORK IN PROGRESS). -.TP -.BI \-G\0 gamma-file.ps -Prepend \fIgamma-file.ps\fP to the Postscript input to perform -color correction using the \fBsetcolortransfer\fP Postscript operator. -For example, the file might contain: -.br -{0.333 exp} {0.333 exp} {0.333 exp} {0.333 exp} setcolortransfer -.TP -.BI \-I\0 intent -Select profile intent from the ICM file. -0=Perceptual, 1=Colorimetric, 2=Saturation, 3=Absolute. -Default is 0 (perceptual). -.SS Debugging Options -These options are used for debugging \fBfoo2hbpl1\fP and its wrapper. -.TP -.BI \-S\0 plane -Output just a single color plane from a color print and print it -on the black plane. The default is to output all color planes. -.TS -l l. -1 Cyan -2 Magenta -3 Yellow -4 Black -.TE -.TP -.BI \-D\0 level -Set Debug level [0]. - -.SH EXAMPLES -Create a monochrome ZjStream from a Postscript document, -examine it, and then print it using a RAW print queue: - -.RS -.nf -foo2hbpl1-wrapper testpage.ps > testpage.prn -hbpl1decode < testpage.prn -lpr -P raw testpage.prn -.fi -.RE -.P -Create a color ZjStream stream from a Postscript document: - -.RS -.nf -foo2hbpl1-wrapper -c testpage.ps > testpage.prn -.fi -.RE - -.SH FILES -.BR /usr/bin/foo2hbpl1-wrapper -.SH SEE ALSO -.BR foo2hbpl1 (1), -.BR hbpldecode (1) -.SH "AUTHOR" -Rick Richardson -.br -http://foo2hbpl.rkkda.com/ -'\" -'\" -'\" -.em pdf_outline diff --git a/foo2hbpl1.1 b/foo2hbpl1.1 deleted file mode 100644 index e78e309..0000000 --- a/foo2hbpl1.1 +++ /dev/null @@ -1,244 +0,0 @@ -'\" t -'\" -'\" DO NOT EDIT! This file is generated from foo2hbpl1.1in -'\" -'\" t -.TH foo2hbpl1 1 "Sun May 26 18:25:20 2024" "foo2hbpl1 0.0" -'\" -'\" -'\"========================================================================== -'\" STRINGS and MACROS -'\"========================================================================== -'\" -'\" Define strings for special characters that nroff doesn't have -'\" -'\" N.B. using .if cua to test for special characters did not work. -'\" -.if !'\*[.T]'ps' .ds ua up -.if '\*[.T]'ps' .ds ua \(ua -.if !'\*[.T]'ps' .ds da down -.if '\*[.T]'ps' .ds da \(da -.if !'\*[.T]'ps' .ds <- left -.if '\*[.T]'ps' .ds <- \(<- -.if !'\*[.T]'ps' .ds -> right -.if '\*[.T]'ps' .ds -> \(-> -'\" -'\" bx - box a Courier string for making keycaps -'\" -'\" N.B. this mess is to make the line drawing come out only -'\" if we are really generating postscript -'\" -.de bx -.ie !'\*[.T]'ps' \{\ -. RB [ \\$1 ]\\$2 -.\} -.el \{\ -. ie !r ps4html \{\ -'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul' -. ft CW -. nr par*bxw \w'\\$1'+.4m -\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\ -\Z'\h'.2m'\s-1\\$1\s+1'\ -\h'\\n[par*bxw]u'\\$2 -. ft P -. \} -. el \{\ -. RB [ \\$1 ]\\$2 -. \} -.\} -.. -'\" -'\" strings to set current color (null with old groff) -'\" -.if mred .ds red \m[red] -.if mgreen .ds green \m[green] -.if mblue .ds blue \m[blue] -.if mblack .ds black \m[black] -.if mblack .ds mP \mP -'\" -'\" fix for grotty + xterm. We call for orange, grotty outputs yellow, -'\" but xterm displays yellow as orange. The cycle is complete. -'\" -.if n .defcolor orange rgb #ffff00 -'\" -'\" color - set the current color (ignores request with old groff) -'\" -.de color -.if mred \m[\\$1]\c -.. -'\" -'\" colorword - colorize a word (ignored by old groff) -'\" -.de colorword -.ie m\\$1 \m[\\$1]\\$2\mP\c -.el \\$2\c -.. -'\" -'\" colbox - colorize a word in a filled box -'\" -.de colbox -.ie mred \M[\\$2]\ -\v'+.167v'\ -\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\ -\v'-.167v'\ -\m[\\$1]\\$3\mP\MP -.el \\$3\c -.. -'\" -'\" Macros for doing pdfmarks -'\" -.de specialps -.if '\*[.T]'ps' \\k_\X'ps: \\$*'\h'|\\n_u'\c -.. -'\" -'\" pdfmark PDFMARKCODE -'\" -.ds pdfmarks -.if d pdfmarks \{\ -.de pdfmark -. specialps exec [\\$1 pdfmark -.. -'\" -'\" pdfdest LINKNAME -'\" -.de pdfdest -.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST" -.. -'\" -'\" pdfbookmark COUNT LINKNAME STRING -'\" -.de pdfbookmark -. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT" -.. -'\" -'\" Define the SH and SS macros to save pdfmark information -'\" in "arrays" of numbers and strings. -'\" -.if !r rr_n \{\ -.nr rr_n 0 1 -.am SH -. nr rr_levels!\\n+[rr_n] 2 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.am SS -. nr rr_levels!\\n+[rr_n] 3 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.\} -'\" -'\" Called at the end of the document to generate the pdfmark outline -'\" -.de pdf_outline -.nr rr_levels!\\n+[rr_n] 1 -.nr rr_i 0 1 -.while \\n+[rr_i]<\\n[rr_n] \{\ -. nr rr_ip1 \\n[rr_i]+1 -. nr rr_count 0 -. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\ -. nr rr_j \\n[rr_i] 1 -. while \\n+[rr_j]<\\n[rr_n] \{\ -. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\ -. break -. \} -. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\ -. nr rr_count \\n[rr_count]+1 -. \} -. \} -. \} -. ds hhh \\*[rr_labels!\\n[rr_i]] -. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]" -.\} -.. -'\" -'\" Some postscript to make pdfmarks harmless on old interpreters... -'\" -.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse" -'\" -'\" Force display of Bookmarks in Acrobat when document is viewed. -'\" -.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW" -'\" -'\" Output the document info in pdfmarks -'\" -.pdfmark "\ - /Title (\*[an-title](\*[an-section])) \ - /Subject (\*[an-title] Manual Page) \ - /Author (Rick Richardson) \ - /Keywords (printing) \ - /Creator (groff \n(.x.\n(.y.\n(.Y -man) \ - /CreationDate (\*[an-extra1]) \ - /ModDate (\*[an-extra1]) \ - /DOCINFO" -\} -'\" -'\" The manual page name is only 1st level mark -'\" -.nr rr_levels!\n+[rr_n] 1 -.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section]) -.pdfdest Link\n[rr_n] -'\" -'\"========================================================================== -'\" MANUAL PAGE SOURCE -'\"========================================================================== -.SH NAME -foo2hbpl1 \- Convert Ghostscript output to an HBPLv1 printer stream -.SH SYNOPSIS -.B foo2hbpl1 -.RI [ options "] <" pnm-or-pam-file " >" hbpl1-file -.SH DESCRIPTION -.B foo2hbpl1 -converts Ghostscript pbmraw, pgmraw, ppmraw, or pamcmyk32 output -formats to monochrome or color HBPL version 1 streams, to drive the -Dell 1250c, Dell C1660w, Dell C1760w, -Epson AcuLaser C1700, -and Fuji-Xerox CP105b printers. - -.SH COMMAND LINE OPTIONS -.TP -.BI \-J\0 filename -Filename string to send to printer. -.TP -.BI \-U\0 username -Username string to send to printer. -.SH EXAMPLES -Create a black and white ZJS stream: - -.RS -.nf -gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE \ - -sPAPERSIZE=letter -r600x600 -sDEVICE=pgmraw \ - -sOutputFile=- - < testpage.ps \ -| foo2hbpl1 >testpage.zm -.fi -.RE -.P -Create a color ZJS stream: - -.RS -.nf -gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE \ - -sPAPERSIZE=letter -g5100x6600 -r600x600 -sDEVICE=pamcmyk32 \ - -sOutputFile=- - < testpage.ps \ -| foo2hbpl1 >testpage.zc -.fi -.RE - -.SH FILES -.BR /usr/bin/foo2hbpl1 -.SH SEE ALSO -.BR foo2hbpl1-wrapper (1), -.BR hbpldecode (1) -.SH "AUTHOR" -Rick Richardson -.br -Peter Korf -.br -Dave Coffin -.br -http://foo2hbpl.rkkda.com/ -'\" -'\" -'\" -.em pdf_outline diff --git a/foo2hbpl2 b/foo2hbpl2 deleted file mode 100755 index 38d9346..0000000 Binary files a/foo2hbpl2 and /dev/null differ diff --git a/foo2hbpl2-wrapper b/foo2hbpl2-wrapper deleted file mode 100755 index 7b597c2..0000000 --- a/foo2hbpl2-wrapper +++ /dev/null @@ -1,729 +0,0 @@ -#!/bin/sh - -#* Copyright (C) 2013 Rick Richardson -#* -#* This program is free software; you can redistribute it and/or modify -#* it under the terms of the GNU General Public License as published by -#* the Free Software Foundation; either version 2 of the License, or -#* (at your option) any later version. -#* -#* This program is distributed in the hope that it will be useful, -#* but WITHOUT ANY WARRANTY; without even the implied warranty of -#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -#* GNU General Public License for more details. -#* -#* You should have received a copy of the GNU General Public License -#* along with this program; if not, write to the Free Software -#* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#* -#* Authors: Rick Richardson - -VERSION='$Id: foo2hbpl2-wrapper.in,v 1.7 2014/03/01 21:04:47 rick Exp $' - -# -# Printer Notes: -# -# Dell 1355 Multifunction Color Printer -# Dell C1765 Multifunction Color Printer -# Epson AcuLaser M1400 -# Fuji Xerox DocuPrint CM205 Multifunction Color Printer -# Fuji Xerox DocuPrint M215 -# Fuji Xerox DocuPrint P205 -# Xerox WorkCentre 3045 Multifunction Monochrome Printer -# Xerox WorkCentre 6015 Multifunction Color Printer -# - -PROGNAME="$0" -BASENAME=`basename $PROGNAME` -PREFIX=/usr -SHARE=$PREFIX/share/foo2hbpl -PATH=$PATH:/sw/bin:/opt/local/bin - -# -# Log the command line, for debugging and problem reports -# -if [ -x /usr/bin/logger -o -x /bin/logger ]; then - logger -t "$BASENAME" -p lpr.info -- "$BASENAME $@" x Set device resolution in pixels/inch [$RES] --s source Source code to send to printer [$SOURCE] - 1=upper, 2=lower, 4=manual, 7=auto - Code numbers may vary with printer model. --t Draft mode. Every other pixel is white. --2/-3/-4/-6/-8/-10/-12/-14/-15/-16/-18 - Print with N-up (requires psutils) --o orient For N-up: -op is portrait, -ol is landscape, -os is seascape. - -Printer Tweaking Options: --u x Set offset of upper left printable in pixels [varies] --l x Set offset of lower right printable in pixels [varies] --L mask Send logical clipping values from -u/-l in ZjStream [3] - 0=no, 1=Y, 2=X, 3=XY --P Do not output START_PLANE codes. May be needed by some - monochrome-only printers. --X padlen Add extra zero padding to the end of BID segments [16] - -Color Tweaking Options: --g gsopts Additional options to pass to Ghostscript, such as - -dDITHERPPI=nnn, etc. May appear more than once. [] --G profile.icm Convert profile.icm to a Postscript CRD using icc2ps and - adjust colors using the setcolorrendering PS operator. - $SHARE/icm/ will be searched for profile.icm. --I intent Select profile intent from ICM file [$INTENT] - 0=Perceptual, 1=Colorimetric, 2=Saturation, 3=Absolute --G gamma-file.ps Prepend gamma-file to the Postscript input to perform - color correction using the setcolortransfer PS operator. - -Debugging Options: --S plane Output just a single color plane from a color print [all] - 1=Cyan, 2=Magenta, 3=Yellow, 4=Black --D lvl Set Debug level [$DEBUG] --V $VERSION -EOF - - exit 1 -} - -# -# Report an error and exit -# -error() { - echo "$BASENAME: $1" >&2 - exit 1 -} - -dbgcmd() { - if [ $DEBUG -ge 1 ]; then - echo "$@" >&2 - fi - "$@" -} - -# -# N-up-ify the job. Requires psnup from psutils package -# -nup() { - case "$NUP" in - [2368]|1[0458]) - tr '\r' '\n' | psnup $NUP_ORIENT -d2 -$NUP -m.3in -p$paper -q - ;; - [49]|1[26]) - tr '\r' '\n' | psnup $NUP_ORIENT -d2 -$NUP -m.5in -p$paper -q - ;; - *) - error "Illegal call to nup()." - ;; - esac -} - -# -# Process the options -# - -# Try to use a local copy of GhostScript 8.54, if available. Otherwise, -# fallback to whatever the Linux distro has installed (usually 7.07) -# -# N.B. := operator used here, when :- would be better, because "ash" -# doesn't have :- -if eval gs.foo -v >/dev/null 2>&1; then - GSBIN=${GSBIN:-gs.foo} -else - GSBIN=${GSBIN:-gs} -fi - -CMDLINE="$*" -DEBUG=0 -DUPLEX=1 -COLOR= -COLORMODE=default -MODEL=0 -QUALITY=1 -QUALITY=wts -MEDIA=1 # plain -COPIES=1 -PAPER=4 # letter -RES=1200x600 -SOURCE=1 -NUP= -CLIP_UL= -CLIP_LR= -CLIP_LOG= -BC= -AIB= -NOPLANES= -COLOR2MONO= -GAMMAFILE=default -INTENT=0 -GSOPTS= -EXTRAPAD= -SAVETONER= -NUP_ORIENT= -GSDEV=-sDEVICE=pbmraw -# What mode to use if the user wants us to pick the "best" mode -case `$GSBIN --version` in -7*) DEFAULTCOLORMODE=10 - DEFAULTCOLORMODE=1 - ;; -8.1*) - DEFAULTCOLORMODE=1 - QUALITY=1 - ;; -*) DEFAULTCOLORMODE=1 - ;; -esac -while getopts "1:23456789o:b:cC:d:g:l:u:L:m:n:p:q:r:s:tz:ABS:D:G:I:PX:Vh?" opt -do - case $opt in - b) GSBIN="$OPTARG";; - c) COLOR=-c;; - d) DUPLEX="$OPTARG";; - g) GSOPTS="$GSOPTS $OPTARG";; - m) MEDIA="$OPTARG";; - n) COPIES="$OPTARG";; - p) PAPER="$OPTARG";; - q) QUALITY="$OPTARG";; - r) RES="$OPTARG";; - s) SOURCE="$OPTARG";; - t) SAVETONER="-t";; - z) MODEL="$OPTARG";; - l) CLIP_LR="-l $OPTARG";; - u) CLIP_UL="-u $OPTARG";; - L) CLIP_LOG="-L $OPTARG";; - A) AIB=-A;; - B) BC=-B;; - C) COLORMODE="$OPTARG";; - S) COLOR2MONO="-S$OPTARG";; - D) DEBUG="$OPTARG";; - G) GAMMAFILE="$OPTARG";; - I) INTENT="$OPTARG";; - P) NOPLANES=-P;; - X) EXTRAPAD="-X $OPTARG";; - [234689]) NUP="$opt";; - [57]) error "Can't find acceptable layout for $opt-up";; - 1) case "$OPTARG" in - [024568]) NUP="1$OPTARG";; - *) error "Can't find acceptable layout for 1$OPTARG-up";; - esac - ;; - o) case "$OPTARG" in - l*) NUP_ORIENT=-l;; - s*) NUP_ORIENT=-r;; - p*|*) NUP_ORIENT=;; - esac;; - V) echo "$VERSION"; foo2hbpl -V; foo2zjs-pstops -V; exit 0;; - h|\?) - if [ "$CMDLINE" != "-?" -a "$CMDLINE" != -h ]; then - echo "Illegal command:" - echo " $0 $CMDLINE" - echo - fi - usage;; - esac -done -shift `expr $OPTIND - 1` - -# -# If there is an argument left, take it as the file to print. -# Else, the input comes from stdin. -# -if [ $# -ge 1 ]; then - if [ "$LPJOB" = "" ]; then - : # LPJOB="$1" - fi - exec < $1 -fi - -# -case "$QUALITY" in -0) - GSOPTS="-dCOLORSCREEN $GSOPTS" - ;; -1) - GSOPTS="-dCOLORSCREEN $GSOPTS" - ;; -2) - GSOPTS="-dMaxBitmap=500000000 $GSOPTS" - ;; -as) - GSOPTS="-dCOLORSCREEN -dMaxBitmap=500000000 $GSOPTS" - ;; -wts) - GSOPTS="-dCOLORSCREEN -dMaxBitmap=500000000 $GSOPTS" - ;; -esac - -# -# Validate model code -# -case "$MODEL" in -0|1|2|3) ;; -*) error "Unknown model code $MODEL";; -esac - -# -# Validate media code -# -case "$MEDIA" in -1|plain) MEDIA=1;; -2|bond) MEDIA=2;; -3|lwcard) MEDIA=3;; -4|lwgcard) MEDIA=4;; -5|labels) MEDIA=5;; -6|envelope) MEDIA=6;; -7|recycled) MEDIA=7;; -8|plain2) MEDIA=1;; -9|bond2) MEDIA=2;; -10|lwcard2) MEDIA=3;; -11|lwgcard2) MEDIA=4;; -12|recycled2) MEDIA=7;; -[0-9]*) ;; -*) error "Unknown media code $MEDIA";; -esac - -# -# Validate source (InputSlot) code -# -case "$SOURCE" in -1|auto) SOURCE=1;; -2|manual) SOURCE=2;; -3|multi) SOURCE=3;; -4|tray1) SOURCE=4;; -[0-9]*) ;; -*) error "Unknown source code $SOURCE";; -esac - -# -# Validate Duplex code -# -case "$DUPLEX" in -1|off|none) DUPLEX=1;; -2|long*) DUPLEX=2;; -3|short*) DUPLEX=3;; -[0-9]*) ;; -*) error "Unknown duplex code $DUPLEX";; -esac - -# -# Validate Resolution -# -case "$RES" in -600x600) ;; -1200x600) ;; -1200x1200) ;; -#2400x600) ;; -*) error "Illegal resolution $RES";; -esac - -# -# 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" in -Custom*x*) - # Command line only - XDIM=`echo "$PAPER" | sed -e "s/Custom.//" -e "s/x.*//" ` - YDIM=`echo "$PAPER" | sed -e "s/.*x//" ` - if [ "$XDIM" = "" -o "$YDIM" = "" ]; then - error "Custom page size '$PAPER' != 1-99999" - fi - if [ "$XDIM" -eq 0 -o "$YDIM" -eq 0 ]; then - error "Custom page size '$PAPER' != 1-99999" - fi - XDIM=`dc -e "$XDIM 1200* 72/p"` - YDIM=`dc -e "$YDIM 600* 72/p"` - PAPER=21; paper=letter; - # Doesn't work on a real printer - smudges. - # set_clipping 2 100 2 100 - set_clipping 150 100 150 100 - ;; -Custom*) - #%%BeginFeature: *CustomPageSize True - #216 - #360 - #0 - #0 - #0 - #pop pop pop pop pop - - #%%BeginFeature: *CustomPageSize True - #792.000000 612.000000 1 0.000000 0.000000 - #pop pop pop pop pop - - if [ $DEBUG = 0 ]; then - TMPFILE=/tmp/cus$$ - else - TMPFILE=/tmp/custom.ps - fi - cat >$TMPFILE - exec <$TMPFILE - - tmp=`head -n 10000 $TMPFILE \ - | sed -n '/CustomPageSize/{n;p;n;p;}' \ - | tr '\n' ' '` - case "$tmp" in - [0-9]*\ [0-9]*) - XDIM=`echo "$tmp" | sed 's/ .*//'` - YDIM=`echo "$tmp" | sed -e 's/^[^ ]* //' -e 's/ .*//'` - ;; - *) - if [ $DEBUG = 0 ]; then rm -f $TMPFILE; fi - error "Custom page size [XY]DIM != 1-99999" - ;; - esac - XDIM=`dc -e "$XDIM 1200* 72/p"` - YDIM=`dc -e "$YDIM 600* 72/p"` - PAPER=21; paper=letter; - # Doesn't work on a real printer - smudges. - # set_clipping 2 100 2 100 - set_clipping 150 100 150 100 - ;; -1|a4|A4) PAPER=1; paper=a4; XDIM="9920"; YDIM="7016" - set_clipping 150 100 150 100 - ;; -2|b5jis|B5jis) PAPER=2; paper=b5; XDIM="8598"; YDIM="6070" - set_clipping 138 100 138 100 # modulo 256 - ;; -4|letter) PAPER=4; paper=letter; XDIM="10200"; YDIM="6600" - set_clipping 150 100 150 100 - ;; -5|executive) PAPER=5; paper=executive; XDIM="8700"; YDIM="6300" - set_clipping 150 100 150 100 - ;; -6|fanfoldgermanlegal|folio) - PAPER=6; paper=legal; XDIM="10200"; YDIM="7800" - set_clipping 150 100 150 100 - ;; -7|legal) PAPER=7; paper=legal; XDIM="10200"; YDIM="8400" - set_clipping 150 100 150 100 - ;; -9|"env#10") PAPER=9; paper=env10; XDIM="4950"; YDIM="5700" - set_clipping 171 100 171 100 # modulo 256 - ;; -10|envMonarch) PAPER=10; paper=envMonarch;XDIM="4650"; YDIM="4500" - set_clipping 150 100 150 100 - ;; -11|envC5) PAPER=11; paper=envC5; XDIM="7650"; YDIM="5408" - set_clipping 150 100 150 100 - ;; -12|envDL) PAPER=12; paper=envDL; XDIM="5200"; YDIM="5200" - set_clipping 168 100 168 100 # modulo 256 - ;; -#16|a5|A5) PAPER=16; paper=a5; XDIM="6992"; YDIM="4960" -# set_clipping 168 100 168 100 # modulo 256 -# ;; -#24|folio) PAPER=24; paper=folio; XDIM="9922"; YDIM="7796" -# set_clipping 150 100 150 100 -# ;; -#26|"env#9") PAPER=26; paper=env9; XDIM="4496"; YDIM="5324" -# set_clipping 200 100 200 100 # modulo 256 -# ;; -#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 189 100 189 100 # modulo 256 -# ;; -#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 176 100 176 100 # modulo 256 -# ;; -#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.ps -PAPERSIZE="-sPAPERSIZE=$paper"; - -case "$RES" in -600x600) XDIM=`expr $XDIM / 2`;; -1200x600) ;; -1200x1200) YDIM=`expr $YDIM \* 2`;; -2400x600) XDIM=`expr $XDIM \* 2`;; -esac -DIM="${XDIM}x${YDIM}" - -# -# Filter thru psnup if N-up printing has been requested -# -case $NUP in -[234689]|1[024568]) PREFILTER="nup";; -*) PREFILTER=cat;; -esac -if [ "$DEBUG" -ge 9 ]; then - PREFILTER="tee /tmp/$BASENAME.ps" -fi - -# -# 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) - ;; - *) - if [ -x /usr/bin/logger ]; then - logger -t "$BASENAME" -p lpr.info -- \ - "`basename $ICC2PS` -o $GAMMAFILE -t$INTENT > $ICCTMP.crd.ps" - fi - $ICC2PS -o $GAMMAFILE -t$INTENT > $ICCTMP.crd.ps 2>$ICCTMP.log \ - || error "Problem converting .ICM file to Postscript" - ;; - esac - - PSTOPS_OPTS="$PSTOPS_OPTS -c" - cat > $ICCTMP.usecie.ps <<-EOF - %!PS-Adobe-3.0 - <>setpagedevice - EOF - if [ "$QUALITY" = wts -o "$QUALITY" = as ]; then - if [ "$QUALITY" = wts ]; then - cat >> $ICCTMP.usecie.ps <<-EOF - << /UseWTS true >> setuserparams - EOF - else - cat >> $ICCTMP.usecie.ps <<-EOF - << /UseWTS false >> setuserparams - EOF - fi - cat >> $ICCTMP.usecie.ps <<-EOF - << - /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 - GAMMAFILE= - fi -} - -if [ $DEBUG -gt 0 ]; then - ICCTMP=/tmp/icc -else - ICCTMP=/tmp/icc$$ -fi - -if [ "" = "$COLOR" ]; then - COLORMODE= - GAMMAFILE= -else - case "$COLORMODE" in - default) COLORMODE=$DEFAULTCOLORMODE;; - esac - case "$GAMMAFILE" in - default) GAMMAFILE=samclp300-0.icm;; - esac -fi - -CRDBASE="$PREFIX/share/foo2hbpl/crd" -case "$MODEL" in - 0) model=CLP-300;; - 1) model=CLP-600;; - 2) model=CLP-600;; - 3) model=CLP-600;; -esac -case "$RES" in - 600x600) SCREEN=$model-600x600cms2;; - 1200x600) SCREEN=$model-1200x600cms2;; - 1200x1200) SCREEN=$model-1200x1200cms2;; -esac - -PSTOPS_OPTS="-n" - -case "$COLORMODE" in -0|"") - # 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'" - ;; -esac - -if [ "$COLOR" != "" -a "$QUALITY" = wts ]; then - PSTOPS_OPTS="$PSTOPS_OPTS -w" -elif [ "$COLOR" != "" -a "$QUALITY" = as ]; then - PSTOPS_OPTS="$PSTOPS_OPTS -a" -fi - -if [ "" != "$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 - fi -fi - -# -# 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" - -foo2zjs-pstops $PSTOPS_OPTS | \ -$PREFILTER \ -| ($GS $PAPERSIZE -g$DIM -r$RES $GSDEV $GSOPTS \ - -sOutputFile="|cat 1>&3" $GAMMAFILE -_ >/dev/null) 3>&1 \ -| foo2hbpl2 -r$RES -g$DIM -p$PAPER -m$MEDIA -n$COPIES -d$DUPLEX -s$SOURCE \ - -z$MODEL $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 -- \ - "foo2hbpl2 -r$RES -g$DIM -p$PAPER -m$MEDIA \ --n$COPIES -d$DUPLEX -s$SOURCE -z$MODEL $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 $TMPFILE2 -fi - -exit 0 diff --git a/foo2hbpl2-wrapper.1 b/foo2hbpl2-wrapper.1 deleted file mode 100644 index 8a2a0a3..0000000 --- a/foo2hbpl2-wrapper.1 +++ /dev/null @@ -1,419 +0,0 @@ -'\" t -'\" -'\" DO NOT EDIT! This file is generated from foo2hbpl2-wrapper.1in -'\" -'\" t -.TH foo2hbpl2-wrapper 1 "Sun May 26 18:25:20 2024" "foo2hbpl2-wrapper 0.0" -'\" -'\" -'\"========================================================================== -'\" STRINGS and MACROS -'\"========================================================================== -'\" -'\" Define strings for special characters that nroff doesn't have -'\" -'\" N.B. using .if cua to test for special characters did not work. -'\" -.if !'\*[.T]'ps' .ds ua up -.if '\*[.T]'ps' .ds ua \(ua -.if !'\*[.T]'ps' .ds da down -.if '\*[.T]'ps' .ds da \(da -.if !'\*[.T]'ps' .ds <- left -.if '\*[.T]'ps' .ds <- \(<- -.if !'\*[.T]'ps' .ds -> right -.if '\*[.T]'ps' .ds -> \(-> -'\" -'\" bx - box a Courier string for making keycaps -'\" -'\" N.B. this mess is to make the line drawing come out only -'\" if we are really generating postscript -'\" -.de bx -.ie !'\*[.T]'ps' \{\ -. RB [ \\$1 ]\\$2 -.\} -.el \{\ -. ie !r ps4html \{\ -'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul' -. ft CW -. nr par*bxw \w'\\$1'+.4m -\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\ -\Z'\h'.2m'\s-1\\$1\s+1'\ -\h'\\n[par*bxw]u'\\$2 -. ft P -. \} -. el \{\ -. RB [ \\$1 ]\\$2 -. \} -.\} -.. -'\" -'\" strings to set current color (null with old groff) -'\" -.if mred .ds red \m[red] -.if mgreen .ds green \m[green] -.if mblue .ds blue \m[blue] -.if mblack .ds black \m[black] -.if mblack .ds mP \mP -'\" -'\" fix for grotty + xterm. We call for orange, grotty outputs yellow, -'\" but xterm displays yellow as orange. The cycle is complete. -'\" -.if n .defcolor orange rgb #ffff00 -'\" -'\" color - set the current color (ignores request with old groff) -'\" -.de color -.if mred \m[\\$1]\c -.. -'\" -'\" colorword - colorize a word (ignored by old groff) -'\" -.de colorword -.ie m\\$1 \m[\\$1]\\$2\mP\c -.el \\$2\c -.. -'\" -'\" colbox - colorize a word in a filled box -'\" -.de colbox -.ie mred \M[\\$2]\ -\v'+.167v'\ -\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\ -\v'-.167v'\ -\m[\\$1]\\$3\mP\MP -.el \\$3\c -.. -'\" -'\" Macros for doing pdfmarks -'\" -.de specialps -.if '\*[.T]'ps' \\k_\X'ps: \\$*'\h'|\\n_u'\c -.. -'\" -'\" pdfmark PDFMARKCODE -'\" -.ds pdfmarks -.if d pdfmarks \{\ -.de pdfmark -. specialps exec [\\$1 pdfmark -.. -'\" -'\" pdfdest LINKNAME -'\" -.de pdfdest -.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST" -.. -'\" -'\" pdfbookmark COUNT LINKNAME STRING -'\" -.de pdfbookmark -. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT" -.. -'\" -'\" Define the SH and SS macros to save pdfmark information -'\" in "arrays" of numbers and strings. -'\" -.if !r rr_n \{\ -.nr rr_n 0 1 -.am SH -. nr rr_levels!\\n+[rr_n] 2 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.am SS -. nr rr_levels!\\n+[rr_n] 3 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.\} -'\" -'\" Called at the end of the document to generate the pdfmark outline -'\" -.de pdf_outline -.nr rr_levels!\\n+[rr_n] 1 -.nr rr_i 0 1 -.while \\n+[rr_i]<\\n[rr_n] \{\ -. nr rr_ip1 \\n[rr_i]+1 -. nr rr_count 0 -. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\ -. nr rr_j \\n[rr_i] 1 -. while \\n+[rr_j]<\\n[rr_n] \{\ -. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\ -. break -. \} -. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\ -. nr rr_count \\n[rr_count]+1 -. \} -. \} -. \} -. ds hhh \\*[rr_labels!\\n[rr_i]] -. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]" -.\} -.. -'\" -'\" Some postscript to make pdfmarks harmless on old interpreters... -'\" -.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse" -'\" -'\" Force display of Bookmarks in Acrobat when document is viewed. -'\" -.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW" -'\" -'\" Output the document info in pdfmarks -'\" -.pdfmark "\ - /Title (\*[an-title](\*[an-section])) \ - /Subject (\*[an-title] Manual Page) \ - /Author (Rick Richardson) \ - /Keywords (printing) \ - /Creator (groff \n(.x.\n(.y.\n(.Y -man) \ - /CreationDate (\*[an-extra1]) \ - /ModDate (\*[an-extra1]) \ - /DOCINFO" -\} -'\" -'\" The manual page name is only 1st level mark -'\" -.nr rr_levels!\n+[rr_n] 1 -.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section]) -.pdfdest Link\n[rr_n] -'\" -'\"========================================================================== -'\" MANUAL PAGE SOURCE -'\"========================================================================== -.SH NAME -foo2hbpl2-wrapper \- Convert Postscript into a ZJS printer stream -.SH SYNOPSIS -.B foo2hbpl2-wrapper -.RI [ options "] [" ps-file ] -.SH DESCRIPTION -.B foo2hbpl2-wrapper -is a Foomatic compatible printer wrapper for the \fBfoo2hbpl2\fP printer driver. -This script reads a Postscript \fIps-file\fP or standard input -and converts it to Zenographics ZjStream printer format -for driving the -Dell 1355, Dell C1765, -Epson AcuLaser M1400, -Fuji Xerox DocuPrint CM205, -Fuji Xerox DocuPrint P205, -Xerox WorkCentre 3045 MFP, -and Xerox WorkCentre 6015 MFP printers. -.P -This script can be used in a standalone fashion, but is intended to -be called from a printer spooler system which uses the Foomatic -printer database. - -.SH COMMAND LINE OPTIONS -.SS Normal Options -These are the options used to select the parameters of a -print job that are usually controlled on a per job basis. -.TP -.BI \-c -Print in color (else monochrome). -.TP -.BI \-C\0 colormode -Color correction mode [0]. -.TS -n l . -10 ICM color profile (using -G *.icm file) -.TE -.TP -.BI \-d\0 duplex -Duplex code to send to printer [1]. -.TS -| n l | n l | n l . -1 off 2 long edge 3 short edge -.TE -.TP -.BI \-m\0 media -Media code to send to printer [1]. -.TS -l r. -_ -Media HBPL -_ -plain 1 -bond 2 -lwcard 3 -lwgcard 4 -labels 5 -envelope 6 -recycled 7 -plain2 8 -bond2 9 -lwcard2 10 -lwgcard2 11 -recycled2 12 -.TE -.TP -.BI \-p\0 paper -Paper size code to send to printer [1]. -.TS -l r. -_ -Paper HBPL -_ -A4 1 -B5jis 2 -letter 4 -executive 5 -fanfold german legal 6 -folio 6 -legal 7 -env#10 9 -envMonarch 10 -envC5 11 -envDL 12 -.TE -.TP -.BI \-n\0 copies -Number of copies [1]. -.TP -.BI \-r\0 xres x yres -Set device resolution in pixels/inch [1200x600]. -.TP -.BI \-s\0 source -Source (Input Slot) code to send to printer [7]. -.TS -| n l | n l. -1 upper 4 manual -2 lower 7 auto -.TE -.TP -.BI \-t -Draft mode. Every other pixel is white. -.TP -.BI \-T\0 density -Print density (1-5). The default is 3 (medium). -.TP -.BI "\-2 \-3 \-4 \-5 \-6 \-8 \-9 \-10 \-12 \-14 \-15 \-16 \-18" -Print in N-up. Requires the \fBpsutils\fP package. -.TP -.BI \-o\0 orient -Orientation used for N-up. -.TS -l l l. -Portrait -op (normal) -Landscape -ol (rotated 90 degrees anticlockwise) -Seascape -os (rotated 90 degrees clockwise) -.TE -.SS Printer Tweaking Options -These are the options used to customize the operation of \fBfoo2hbpl2\fP -for a particular printer. -.TP -.BI \-u\0 xoff x yoff -Set the offset of the start of the printable region from the -upper left corner, in pixels [varies with paper size]. -The defaults should work on the 2200DL and 2300DL, and have not -been tested on any other printers. -.TP -.BI \-l\0 xoff x yoff -Set the offset of the end of the printable region from the -lower right corner, in pixels [varies with paper size]. -The defaults should work on the 2200DL and 2300DL, and have not -been tested on any other printers. -.TP -.BI \-L\0 mask -Send the logical clipping values from -u/-l in the ZjStream. -\fBfoo2hbpl2-wrapper\fP always runs Ghostscript with the ideal page dimensions, -so that the scale of the image is correct, -regardless whether or not the printer has unprintable regions. -This option is used to move the position of the clipped image -back to where it belongs on the page. The default is to send -the amount which was clipped by -u and -l, and should be -good in most cases. -.TS -l l. -0 don't send any logical clipping amounts -1 only send Y clipping amount -2 only send X clipping amount -3 send both X and Y clipping amounts -.TE -.TP -.BI \-P -Do not send START_PLANE codes on monochrome output. May be -needed by some monochrome-only printers, such as the -HP LaserJet 1000. -.TP -.BI \-X\0 padlen -Add extra zero padding to the end of BID segments. The default is -16 bytes. Padding 16 bytes of zeroes -is needed for older ZjStream printers, such as the Minolta 2200DL -and HP LaserJet 1000, and seems harmless to newer ones, such as -the Minolta 2300DL. So the default should be good for all cases. -.SS Color Tweaking Options -These are the options used to control the quality of color output. -Color correction is currently a WORK IN PROGRESS. -.TP -.BI \-g\0 gsopts -Additional options to pass to Ghostscript, such as -g\(lq-dDITHERPPI=nnn\(rq, -etc. This option may appear more than once. -.TP -.BI \-G\0 profile.icm -Convert \fIprofile.icm\fP to a Postscript color rendering -dictionary (CRD) using \fBfoo2zjs-icc2ps\fP and -adjust the printer colors by using the Postscript \fBsetcolorrendering\fP -operator. (WORK IN PROGRESS). -.TP -.BI \-G\0 gamma-file.ps -Prepend \fIgamma-file.ps\fP to the Postscript input to perform -color correction using the \fBsetcolortransfer\fP Postscript operator. -For example, the file might contain: -.br -{0.333 exp} {0.333 exp} {0.333 exp} {0.333 exp} setcolortransfer -.TP -.BI \-I\0 intent -Select profile intent from the ICM file. -0=Perceptual, 1=Colorimetric, 2=Saturation, 3=Absolute. -Default is 0 (perceptual). -.SS Debugging Options -These options are used for debugging \fBfoo2hbpl2\fP and its wrapper. -.TP -.BI \-S\0 plane -Output just a single color plane from a color print and print it -on the black plane. The default is to output all color planes. -.TS -l l. -1 Cyan -2 Magenta -3 Yellow -4 Black -.TE -.TP -.BI \-D\0 level -Set Debug level [0]. - -.SH EXAMPLES -Create a monochrome ZjStream from a Postscript document, -examine it, and then print it using a RAW print queue: - -.RS -.nf -foo2hbpl2-wrapper testpage.ps > testpage.prn -hbpl2decode < testpage.prn -lpr -P raw testpage.prn -.fi -.RE -.P -Create a color ZjStream stream from a Postscript document: - -.RS -.nf -foo2hbpl2-wrapper -c testpage.ps > testpage.prn -.fi -.RE - -.SH FILES -.BR /usr/bin/foo2hbpl2-wrapper -.SH SEE ALSO -.BR foo2hbpl2 (1), -.BR hbpldecode (1) -.SH "AUTHOR" -Rick Richardson -.br -http://foo2hbpl.rkkda.com/ -'\" -'\" -'\" -.em pdf_outline diff --git a/foo2hbpl2.1 b/foo2hbpl2.1 deleted file mode 100644 index fe7921b..0000000 --- a/foo2hbpl2.1 +++ /dev/null @@ -1,384 +0,0 @@ -'\" t -'\" -'\" DO NOT EDIT! This file is generated from foo2hbpl2.1in -'\" -'\" t -.TH foo2hbpl2 1 "Sun May 26 18:25:20 2024" "foo2hbpl2 0.0" -'\" -'\" -'\"========================================================================== -'\" STRINGS and MACROS -'\"========================================================================== -'\" -'\" Define strings for special characters that nroff doesn't have -'\" -'\" N.B. using .if cua to test for special characters did not work. -'\" -.if !'\*[.T]'ps' .ds ua up -.if '\*[.T]'ps' .ds ua \(ua -.if !'\*[.T]'ps' .ds da down -.if '\*[.T]'ps' .ds da \(da -.if !'\*[.T]'ps' .ds <- left -.if '\*[.T]'ps' .ds <- \(<- -.if !'\*[.T]'ps' .ds -> right -.if '\*[.T]'ps' .ds -> \(-> -'\" -'\" bx - box a Courier string for making keycaps -'\" -'\" N.B. this mess is to make the line drawing come out only -'\" if we are really generating postscript -'\" -.de bx -.ie !'\*[.T]'ps' \{\ -. RB [ \\$1 ]\\$2 -.\} -.el \{\ -. ie !r ps4html \{\ -'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul' -. ft CW -. nr par*bxw \w'\\$1'+.4m -\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\ -\Z'\h'.2m'\s-1\\$1\s+1'\ -\h'\\n[par*bxw]u'\\$2 -. ft P -. \} -. el \{\ -. RB [ \\$1 ]\\$2 -. \} -.\} -.. -'\" -'\" strings to set current color (null with old groff) -'\" -.if mred .ds red \m[red] -.if mgreen .ds green \m[green] -.if mblue .ds blue \m[blue] -.if mblack .ds black \m[black] -.if mblack .ds mP \mP -'\" -'\" fix for grotty + xterm. We call for orange, grotty outputs yellow, -'\" but xterm displays yellow as orange. The cycle is complete. -'\" -.if n .defcolor orange rgb #ffff00 -'\" -'\" color - set the current color (ignores request with old groff) -'\" -.de color -.if mred \m[\\$1]\c -.. -'\" -'\" colorword - colorize a word (ignored by old groff) -'\" -.de colorword -.ie m\\$1 \m[\\$1]\\$2\mP\c -.el \\$2\c -.. -'\" -'\" colbox - colorize a word in a filled box -'\" -.de colbox -.ie mred \M[\\$2]\ -\v'+.167v'\ -\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\ -\v'-.167v'\ -\m[\\$1]\\$3\mP\MP -.el \\$3\c -.. -'\" -'\" Macros for doing pdfmarks -'\" -.de specialps -.if '\*[.T]'ps' \\k_\X'ps: \\$*'\h'|\\n_u'\c -.. -'\" -'\" pdfmark PDFMARKCODE -'\" -.ds pdfmarks -.if d pdfmarks \{\ -.de pdfmark -. specialps exec [\\$1 pdfmark -.. -'\" -'\" pdfdest LINKNAME -'\" -.de pdfdest -.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST" -.. -'\" -'\" pdfbookmark COUNT LINKNAME STRING -'\" -.de pdfbookmark -. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT" -.. -'\" -'\" Define the SH and SS macros to save pdfmark information -'\" in "arrays" of numbers and strings. -'\" -.if !r rr_n \{\ -.nr rr_n 0 1 -.am SH -. nr rr_levels!\\n+[rr_n] 2 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.am SS -. nr rr_levels!\\n+[rr_n] 3 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.\} -'\" -'\" Called at the end of the document to generate the pdfmark outline -'\" -.de pdf_outline -.nr rr_levels!\\n+[rr_n] 1 -.nr rr_i 0 1 -.while \\n+[rr_i]<\\n[rr_n] \{\ -. nr rr_ip1 \\n[rr_i]+1 -. nr rr_count 0 -. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\ -. nr rr_j \\n[rr_i] 1 -. while \\n+[rr_j]<\\n[rr_n] \{\ -. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\ -. break -. \} -. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\ -. nr rr_count \\n[rr_count]+1 -. \} -. \} -. \} -. ds hhh \\*[rr_labels!\\n[rr_i]] -. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]" -.\} -.. -'\" -'\" Some postscript to make pdfmarks harmless on old interpreters... -'\" -.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse" -'\" -'\" Force display of Bookmarks in Acrobat when document is viewed. -'\" -.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW" -'\" -'\" Output the document info in pdfmarks -'\" -.pdfmark "\ - /Title (\*[an-title](\*[an-section])) \ - /Subject (\*[an-title] Manual Page) \ - /Author (Rick Richardson) \ - /Keywords (printing) \ - /Creator (groff \n(.x.\n(.y.\n(.Y -man) \ - /CreationDate (\*[an-extra1]) \ - /ModDate (\*[an-extra1]) \ - /DOCINFO" -\} -'\" -'\" The manual page name is only 1st level mark -'\" -.nr rr_levels!\n+[rr_n] 1 -.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section]) -.pdfdest Link\n[rr_n] -'\" -'\"========================================================================== -'\" MANUAL PAGE SOURCE -'\"========================================================================== -.SH NAME -foo2hbpl2 \- Convert Ghostscript pbmraw or bitcmyk format into a -ZJS printer stream -.SH SYNOPSIS -.B foo2hbpl2 -.RI [ options "] <" pbmraw-file " >" hbpl2-file -.sp 1 -.B foo2hbpl2 -.RI [ options "] <" bitcmyk-file " >" hbpl2-file -.sp 1 -.B foo2hbpl2 -.RI [ options "] <" pksmraw-file " >" hbpl2-file -.SH DESCRIPTION -.B foo2hbpl2 -converts Ghostscript pbmraw, bitcmyk, or pksmraw output formats to monochrome -or color HBPL version 2 streams, -for driving the -Dell 1355, Dell C1765, -Epson AcuLaser M1400, -Fuji Xerox DocuPrint CM205, -Fuji Xerox DocuPrint M215, -Fuji Xerox DocuPrint P205, -Xerox WorkCentre 3045 MFP, -and Xerox WorkCentre 6015 MFP printers. - -.SH COMMAND LINE OPTIONS -.SS Normal Options -These are the options used to select the parameters of a -print job that are usually controlled on a per job basis. -.TP -.BI \-c -Force color mode if autodetect doesn't work. -.TP -.BI \-d\0 duplex -Duplex code to send to printer [1]. -.TS -| n l | n l | n l . -1 off 2 long edge 3 short edge -.TE -.TP -.BI \-g\0 xpix x ypix -Set page dimensions in pixels [10200x6600]. -.TP -.BI \-m\0 media -Media code to send to printer [1]. -.TS -l r. -_ -Media HBPL -_ -plain 1 -bond 2 -lwcard 3 -lwgcard 4 -labels 5 -envelope 6 -recycled 7 -plain2 8 -bond2 9 -lwcard2 10 -lwgcard2 11 -recycled2 12 -.TE -.TP -.BI \-p\0 paper -Paper code to send to printer [1]. -.TS -l r. -_ -Paper HBPL -_ -A4 1 -B5jis 2 -letter 4 -executive 5 -fanfold german legal 6 -folio 6 -legal 7 -env#10 9 -envMonarch 10 -envC5 11 -envDL 12 -.TE -.TP -.BI \-n\0 copies -Number of copies [1]. -.TP -.BI \-r\0 xres x yres -Set device resolution in pixels/inch [1200x600]. -.TP -.BI \-s\0 source -Source (InputSlot) code to send to printer [7]. -.TS -| n l | n l. -1 upper 4 manual -2 lower 7 auto -.TE -.TP -.BI \-t -Draft mode. Every other pixel is white. -.TP -.BI \-J\0 filename -Filename string to send to printer. -.TP -.BI \-U\0 username -Username string to send to printer. -.SS Printer Tweaking Options -These are the options used to customize the operation of \fBfoo2hbpl2\fP -for a particular printer. -.TP -.BI \-u\0 xoff x yoff -Set the offset of the start of the printable region from the -upper left corner, in pixels [0x0]. -.TP -.BI \-l\0 xoff x yoff -Set the offset of the end of the printable region from the -lower right corner, in pixels [0x0]. -.TP -.BI \-L\0 mask -Send logical clipping amounts implied by -u/-l in the ZjStream [3]. -.TS -l l. -0 don't send any logical clipping amounts -1 only send Y clipping amount -2 only send X clipping amount -3 send both X and Y clipping amounts -.TE -.TP -.BI \-P -Do not send START_PLANE codes on monochrome output. May be -needed by some black and white only printers, such as the -HP LaserJet 1000. -.TP -.BI \-A -AllIsBlack: convert C=1,M=1,Y=1 to just K=1. Works with bitcmyk input only. -.TP -.BI \-B -BlackClears: K=1 forces C,M,Y to 0. Works with bitcmyk input only. -.TP -.BI \-X\0 padlen -Add extra zero padding to the end of BID segments. The default is -16 bytes. Padding 16 bytes of zeroes -is needed for older ZjStream printers, such as the Minolta 2200DL -and HP LaserJet 1000, and seems harmless to newer ones, such as -the Minolta 2300DL. So the default should be good for all cases. -.SS Debugging Options -These options are used for debugging \fBfoo2hbpl2\fP. -.TP -.BI \-S\0 plane -Output just a single color plane from a color print and print it -on the black plane. The default is to output all color planes. -.TS -l l. -1 Cyan -2 Magenta -3 Yellow -4 Black -.TE -.TP -.BI \-D\0 level -Set Debug level [0]. - -.SH EXAMPLES -Create a black and white ZJS stream: - -.RS -.nf -gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE \ - -sPAPERSIZE=letter -r1200x600 -sDEVICE=pbmraw \ - -sOutputFile=- - < testpage.ps \ -| foo2hbpl2 -r1200x600 -g10200x6600 -p1 >testpage.zm -.fi -.RE -.P -Create a color ZJS stream: - -.RS -.nf -gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE \ - -sPAPERSIZE=letter -g10200x6600 -r1200x600 -sDEVICE=bitcmyk \ - -sOutputFile=- - < testpage.ps \ -| foo2hbpl2 -r1200x600 -g10200x6600 -p1 >testpage.zc -.fi -.RE - -.SH FILES -.BR /usr/bin/foo2hbpl2 -.SH SEE ALSO -.BR foo2hbpl2-wrapper (1), -.BR hbpldecode (1) -.SH "AUTHOR" -Rick Richardson -.br -Peter Korf -.br -http://foo2hbpl.rkkda.com/ -'\" -'\" -'\" -.em pdf_outline diff --git a/foo2hiperc b/foo2hiperc deleted file mode 100755 index 07f5a85..0000000 Binary files a/foo2hiperc and /dev/null differ diff --git a/foo2hiperc-wrapper b/foo2hiperc-wrapper deleted file mode 100755 index adcc98d..0000000 --- a/foo2hiperc-wrapper +++ /dev/null @@ -1,750 +0,0 @@ -#!/bin/sh - -#* Copyright (C) 2003-2006 Rick Richardson -#* -#* This program is free software; you can redistribute it and/or modify -#* it under the terms of the GNU General Public License as published by -#* the Free Software Foundation; either version 2 of the License, or -#* (at your option) any later version. -#* -#* This program is distributed in the hope that it will be useful, -#* but WITHOUT ANY WARRANTY; without even the implied warranty of -#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -#* GNU General Public License for more details. -#* -#* You should have received a copy of the GNU General Public License -#* along with this program; if not, write to the Free Software -#* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#* -#* Authors: Rick Richardson - -VERSION='$Id: foo2hiperc-wrapper.in,v 1.34 2013/12/01 20:25:17 rick Exp $' - -# -# Printer Notes: -# -# Oki Data C301dn -z0 -# Oki Data C310dn -z0 -# Oki Data C3100 -z0 -# Oki Data C3200 -z0 -# Oki Data C3300 -z0 -# Oki Data C3400 -z0 -# Oki Data C5100 -z0 -# Oki Data C5250 -z0 -# Oki Data C5500 -z0 -# Oki Data C5600 -z0 -# Oki Data C5800 -z0 -# Olivetti d-Color P160W -z0 -# Oki C810 -z1 uses A3/tabloid paper! -# - -PROGNAME="$0" -BASENAME=`basename $PROGNAME` -PREFIX=/usr -SHARE=$PREFIX/share/foo2hiperc -PATH=$PATH:/sw/bin:/opt/local/bin -PATH=$PATH:. - -# -# Log the command line, for debugging and problem reports -# -if [ -x /usr/bin/logger -o -x /bin/logger ]; then - logger -t "$BASENAME" -p lpr.info -- "$BASENAME $@" x Set device resolution in pixels/inch [$RES] --s source Source code to send to printer [$SOURCE] - 0=auto 1=tray1 2=tray2 3=multi 4=manual - Code numbers may vary with printer model. --t Draft mode. Every other pixel is white. --2/-3/-4/-6/-8/-10/-12/-14/-15/-16/-18 - Print with N-up (requires psutils) --o orient For N-up: -op is portrait, -ol is landscape, -os is seascape. - -Printer Tweaking Options: --u x Set offset of upper left printable in pixels [varies] --l x Set offset of lower right printable in pixels [varies] --L mask Send logical clipping values from -u/-l in ZjStream [3] - 0=no, 1=Y, 2=X, 3=XY --P Do not output START_PLANE codes. May be needed by some - monochrome-only printers. --X padlen Add extra zero padding to the end of BID segments [16] --z model Model: 0=no A3 (usual), 1=A3 (C810 etc.) [$MODEL] --Z compressed Use uncompressed (0) or compressed (1) data [0] - -Color Tweaking Options: --g gsopts Additional options to pass to Ghostscript, such as - -dDITHERPPI=nnn, etc. May appear more than once. [] --G profile.icm Convert profile.icm to a Postscript CRD using icc2ps and - adjust colors using the setcolorrendering PS operator. - $SHARE/icm/ will be searched for profile.icm. --I intent Select profile intent from ICM file [$INTENT] - 0=Perceptual, 1=Colorimetric, 2=Saturation, 3=Absolute --G gamma-file.ps Prepend gamma-file to the Postscript input to perform - color correction using the setcolortransfer PS operator. - -Debugging Options: --S plane Output just a single color plane from a color print [all] - 1=Cyan, 2=Magenta, 3=Yellow, 4=Black --D lvl Set Debug level [$DEBUG] --V $VERSION -EOF - - exit 1 -} - -# -# Report an error and exit -# -error() { - echo "$BASENAME: $1" >&2 - exit 1 -} - -dbgcmd() { - if [ $DEBUG -ge 1 ]; then - echo "$@" >&2 - fi - "$@" -} - -# -# N-up-ify the job. Requires psnup from psutils package -# -nup() { - case "$NUP" in - [2368]|1[0458]) - tr '\r' '\n' | psnup $NUP_ORIENT -d2 -$NUP -m.3in -p$paper -q - ;; - [49]|1[26]) - tr '\r' '\n' | psnup $NUP_ORIENT -d2 -$NUP -m.5in -p$paper -q - ;; - *) - error "Illegal call to nup()." - ;; - esac -} - -# -# Process the options -# - -# Try to use a local copy of GhostScript 8.54, if available. Otherwise, -# fallback to whatever the Linux distro has installed (usually 7.07) -# -# N.B. := operator used here, when :- would be better, because "ash" -# doesn't have :- -if eval gs.foo -v >/dev/null 2>&1; then - GSBIN=${GSBIN:-gs.foo} -else - GSBIN=${GSBIN:-gs} -fi - -CMDLINE="$*" -DEBUG=0 -DUPLEX=1 -COLOR= -COLORMODE=default -MODEL=0 -QUALITY=1 -QUALITY=wts -MEDIA=0 -COPIES=1 -PAPER=2 -RES=600x600 -SOURCE=0 -NUP= -CLIP_UL= -CLIP_LR= -CLIP_LOG= -BC= -AIB= -NOPLANES= -COLOR2MONO= -GAMMAFILE=default -INTENT=0 -GSOPTS= -EXTRAPAD= -SAVETONER= -NUP_ORIENT= -COMPRESSED= -GSDEV=-sDEVICE=pbmraw -# What mode to use if the user wants us to pick the "best" mode -case `$GSBIN --version` in -7*) DEFAULTCOLORMODE=10 - DEFAULTCOLORMODE=10 - ;; -8.1*) - DEFAULTCOLORMODE=10 - QUALITY=1 - ;; -*) DEFAULTCOLORMODE=10 - ;; -esac -while getopts "1:23456789o:b:cC:d:g:l:u:L:m:n:p:q:r:s:tz:ABS:D:G:I:PX:Z:Vh?" opt -do - case $opt in - b) GSBIN="$OPTARG";; - c) COLOR=-c;; - d) DUPLEX="$OPTARG";; - g) GSOPTS="$GSOPTS $OPTARG";; - m) MEDIA="$OPTARG";; - n) COPIES="$OPTARG";; - p) PAPER="$OPTARG";; - q) QUALITY="$OPTARG";; - r) RES="$OPTARG";; - s) SOURCE="$OPTARG";; - t) SAVETONER="-t";; - z) MODEL="$OPTARG";; - l) CLIP_LR="-l $OPTARG";; - u) CLIP_UL="-u $OPTARG";; - L) CLIP_LOG="-L $OPTARG";; - A) AIB=-A;; - B) BC=-B;; - C) COLORMODE="$OPTARG";; - S) COLOR2MONO="-S$OPTARG";; - D) DEBUG="$OPTARG";; - G) GAMMAFILE="$OPTARG";; - I) INTENT="$OPTARG";; - P) NOPLANES=-P;; - X) EXTRAPAD="-X $OPTARG";; - Z) COMPRESSED="-Z $OPTARG";; - [234689]) NUP="$opt";; - [57]) error "Can't find acceptable layout for $opt-up";; - 1) case "$OPTARG" in - [024568]) NUP="1$OPTARG";; - *) error "Can't find acceptable layout for 1$OPTARG-up";; - esac - ;; - o) case "$OPTARG" in - l*) NUP_ORIENT=-l;; - s*) NUP_ORIENT=-r;; - p*|*) NUP_ORIENT=;; - esac;; - V) echo "$VERSION"; foo2hiperc -V; foo2zjs-pstops -V; exit 0;; - h|\?) - if [ "$CMDLINE" != "-?" -a "$CMDLINE" != -h ]; then - echo "Illegal command:" - echo " $0 $CMDLINE" - echo - fi - usage;; - esac -done -shift `expr $OPTIND - 1` - -# -# If there is an argument left, take it as the file to print. -# Else, the input comes from stdin. -# -if [ $# -ge 1 ]; then - if [ "$LPJOB" = "" ]; then - : # LPJOB="$1" - fi - exec < $1 -fi - -# -case "$QUALITY" in -0) - GSOPTS="-dCOLORSCREEN $GSOPTS" - ;; -1) - GSOPTS="-dCOLORSCREEN $GSOPTS" - ;; -2) - GSOPTS="-dMaxBitmap=500000000 $GSOPTS" - ;; -as) - GSOPTS="-dCOLORSCREEN -dMaxBitmap=500000000 $GSOPTS" - ;; -wts) - GSOPTS="-dCOLORSCREEN -dMaxBitmap=500000000 $GSOPTS" - ;; -esac - -# -# Validate model code -# -case "$MODEL" in -0|1) ;; -*) error "Unknown model code $MODEL";; -esac - -# -# Validate media code -# -case "$MEDIA" in -0|plain) MEDIA=0;; -1|labels) MEDIA=1;; -2|transparency) MEDIA=2;; -[0-9]*) ;; -*) error "Unknown media code $MEDIA";; -esac - -# -# Validate source (InputSlot) code -# -case "$SOURCE" in -1|tray1) SOURCE=1;; -2|tray2) SOURCE=2;; -3|multi) SOURCE=3;; -4|manual) SOURCE=4;; -[0-9]*) ;; -*) error "Unknown source code $SOURCE";; -esac - -# -# Validate Duplex code -# -case "$DUPLEX" in -1|off|none) DUPLEX=1;; -2|long*) DUPLEX=2;; -3|short*) DUPLEX=3;; -[0-9]*) ;; -*) error "Unknown duplex code $DUPLEX";; -esac - -# -# Validate Resolution -# -case "$RES" in -300x300) ;; -600x600) ;; -1200x600) ;; -1200x1200) ;; -600x1200) ;; -*) error "Illegal resolution $RES";; -esac - -# -# 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 - 300x300) ulx=`expr $ulx / 4`; uly=`expr $uly / 2`;; - 600x600) ulx=`expr $ulx / 2`;; - 600x1200) ulx=`expr $ulx / 2`; uly=`expr $uly \* 2`;; - 2400x600) ulx=`expr $ulx \* 2`;; - esac - CLIP_UL="-u ${ulx}x${uly}" - fi - if [ "$CLIP_LR" = "" ]; then - case "$RES" in - 300x300) lrx=`expr $lrx / 4`; lry=`expr $lry / 2`;; - 600x600) lrx=`expr $lrx / 2`;; - 600x1200) lrx=`expr $lrx / 2`; lry=`expr $lry \* 2`;; - 2400x600) lrx=`expr $lrx \* 2`;; - esac - CLIP_LR="-l ${lrx}x${lry}" - fi -} - -case "$PAPER" in -Custom*x*) - # Command line only - XDIM=`echo "$PAPER" | sed -e "s/Custom.//" -e "s/x.*//" ` - YDIM=`echo "$PAPER" | sed -e "s/.*x//" ` - if [ "$XDIM" = "" -o "$YDIM" = "" ]; then - error "Custom page size '$PAPER' != 1-99999" - fi - if [ "$XDIM" -eq 0 -o "$YDIM" -eq 0 ]; then - error "Custom page size '$PAPER' != 1-99999" - fi - XDIM=`dc -e "$XDIM 1200* 72/p"` - YDIM=`dc -e "$YDIM 600* 72/p"` - PAPER=21; paper=letter; - set_clipping 2 100 2 100 - ;; -Custom*) - #%%BeginFeature: *CustomPageSize True - #216 - #360 - #0 - #0 - #0 - #pop pop pop pop pop - - #%%BeginFeature: *CustomPageSize True - #792.000000 612.000000 1 0.000000 0.000000 - #pop pop pop pop pop - - if [ $DEBUG = 0 ]; then - TMPFILE=/tmp/cus$$ - else - TMPFILE=/tmp/custom.ps - fi - cat >$TMPFILE - exec <$TMPFILE - - tmp=`head -n 10000 $TMPFILE \ - | sed -n '/CustomPageSize/{n;p;n;p;}' \ - | tr '\n' ' '` - case "$tmp" in - [0-9]*\ [0-9]*) - XDIM=`echo "$tmp" | sed 's/ .*//'` - YDIM=`echo "$tmp" | sed -e 's/^[^ ]* //' -e 's/ .*//'` - ;; - *) - if [ $DEBUG = 0 ]; then rm -f $TMPFILE; fi - error "Custom page size [XY]DIM != 1-99999" - ;; - esac - XDIM=`dc -e "$XDIM 1200* 72/p"` - YDIM=`dc -e "$YDIM 600* 72/p"` - PAPER=21; paper=letter; - set_clipping 2 100 2 100 - ;; -1|a4|A4) PAPER=1; paper=a4; XDIM="9920"; YDIM="7016" - set_clipping 150 100 150 100 - ;; -2|letter) PAPER=2; paper=letter; XDIM="10200"; YDIM="6600" - set_clipping 150 100 150 100 - ;; -3|legal) PAPER=3; paper=legal; XDIM="10200"; YDIM="8400" - set_clipping 150 100 150 100 - ;; -5|a5|A5) PAPER=5; paper=a5; XDIM="6992"; YDIM="4960" - set_clipping 150 100 150 100 - ;; -6|b5jis|B5jis) PAPER=6; paper=b5; XDIM="8598"; YDIM="6070" - set_clipping 150 100 150 100 - ;; -7|a6|A6) PAPER=7; paper=a6; XDIM="4960"; YDIM="3496" - set_clipping 150 100 150 100 - ;; -8|envMonarch) PAPER=8; paper=envMonarch;XDIM="4650"; YDIM="4500" - set_clipping 150 100 150 100 - ;; -9|envDL) PAPER=9; paper=envDL; XDIM="5200"; YDIM="5200" - set_clipping 150 100 150 100 - ;; -10|envC5) PAPER=10; paper=envC5; XDIM="7650"; YDIM="5408" - set_clipping 150 100 150 100 - ;; -11|"env#10") PAPER=11; paper=env10; XDIM="4950"; YDIM="5700" - set_clipping 150 100 150 100 - ;; -12|executive) PAPER=12; paper=executive; XDIM="8700"; YDIM="6300" - set_clipping 150 100 150 100 - ;; -13|"env#9") PAPER=13; paper=env9; XDIM="4496"; YDIM="5324" - set_clipping 150 100 150 100 - ;; -14|legal135) PAPER=14; paper=legal135; XDIM="10200"; YDIM="8100" - set_clipping 150 100 150 100 - ;; -15|a3|A3) PAPER=15; paper=a3; XDIM="19842"; YDIM="7016" - set_clipping 150 100 150 100 - ;; -16|ledger|tabloid) - PAPER=16; paper=tabloid; XDIM="20400"; YDIM="6600" - set_clipping 150 100 150 100 - ;; -*) error "Unimplemented paper code $PAPER";; -esac -# e.g. /usr/share/ghostscript/7.07/lib/gs_statd.ps -PAPERSIZE="-sPAPERSIZE=$paper"; - -case "$RES" in -300x300) XDIM=`expr $XDIM / 4`; YDIM=`expr $YDIM / 2`;; -600x600) XDIM=`expr $XDIM / 2`;; -1200x600) ;; -1200x1200) YDIM=`expr $YDIM \* 2`;; -600x1200) XDIM=`expr $XDIM / 2`; YDIM=`expr $YDIM \* 2`;; -esac - -ROTATE90=0 -case "$MODEL" in -1) # A3 or 11x17 printer - case "$paper" in - a3) # A3, do not rotate - ;; - ledger|tabloid) # ledger, do not rotate - ;; - *) # Rotate all others - ROTATE90=1 - tmp=$XDIM - XDIM=$YDIM - YDIM=$tmp - case "$RES" in - 600x600) YDIMpoints=`dc -e "6k $YDIM 600 / 72 *p"`;; - 1200x600) YDIMpoints=`dc -e "6k $YDIM 1200 / 72 *p"`;; - 2400x600) YDIMpoints=`dc -e "6k $YDIM 2400 / 72 *p"`;; - esac - esac - ;; -esac - -DIM="${XDIM}x${YDIM}" - -# -# Filter thru psnup if N-up printing has been requested -# -case $NUP in -[234689]|1[024568]) PREFILTER="nup";; -*) PREFILTER=cat;; -esac -if [ "$DEBUG" -ge 9 ]; then - PREFILTER="tee /tmp/$BASENAME.ps" -fi - -# -# 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) - ;; - *) - if [ -x /usr/bin/logger ]; then - logger -t "$BASENAME" -p lpr.info -- \ - "`basename $ICC2PS` -o $GAMMAFILE -t$INTENT > $ICCTMP.crd.ps" - fi - $ICC2PS -o $GAMMAFILE -t$INTENT > $ICCTMP.crd.ps 2>$ICCTMP.log \ - || error "Problem converting .ICM file to Postscript" - ;; - esac - - PSTOPS_OPTS="$PSTOPS_OPTS -c" - cat > $ICCTMP.usecie.ps <<-EOF - %!PS-Adobe-3.0 - <>setpagedevice - EOF - if [ "$QUALITY" = wts -o "$QUALITY" = as ]; then - if [ "$QUALITY" = wts ]; then - cat >> $ICCTMP.usecie.ps <<-EOF - << /UseWTS true >> setuserparams - EOF - else - cat >> $ICCTMP.usecie.ps <<-EOF - << /UseWTS false >> setuserparams - EOF - fi - cat >> $ICCTMP.usecie.ps <<-EOF - << - /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 - GAMMAFILE= - fi -} - -if [ $DEBUG -gt 0 ]; then - ICCTMP=/tmp/icc -else - ICCTMP=/tmp/icc$$ -fi - -if [ "" = "$COLOR" ]; then - COLORMODE= - GAMMAFILE= -else - case "$COLORMODE" in - default) COLORMODE=$DEFAULTCOLORMODE;; - esac - case "$GAMMAFILE" in - default) GAMMAFILE=samclp300-0.icm;; - esac -fi - -CRDBASE="$PREFIX/share/foo2hiperc/crd" -if false; then - case "$MODEL" in - 0) model=CLP-300;; - 1) model=CLP-600;; - esac - case "$RES" in - 600x600) SCREEN=$model-600x600cms2;; - 1200x600) SCREEN=$model-1200x600cms2;; - 1200x1200) SCREEN=$model-1200x1200cms2;; - esac -fi - -PSTOPS_OPTS="-n" -if [ $ROTATE90 = 1 ]; then - case $paper in - a3) ;; - ledger) ;; - tabloid) ;; - *) PSTOPS_OPTS="$PSTOPS_OPTS -h $YDIMpoints -r";; - esac -fi - -case "$COLORMODE" in -0|"") - # 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" - ;; -*.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'" - ;; -esac - -if [ "$COLOR" != "" -a "$QUALITY" = wts ]; then - PSTOPS_OPTS="$PSTOPS_OPTS -w" -elif [ "$COLOR" != "" -a "$QUALITY" = as ]; then - PSTOPS_OPTS="$PSTOPS_OPTS -a" -fi - -if [ "" != "$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 - fi -fi - -# -# 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" - -foo2zjs-pstops $PSTOPS_OPTS | \ -$PREFILTER \ -| ($GS $PAPERSIZE -g$DIM -r$RES $GSDEV $GSOPTS \ - -sOutputFile="|cat 1>&3" $GAMMAFILE -_ >/dev/null) 3>&1 \ -| foo2hiperc -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 $COMPRESSED -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 -- \ - "foo2hiperc -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 $COMPRESSED" -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 $TMPFILE2 -fi - -exit 0 diff --git a/foo2hiperc-wrapper.1 b/foo2hiperc-wrapper.1 deleted file mode 100644 index a695bd3..0000000 --- a/foo2hiperc-wrapper.1 +++ /dev/null @@ -1,393 +0,0 @@ -'\" t -'\" -'\" DO NOT EDIT! This file is generated from foo2hiperc-wrapper.1in -'\" -'\" t -.TH foo2hiperc-wrapper 1 "Sun May 26 18:25:20 2024" "foo2hiperc-wrapper 0.0" -'\" -'\" -'\"========================================================================== -'\" STRINGS and MACROS -'\"========================================================================== -'\" -'\" Define strings for special characters that nroff doesn't have -'\" -'\" N.B. using .if cua to test for special characters did not work. -'\" -.if !'\*[.T]'ps' .ds ua up -.if '\*[.T]'ps' .ds ua \(ua -.if !'\*[.T]'ps' .ds da down -.if '\*[.T]'ps' .ds da \(da -.if !'\*[.T]'ps' .ds <- left -.if '\*[.T]'ps' .ds <- \(<- -.if !'\*[.T]'ps' .ds -> right -.if '\*[.T]'ps' .ds -> \(-> -'\" -'\" bx - box a Courier string for making keycaps -'\" -'\" N.B. this mess is to make the line drawing come out only -'\" if we are really generating postscript -'\" -.de bx -.ie !'\*[.T]'ps' \{\ -. RB [ \\$1 ]\\$2 -.\} -.el \{\ -. ie !r ps4html \{\ -'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul' -. ft CW -. nr par*bxw \w'\\$1'+.4m -\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\ -\Z'\h'.2m'\s-1\\$1\s+1'\ -\h'\\n[par*bxw]u'\\$2 -. ft P -. \} -. el \{\ -. RB [ \\$1 ]\\$2 -. \} -.\} -.. -'\" -'\" strings to set current color (null with old groff) -'\" -.if mred .ds red \m[red] -.if mgreen .ds green \m[green] -.if mblue .ds blue \m[blue] -.if mblack .ds black \m[black] -.if mblack .ds mP \mP -'\" -'\" fix for grotty + xterm. We call for orange, grotty outputs yellow, -'\" but xterm displays yellow as orange. The cycle is complete. -'\" -.if n .defcolor orange rgb #ffff00 -'\" -'\" color - set the current color (ignores request with old groff) -'\" -.de color -.if mred \m[\\$1]\c -.. -'\" -'\" colorword - colorize a word (ignored by old groff) -'\" -.de colorword -.ie m\\$1 \m[\\$1]\\$2\mP\c -.el \\$2\c -.. -'\" -'\" colbox - colorize a word in a filled box -'\" -.de colbox -.ie mred \M[\\$2]\ -\v'+.167v'\ -\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\ -\v'-.167v'\ -\m[\\$1]\\$3\mP\MP -.el \\$3\c -.. -'\" -'\" Macros for doing pdfmarks -'\" -.de specialps -.if '\*[.T]'ps' \\k_\X'ps: \\$*'\h'|\\n_u'\c -.. -'\" -'\" pdfmark PDFMARKCODE -'\" -.ds pdfmarks -.if d pdfmarks \{\ -.de pdfmark -. specialps exec [\\$1 pdfmark -.. -'\" -'\" pdfdest LINKNAME -'\" -.de pdfdest -.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST" -.. -'\" -'\" pdfbookmark COUNT LINKNAME STRING -'\" -.de pdfbookmark -. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT" -.. -'\" -'\" Define the SH and SS macros to save pdfmark information -'\" in "arrays" of numbers and strings. -'\" -.if !r rr_n \{\ -.nr rr_n 0 1 -.am SH -. nr rr_levels!\\n+[rr_n] 2 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.am SS -. nr rr_levels!\\n+[rr_n] 3 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.\} -'\" -'\" Called at the end of the document to generate the pdfmark outline -'\" -.de pdf_outline -.nr rr_levels!\\n+[rr_n] 1 -.nr rr_i 0 1 -.while \\n+[rr_i]<\\n[rr_n] \{\ -. nr rr_ip1 \\n[rr_i]+1 -. nr rr_count 0 -. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\ -. nr rr_j \\n[rr_i] 1 -. while \\n+[rr_j]<\\n[rr_n] \{\ -. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\ -. break -. \} -. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\ -. nr rr_count \\n[rr_count]+1 -. \} -. \} -. \} -. ds hhh \\*[rr_labels!\\n[rr_i]] -. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]" -.\} -.. -'\" -'\" Some postscript to make pdfmarks harmless on old interpreters... -'\" -.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse" -'\" -'\" Force display of Bookmarks in Acrobat when document is viewed. -'\" -.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW" -'\" -'\" Output the document info in pdfmarks -'\" -.pdfmark "\ - /Title (\*[an-title](\*[an-section])) \ - /Subject (\*[an-title] Manual Page) \ - /Author (Rick Richardson) \ - /Keywords (printing) \ - /Creator (groff \n(.x.\n(.y.\n(.Y -man) \ - /CreationDate (\*[an-extra1]) \ - /ModDate (\*[an-extra1]) \ - /DOCINFO" -\} -'\" -'\" The manual page name is only 1st level mark -'\" -.nr rr_levels!\n+[rr_n] 1 -.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section]) -.pdfdest Link\n[rr_n] -'\" -'\"========================================================================== -'\" MANUAL PAGE SOURCE -'\"========================================================================== -.SH NAME -foo2hiperc-wrapper \- Convert Postscript into a HIPERC printer stream -.SH SYNOPSIS -.B foo2hiperc-wrapper -.RI [ options "] [" ps-file ] -.SH DESCRIPTION -.B foo2hiperc-wrapper -is a Foomatic compatible printer wrapper for the -\fBfoo2hiperc\fP printer driver. -This script reads a Postscript \fIps-file\fP or standard input -and converts it to the Oki HIPERC printer format -for driving the -Oki C310dn, C3100, C3200, C3300n, C3400n, C5100n, C5500n, C5600n and the C5800n -HIPERC printers. -.P -This script can be used in a standalone fashion, but is intended to -be called from a printer spooler system which uses the Foomatic -printer database. - -.SH COMMAND LINE OPTIONS -.SS Normal Options -These are the options used to select the parameters of a -print job that are usually controlled on a per job basis. -.TP -.BI \-c -Print in color (else monochrome). -.TP -.BI \-C\0 colormode -Color correction mode [0]. -.TS -n l . -10 ICM color profile (using -G *.icm file) -.TE -.TP -.BI \-d\0 duplex -Duplex code to send to printer [1]. -.TS -| n l | n l | n l . -1 off 2 long edge 3 short edge -.TE -.TP -.BI \-m\0 media -Media code to send to printer [0]. -.TS -l l l -l n n. -_ -Media HIPERC -_ -plain 0 -labels 1 -transparency 2 -.TE -.TP -.BI \-p\0 paper -Paper size code to send to printer [2]. -.TS -box; -| n l | n l. -1 A4 2 letter -3 legal - - -5 A5 6 B5jis -7 A6 8 env Monarch -9 env DL 10 env C5 -11 env #10 12 executive -13 env #9 14 legal 13.5" -15 A3 16 tabloid/ledger -.TE -.TP -.BI \-n\0 copies -Number of copies [1]. -.TP -.BI \-r\0 xres x yres -Set device resolution in pixels/inch [600x600]. -.TP -.BI \-s\0 source -Source (Input Slot) code to send to printer [0]. -.TS -| n l | n l. -0 auto select -1 tray1 2 tray2 -3 multi 4 manual -.TE -.TP -.BI \-t -Draft mode. Every other pixel is white. -.TP -.BI "\-2 \-3 \-4 \-5 \-6 \-8 \-9 \-10 \-12 \-14 \-15 \-16 \-18" -Print in N-up. Requires the \fBpsutils\fP package. -.TP -.BI \-o\0 orient -Orientation used for N-up. -.TS -l l l. -Portrait -op (normal) -Landscape -ol (rotated 90 degrees anticlockwise) -Seascape -os (rotated 90 degrees clockwise) -.TE -.SS Printer Tweaking Options -These are the options used to customize the operation of \fBfoo2hiperc\fP -for a particular printer. -.TP -.BI \-u\0 xoff x yoff -Set the offset of the start of the printable region from the -upper left corner, in pixels [varies with paper size]. -.TP -.BI \-l\0 xoff x yoff -Set the offset of the end of the printable region from the -lower right corner, in pixels [varies with paper size]. -.TP -.BI \-L\0 mask -Send the logical clipping values from -u/-l in the HIPERC stream. -\fBfoo2hiperc-wrapper\fP always runs Ghostscript with the ideal page dimensions, -so that the scale of the image is correct, -regardless whether or not the printer has unprintable regions. -This option is used to move the position of the clipped image -back to where it belongs on the page. The default is to send -the amount which was clipped by -u and -l, and should be -good in most cases. -.TS -l l. -0 don't send any logical clipping amounts -1 only send Y clipping amount -2 only send X clipping amount -3 send both X and Y clipping amounts -.TE -.TP -.BI \-z\0 model -Model is 0 for non-A3 sized printers, -and 1 for A3/Tabloid/Ledger sized printers (i.e. C810, etc.). -The default is 0. -.TP -.BI \-Z\0 compressed -Use uncompressed (0) or compressed (1) JBIG data. -.SS Color Tweaking Options -These are the options used to control the quality of color output. -Color correction is currently a WORK IN PROGRESS. -.TP -.BI \-g\0 gsopts -Additional options to pass to Ghostscript, such as -g\(lq-dDITHERPPI=nnn\(rq, -etc. This option may appear more than once. -.TP -.BI \-G\0 profile.icm -Convert \fIprofile.icm\fP to a Postscript color rendering -dictionary (CRD) using \fBfoo2zjs-icc2ps\fP and -adjust the printer colors by using the Postscript \fBsetcolorrendering\fP -operator. (WORK IN PROGRESS). -.TP -.BI \-G\0 gamma-file.ps -Prepend \fIgamma-file.ps\fP to the Postscript input to perform -color correction using the \fBsetcolortransfer\fP Postscript operator. -For example, the file might contain: -.br -{0.333 exp} {0.333 exp} {0.333 exp} {0.333 exp} setcolortransfer -.TP -.BI \-I\0 intent -Select profile intent from the ICM file. -0=Perceptual, 1=Colorimetric, 2=Saturation, 3=Absolute. -Default is 0 (perceptual). -.SS Debugging Options -These options are used for debugging \fBfoo2hiperc\fP and its wrapper. -.TP -.BI \-S\0 plane -Output just a single color plane from a color print and print it -on the black plane. The default is to output all color planes. -.TS -l l. -1 Cyan -2 Magenta -3 Yellow -4 Black -.TE -.TP -.BI \-D\0 level -Set Debug level [0]. - -.SH EXAMPLES -Create a monochrome HIPERC stream from a Postscript document, -examine it, and then print it using nc(1) or netcat(1): - -.RS -.nf -foo2hiperc-wrapper testpage.ps > testpage.hc -hipercdecode < testpage.hc -nc 192.168.1.NNN 9100 < testpage.hc -.fi -.RE -.P -Create a color HIPERC stream from a Postscript document: - -.RS -.nf -foo2hiperc-wrapper -c testpage.ps > testpage.hc -.fi -.RE - -.SH FILES -.BR /usr/bin/foo2hiperc-wrapper -.SH SEE ALSO -.BR foo2hiperc (1), -.BR hipercdecode (1) -.SH "AUTHOR" -Rick Richardson -.br -http://foo2hiperc.rkkda.com/ -'\" -'\" -'\" -.em pdf_outline diff --git a/foo2hiperc-wrapper.1in b/foo2hiperc-wrapper.1in index 3601f56..0dca96b 100644 --- a/foo2hiperc-wrapper.1in +++ b/foo2hiperc-wrapper.1in @@ -37,7 +37,7 @@ Print in color (else monochrome). Color correction mode [0]. .TS n l . -10 ICM color profile (using -G *.icm file) +10 ICM color profile (using \-G *.icm file) .TE .TP .BI \-d\0 duplex @@ -66,7 +66,7 @@ Paper size code to send to printer [2]. box; | n l | n l. 1 A4 2 letter -3 legal - - +3 legal \- \- 5 A5 6 B5jis 7 A6 8 env Monarch 9 env DL 10 env C5 @@ -100,9 +100,9 @@ Print in N-up. Requires the \fBpsutils\fP package. Orientation used for N-up. .TS l l l. -Portrait -op (normal) -Landscape -ol (rotated 90 degrees anticlockwise) -Seascape -os (rotated 90 degrees clockwise) +Portrait \-op (normal) +Landscape \-ol (rotated 90 degrees anticlockwise) +Seascape \-os (rotated 90 degrees clockwise) .TE .SS Printer Tweaking Options These are the options used to customize the operation of \fBfoo2hiperc\fP @@ -117,13 +117,13 @@ Set the offset of the end of the printable region from the lower right corner, in pixels [varies with paper size]. .TP .BI \-L\0 mask -Send the logical clipping values from -u/-l in the HIPERC stream. +Send the logical clipping values from \-u/-l in the HIPERC stream. \fBfoo2hiperc-wrapper\fP always runs Ghostscript with the ideal page dimensions, so that the scale of the image is correct, regardless whether or not the printer has unprintable regions. This option is used to move the position of the clipped image back to where it belongs on the page. The default is to send -the amount which was clipped by -u and -l, and should be +the amount which was clipped by \-u and \-l, and should be good in most cases. .TS l l. @@ -145,7 +145,7 @@ These are the options used to control the quality of color output. Color correction is currently a WORK IN PROGRESS. .TP .BI \-g\0 gsopts -Additional options to pass to Ghostscript, such as -g\(lq-dDITHERPPI=nnn\(rq, +Additional options to pass to Ghostscript, such as \-g\(lq-dDITHERPPI=nnn\(rq, etc. This option may appear more than once. .TP .BI \-G\0 profile.icm @@ -198,7 +198,7 @@ Create a color HIPERC stream from a Postscript document: .RS .nf -foo2hiperc-wrapper -c testpage.ps > testpage.hc +foo2hiperc-wrapper \-c testpage.ps > testpage.hc .fi .RE diff --git a/foo2hiperc-wrapper.in b/foo2hiperc-wrapper.in index adcc98d..86b6cee 100755 --- a/foo2hiperc-wrapper.in +++ b/foo2hiperc-wrapper.in @@ -13,8 +13,8 @@ #* GNU General Public License for more details. #* #* You should have received a copy of the GNU General Public License -#* along with this program; if not, write to the Free Software -#* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +#* along with this program; if not, see +#* . #* #* Authors: Rick Richardson diff --git a/foo2hiperc.1 b/foo2hiperc.1 deleted file mode 100644 index 09c7809..0000000 --- a/foo2hiperc.1 +++ /dev/null @@ -1,356 +0,0 @@ -'\" t -'\" -'\" DO NOT EDIT! This file is generated from foo2hiperc.1in -'\" -'\" t -.TH foo2hiperc 1 "Sun May 26 18:25:20 2024" "foo2hiperc 0.0" -'\" -'\" -'\"========================================================================== -'\" STRINGS and MACROS -'\"========================================================================== -'\" -'\" Define strings for special characters that nroff doesn't have -'\" -'\" N.B. using .if cua to test for special characters did not work. -'\" -.if !'\*[.T]'ps' .ds ua up -.if '\*[.T]'ps' .ds ua \(ua -.if !'\*[.T]'ps' .ds da down -.if '\*[.T]'ps' .ds da \(da -.if !'\*[.T]'ps' .ds <- left -.if '\*[.T]'ps' .ds <- \(<- -.if !'\*[.T]'ps' .ds -> right -.if '\*[.T]'ps' .ds -> \(-> -'\" -'\" bx - box a Courier string for making keycaps -'\" -'\" N.B. this mess is to make the line drawing come out only -'\" if we are really generating postscript -'\" -.de bx -.ie !'\*[.T]'ps' \{\ -. RB [ \\$1 ]\\$2 -.\} -.el \{\ -. ie !r ps4html \{\ -'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul' -. ft CW -. nr par*bxw \w'\\$1'+.4m -\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\ -\Z'\h'.2m'\s-1\\$1\s+1'\ -\h'\\n[par*bxw]u'\\$2 -. ft P -. \} -. el \{\ -. RB [ \\$1 ]\\$2 -. \} -.\} -.. -'\" -'\" strings to set current color (null with old groff) -'\" -.if mred .ds red \m[red] -.if mgreen .ds green \m[green] -.if mblue .ds blue \m[blue] -.if mblack .ds black \m[black] -.if mblack .ds mP \mP -'\" -'\" fix for grotty + xterm. We call for orange, grotty outputs yellow, -'\" but xterm displays yellow as orange. The cycle is complete. -'\" -.if n .defcolor orange rgb #ffff00 -'\" -'\" color - set the current color (ignores request with old groff) -'\" -.de color -.if mred \m[\\$1]\c -.. -'\" -'\" colorword - colorize a word (ignored by old groff) -'\" -.de colorword -.ie m\\$1 \m[\\$1]\\$2\mP\c -.el \\$2\c -.. -'\" -'\" colbox - colorize a word in a filled box -'\" -.de colbox -.ie mred \M[\\$2]\ -\v'+.167v'\ -\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\ -\v'-.167v'\ -\m[\\$1]\\$3\mP\MP -.el \\$3\c -.. -'\" -'\" Macros for doing pdfmarks -'\" -.de specialps -.if '\*[.T]'ps' \\k_\X'ps: \\$*'\h'|\\n_u'\c -.. -'\" -'\" pdfmark PDFMARKCODE -'\" -.ds pdfmarks -.if d pdfmarks \{\ -.de pdfmark -. specialps exec [\\$1 pdfmark -.. -'\" -'\" pdfdest LINKNAME -'\" -.de pdfdest -.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST" -.. -'\" -'\" pdfbookmark COUNT LINKNAME STRING -'\" -.de pdfbookmark -. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT" -.. -'\" -'\" Define the SH and SS macros to save pdfmark information -'\" in "arrays" of numbers and strings. -'\" -.if !r rr_n \{\ -.nr rr_n 0 1 -.am SH -. nr rr_levels!\\n+[rr_n] 2 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.am SS -. nr rr_levels!\\n+[rr_n] 3 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.\} -'\" -'\" Called at the end of the document to generate the pdfmark outline -'\" -.de pdf_outline -.nr rr_levels!\\n+[rr_n] 1 -.nr rr_i 0 1 -.while \\n+[rr_i]<\\n[rr_n] \{\ -. nr rr_ip1 \\n[rr_i]+1 -. nr rr_count 0 -. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\ -. nr rr_j \\n[rr_i] 1 -. while \\n+[rr_j]<\\n[rr_n] \{\ -. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\ -. break -. \} -. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\ -. nr rr_count \\n[rr_count]+1 -. \} -. \} -. \} -. ds hhh \\*[rr_labels!\\n[rr_i]] -. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]" -.\} -.. -'\" -'\" Some postscript to make pdfmarks harmless on old interpreters... -'\" -.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse" -'\" -'\" Force display of Bookmarks in Acrobat when document is viewed. -'\" -.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW" -'\" -'\" Output the document info in pdfmarks -'\" -.pdfmark "\ - /Title (\*[an-title](\*[an-section])) \ - /Subject (\*[an-title] Manual Page) \ - /Author (Rick Richardson) \ - /Keywords (printing) \ - /Creator (groff \n(.x.\n(.y.\n(.Y -man) \ - /CreationDate (\*[an-extra1]) \ - /ModDate (\*[an-extra1]) \ - /DOCINFO" -\} -'\" -'\" The manual page name is only 1st level mark -'\" -.nr rr_levels!\n+[rr_n] 1 -.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section]) -.pdfdest Link\n[rr_n] -'\" -'\"========================================================================== -'\" MANUAL PAGE SOURCE -'\"========================================================================== -.SH NAME -foo2hiperc \- Convert Ghostscript pbmraw or bitcmyk format into a -HIPERC printer stream -.SH SYNOPSIS -.B foo2hiperc -.RI [ options "] <" pbmraw-file " >" hiperc-file -.sp 1 -.B foo2hiperc -.RI [ options "] <" bitcmyk-file " >" hiperc-file -.sp 1 -.B foo2hiperc -.RI [ options "] <" pksmraw-file " >" hiperc-file -.SH DESCRIPTION -.B foo2hiperc -converts Ghostscript pbmraw, bitcmyk, or pksmraw output formats to monochrome -or color HIPERC streams, -for driving the -Oki C310dn, C3100, C3200, C3300n, C3400n, C5100n, C5500n, C5600n, and the C5800n -HIPERC printers. - -.SH COMMAND LINE OPTIONS -.SS Normal Options -These are the options used to select the parameters of a -print job that are usually controlled on a per job basis. -.TP -.BI \-c -Force color mode if autodetect doesn't work. -.TP -.BI \-d\0 duplex -Duplex code to send to printer [1]. -.TS -| n l | n l | n l . -1 off 2 long edge 3 short edge -.TE -.TP -.BI \-g\0 xpix x ypix -Set page dimensions in pixels [5100x6600]. -.TP -.BI \-m\0 media -Media code to send to printer [0]. -.TS -l l l -l n n. -_ -Media HIPERC -_ -plain 0 -labels 1 -transparency 2 -.TE -.TP -.BI \-p\0 paper -Paper code to send to printer [2]. -.TS -box; -| n l | n l. -1 A4 2 letter -3 legal - - -5 A5 6 B5jis -7 A6 8 env Monarch -9 env DL 10 env C5 -11 env #10 12 executive -13 env #9 14 legal 13.5" -15 A3 16 tabloid/ledger -.TE -.TP -.BI \-n\0 copies -Number of copies [1]. -.TP -.BI \-r\0 xres x yres -Set device resolution in pixels/inch [600x600]. -.TP -.BI \-s\0 source -Source (InputSlot) code to send to printer [0]. -.TS -| n l | n l. -0 auto select -1 tray1 2 tray2 -3 multi 4 manual -.TE -.TP -.BI \-t -Draft mode. Every other pixel is white. -.TP -.BI \-J\0 filename -Filename string to send to printer. -.TP -.BI \-U\0 username -Username string to send to printer. -.SS Printer Tweaking Options -These are the options used to customize the operation of \fBfoo2hiperc\fP -for a particular printer. -.TP -.BI \-u\0 xoff x yoff -Set the offset of the start of the printable region from the -upper left corner, in pixels [0x0]. -.TP -.BI \-l\0 xoff x yoff -Set the offset of the end of the printable region from the -lower right corner, in pixels [0x0]. -.TP -.BI \-L\0 mask -Send logical clipping amounts implied by -u/-l in the HIPERC stream [3]. -.TS -l l. -0 don't send any logical clipping amounts -1 only send Y clipping amount -2 only send X clipping amount -3 send both X and Y clipping amounts -.TE -.TP -.BI \-A -AllIsBlack: convert C=1,M=1,Y=1 to just K=1. Works with bitcmyk input only. -.TP -.BI \-B -BlackClears: K=1 forces C,M,Y to 0. Works with bitcmyk input only. -.TP -.BI \-Z\0 compressed -Use uncompressed (0) or compressed (1) JBIG data. -.SS Debugging Options -These options are used for debugging \fBfoo2hiperc\fP. -.TP -.BI \-S\0 plane -Output just a single color plane from a color print and print it -on the black plane. The default is to output all color planes. -.TS -l l. -1 Cyan -2 Magenta -3 Yellow -4 Black -.TE -.TP -.BI \-D\0 level -Set Debug level [0]. - -.SH EXAMPLES -Create a black and white HIPERC stream: - -.RS -.nf -gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE \ - -sPAPERSIZE=letter -r600x600 -sDEVICE=pbmraw \ - -sOutputFile=- - < testpage.ps \ -| foo2hiperc -r600x600 -g5100x6600 -p0 >testpage.zm -.fi -.RE -.P -Create a color HIPERC stream: - -.RS -.nf -gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE \ - -sPAPERSIZE=letter -g5100x6600 -r600x600 -sDEVICE=bitcmyk \ - -sOutputFile=- - < testpage.ps \ -| foo2hiperc -r600x600 -g5100x6600 -p0 >testpage.zc -.fi -.RE - -.SH FILES -.BR /usr/bin/foo2hiperc -.SH SEE ALSO -.BR foo2hiperc-wrapper (1), -.BR hipercdecode (1) -.SH "AUTHOR" -Rick Richardson -.br -http://foo2hiperc.rkkda.com/ -'\" -'\" -'\" -.em pdf_outline diff --git a/foo2hiperc.1in b/foo2hiperc.1in index 6496984..dca0143 100644 --- a/foo2hiperc.1in +++ b/foo2hiperc.1in @@ -11,13 +11,13 @@ foo2hiperc \- Convert Ghostscript pbmraw or bitcmyk format into a HIPERC printer stream .SH SYNOPSIS .B foo2hiperc -.RI [ options "] <" pbmraw-file " >" hiperc-file +.RI [ options "] <" pbmraw\-file " >" hiperc\-file .sp 1 .B foo2hiperc -.RI [ options "] <" bitcmyk-file " >" hiperc-file +.RI [ options "] <" bitcmyk\-file " >" hiperc\-file .sp 1 .B foo2hiperc -.RI [ options "] <" pksmraw-file " >" hiperc-file +.RI [ options "] <" pksmraw\-file " >" hiperc\-file .SH DESCRIPTION .B foo2hiperc converts Ghostscript pbmraw, bitcmyk, or pksmraw output formats to monochrome @@ -63,7 +63,7 @@ Paper code to send to printer [2]. box; | n l | n l. 1 A4 2 letter -3 legal - - +3 legal \- \- 5 A5 6 B5jis 7 A6 8 env Monarch 9 env DL 10 env C5 @@ -108,7 +108,7 @@ Set the offset of the end of the printable region from the lower right corner, in pixels [0x0]. .TP .BI \-L\0 mask -Send logical clipping amounts implied by -u/-l in the HIPERC stream [3]. +Send logical clipping amounts implied by \-u/-l in the HIPERC stream [3]. .TS l l. 0 don't send any logical clipping amounts @@ -147,10 +147,10 @@ Create a black and white HIPERC stream: .RS .nf -gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE \ - -sPAPERSIZE=letter -r600x600 -sDEVICE=pbmraw \ - -sOutputFile=- - < testpage.ps \ -| foo2hiperc -r600x600 -g5100x6600 -p0 >testpage.zm +gs \-q \-dBATCH \-dSAFER \-dQUIET \-dNOPAUSE \ + \-sPAPERSIZE=letter \-r600x600 \-sDEVICE=pbmraw \ + \-sOutputFile=- \- < testpage.ps \ +| foo2hiperc \-r600x600 \-g5100x6600 \-p0 >testpage.zm .fi .RE .P @@ -158,10 +158,10 @@ Create a color HIPERC stream: .RS .nf -gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE \ - -sPAPERSIZE=letter -g5100x6600 -r600x600 -sDEVICE=bitcmyk \ - -sOutputFile=- - < testpage.ps \ -| foo2hiperc -r600x600 -g5100x6600 -p0 >testpage.zc +gs \-q \-dBATCH \-dSAFER \-dQUIET \-dNOPAUSE \ + \-sPAPERSIZE=letter \-g5100x6600 \-r600x600 \-sDEVICE=bitcmyk \ + \-sOutputFile=- \- < testpage.ps \ +| foo2hiperc \-r600x600 \-g5100x6600 \-p0 >testpage.zc .fi .RE diff --git a/foo2hiperc.c b/foo2hiperc.c index 509028c..bb220ea 100644 --- a/foo2hiperc.c +++ b/foo2hiperc.c @@ -5,7 +5,7 @@ This program converts pbm (B/W) images and 1-bit-per-pixel cmyk images (both produced by ghostscript) to Zenographics ZJ-stream format. There is some information about the ZJS format at http://ddk.zeno.com. -With this utility, you can print to some HP printers, such as these: +With this utility, you can print to some Oki printers, such as these: - Oki C310dn, C3100, C3200, C3300n, C3400n, C5100n, C5500n AUTHORS @@ -31,8 +31,8 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +along with this program; if not, see +. If you want to use this program under different license conditions, then contact the author for an arrangement. @@ -48,7 +48,7 @@ yourself. */ -static char Version[] = "$Id: foo2hiperc.c,v 1.35 2013/12/01 20:13:58 rick Exp $"; +static char Version[] = "$Id: foo2hiperc.c,v 1.37 2019/05/17 21:55:07 rick Exp $"; #include #include @@ -1645,8 +1645,8 @@ main(int argc, char *argv[]) if (getenv("DEVICE_URI")) IsCUPS = 1; -if (getenv("ccc")) - Compressed = 1; + if (getenv("ccc")) + Compressed = 1; Bpp = ResX / 600; //ResX = 600; diff --git a/foo2hp b/foo2hp deleted file mode 100755 index fa9d112..0000000 Binary files a/foo2hp and /dev/null differ diff --git a/foo2hp.1 b/foo2hp.1 deleted file mode 100644 index b835d25..0000000 --- a/foo2hp.1 +++ /dev/null @@ -1,380 +0,0 @@ -'\" t -'\" -'\" DO NOT EDIT! This file is generated from foo2hp.1in -'\" -'\" t -.TH foo2hp 1 "Sun May 26 18:25:20 2024" "foo2hp 0.0" -'\" -'\" -'\"========================================================================== -'\" STRINGS and MACROS -'\"========================================================================== -'\" -'\" Define strings for special characters that nroff doesn't have -'\" -'\" N.B. using .if cua to test for special characters did not work. -'\" -.if !'\*[.T]'ps' .ds ua up -.if '\*[.T]'ps' .ds ua \(ua -.if !'\*[.T]'ps' .ds da down -.if '\*[.T]'ps' .ds da \(da -.if !'\*[.T]'ps' .ds <- left -.if '\*[.T]'ps' .ds <- \(<- -.if !'\*[.T]'ps' .ds -> right -.if '\*[.T]'ps' .ds -> \(-> -'\" -'\" bx - box a Courier string for making keycaps -'\" -'\" N.B. this mess is to make the line drawing come out only -'\" if we are really generating postscript -'\" -.de bx -.ie !'\*[.T]'ps' \{\ -. RB [ \\$1 ]\\$2 -.\} -.el \{\ -. ie !r ps4html \{\ -'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul' -. ft CW -. nr par*bxw \w'\\$1'+.4m -\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\ -\Z'\h'.2m'\s-1\\$1\s+1'\ -\h'\\n[par*bxw]u'\\$2 -. ft P -. \} -. el \{\ -. RB [ \\$1 ]\\$2 -. \} -.\} -.. -'\" -'\" strings to set current color (null with old groff) -'\" -.if mred .ds red \m[red] -.if mgreen .ds green \m[green] -.if mblue .ds blue \m[blue] -.if mblack .ds black \m[black] -.if mblack .ds mP \mP -'\" -'\" fix for grotty + xterm. We call for orange, grotty outputs yellow, -'\" but xterm displays yellow as orange. The cycle is complete. -'\" -.if n .defcolor orange rgb #ffff00 -'\" -'\" color - set the current color (ignores request with old groff) -'\" -.de color -.if mred \m[\\$1]\c -.. -'\" -'\" colorword - colorize a word (ignored by old groff) -'\" -.de colorword -.ie m\\$1 \m[\\$1]\\$2\mP\c -.el \\$2\c -.. -'\" -'\" colbox - colorize a word in a filled box -'\" -.de colbox -.ie mred \M[\\$2]\ -\v'+.167v'\ -\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\ -\v'-.167v'\ -\m[\\$1]\\$3\mP\MP -.el \\$3\c -.. -'\" -'\" Macros for doing pdfmarks -'\" -.de specialps -.if '\*[.T]'ps' \\k_\X'ps: \\$*'\h'|\\n_u'\c -.. -'\" -'\" pdfmark PDFMARKCODE -'\" -.ds pdfmarks -.if d pdfmarks \{\ -.de pdfmark -. specialps exec [\\$1 pdfmark -.. -'\" -'\" pdfdest LINKNAME -'\" -.de pdfdest -.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST" -.. -'\" -'\" pdfbookmark COUNT LINKNAME STRING -'\" -.de pdfbookmark -. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT" -.. -'\" -'\" Define the SH and SS macros to save pdfmark information -'\" in "arrays" of numbers and strings. -'\" -.if !r rr_n \{\ -.nr rr_n 0 1 -.am SH -. nr rr_levels!\\n+[rr_n] 2 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.am SS -. nr rr_levels!\\n+[rr_n] 3 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.\} -'\" -'\" Called at the end of the document to generate the pdfmark outline -'\" -.de pdf_outline -.nr rr_levels!\\n+[rr_n] 1 -.nr rr_i 0 1 -.while \\n+[rr_i]<\\n[rr_n] \{\ -. nr rr_ip1 \\n[rr_i]+1 -. nr rr_count 0 -. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\ -. nr rr_j \\n[rr_i] 1 -. while \\n+[rr_j]<\\n[rr_n] \{\ -. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\ -. break -. \} -. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\ -. nr rr_count \\n[rr_count]+1 -. \} -. \} -. \} -. ds hhh \\*[rr_labels!\\n[rr_i]] -. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]" -.\} -.. -'\" -'\" Some postscript to make pdfmarks harmless on old interpreters... -'\" -.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse" -'\" -'\" Force display of Bookmarks in Acrobat when document is viewed. -'\" -.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW" -'\" -'\" Output the document info in pdfmarks -'\" -.pdfmark "\ - /Title (\*[an-title](\*[an-section])) \ - /Subject (\*[an-title] Manual Page) \ - /Author (Rick Richardson) \ - /Keywords (printing) \ - /Creator (groff \n(.x.\n(.y.\n(.Y -man) \ - /CreationDate (\*[an-extra1]) \ - /ModDate (\*[an-extra1]) \ - /DOCINFO" -\} -'\" -'\" The manual page name is only 1st level mark -'\" -.nr rr_levels!\n+[rr_n] 1 -.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section]) -.pdfdest Link\n[rr_n] -'\" -'\"========================================================================== -'\" MANUAL PAGE SOURCE -'\"========================================================================== -.SH NAME -foo2hp \- Convert Ghostscript pbmraw or bitcmyk format into a -ZJS printer stream -.SH SYNOPSIS -.B foo2hp -.RI [ options "] <" pbmraw-file " >" zjs-file -.sp 1 -.B foo2hp -.RI [ options "] <" bitcmyk-file " >" zjs-file -.sp 1 -.B foo2hp -.RI [ options "] <" cups-file " >" zjs-file -.SH DESCRIPTION -.B foo2hp -converts Ghostscript pbmraw, bitcmyk, or cups output formats to monochrome -or color ZJS streams, -for driving the Hewlett-Packard 2600n color laser printer -and other Zenographics-based printers. - -.SH COMMAND LINE OPTIONS -.SS Normal Options -These are the options used to select the parameters of a -print job that are usually controlled on a per job basis. -.TP -.BI \-b\0 bits -Bits per plane if autodetect doesn't work (1 or 2) [1]. -.TP -.BI \-c -Force color mode if autodetect doesn't work. -.TP -.BI \-d\0 duplex -Duplex code to send to printer [1]. -.TS -| n l | n l | n l . -1 off 2 long edge 3 short edge -.TE -.TP -.BI \-g\0 xpix x ypix -Set page dimensions in pixels [10200x6600]. -.TP -.BI \-m\0 media -Media code to send to printer [1]. -.TS -l l -l n. -_ -Media HPLJ 2600n -_ -plain 1 -preprinted 514 -letterhead 513 -transparency 2 -prepunched 515 -labels 265 -bond 260 -recycled 516 -color 512 -tough 276 -envelope 267 -light 258 -heavy 262 -cardstock 261 -lightglossy 268 -glossy 269 -heavyglossy 270 -cover 277 -photo 278 -.TE -.TP -.BI \-p\0 paper -Paper code to send to printer [1]. -.TS -box; -| n l | n l. -1 letter 9 A4 -5 legal 11 A5 -7 executive 13 B5jis -20 env #10 27 env DL -28 env C5 34 env B5 -37 env Monarch -.TE -.TP -.BI \-n\0 copies -Number of copies [1]. -.TP -.BI \-r\0 xres x yres -Set device resolution in pixels/inch [600x600]. -.TP -.BI \-s\0 source -Source (InputSlot) code to send to printer [7]. -.TS -| n l | n l. -1 tray 2 7 auto -2 tray 1 -.TE -.TP -.BI \-t -Draft mode. Every other pixel is white. -.TP -.BI \-J\0 filename -Filename string to send to printer. -.TP -.BI \-U\0 username -Username string to send to printer. -.SS Printer Tweaking Options -These are the options used to customize the operation of \fBfoo2hp\fP -for a particular printer. -.TP -.BI \-u\0 xoff x yoff -Set the offset of the start of the printable region from the -upper left corner, in pixels [0x0]. -.TP -.BI \-l\0 xoff x yoff -Set the offset of the end of the printable region from the -lower right corner, in pixels [0x0]. -.TP -.BI \-L\0 mask -Send logical clipping amounts implied by -u/-l in the ZjStream [3]. -.TS -l l. -0 don't send any logical clipping amounts -1 only send Y clipping amount -2 only send X clipping amount -3 send both X and Y clipping amounts -.TE -.TP -.BI \-O\0 c,m,y,k -Alignment of CMYK in rows. The default is 0,0,0,0. -.TP -.BI \-P -Do not send START_PLANE codes on monochrome output. May be -needed by some black and white only printers, such as the -HP LaserJet 1000. -.TP -.BI \-A -AllIsBlack: convert C=1,M=1,Y=1 to just K=1. Works with bitcmyk input only. -.TP -.BI \-B -BlackClears: K=1 forces C,M,Y to 0. Works with bitcmyk input only. -.TP -.BI \-X\0 padlen -Add extra zero padding to the end of BID segments. The default is -16 bytes. -.SS Debugging Options -These options are used for debugging \fBfoo2hp\fP. -.TP -.BI \-S\0 plane -Output just a single color plane from a color print and print it -on the black plane. The default is to output all color planes. -.TS -l l. -1 Cyan -2 Magenta -3 Yellow -4 Black -.TE -.TP -.BI \-D\0 level -Set Debug level [0]. - -.SH EXAMPLES -Create a black and white ZJS stream: - -.RS -.nf -gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE \ - -sPAPERSIZE=letter -r600x600 -sDEVICE=pbmraw \ - -sOutputFile=- - < testpage.ps \ -| foo2hp -r600x600 -g5100x6600 -p1 >testpage.zm -.fi -.RE -.P -Create a color ZJS stream: - -.RS -.nf -gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE \ - -sPAPERSIZE=letter -g5100x6600 -r600x600 -sDEVICE=bitcmyk \ - -sOutputFile=- - < testpage.ps \ -| foo2hp -r600x600 -g5100x6600 -p1 >testpage.zc -.fi -.RE - -.SH FILES -.BR /usr/bin/foo2hp -.SH SEE ALSO -.BR foo2hp2600-wrapper (1), -.BR zjsdecode (1) -.SH "AUTHOR" -Rick Richardson -.br -http://foo2hp.rkkda.com/ -'\" -'\" -'\" -.em pdf_outline diff --git a/foo2hp.1in b/foo2hp.1in index d037311..f4e5e49 100644 --- a/foo2hp.1in +++ b/foo2hp.1in @@ -123,7 +123,7 @@ Set the offset of the end of the printable region from the lower right corner, in pixels [0x0]. .TP .BI \-L\0 mask -Send logical clipping amounts implied by -u/-l in the ZjStream [3]. +Send logical clipping amounts implied by \-u/-l in the ZjStream [3]. .TS l l. 0 don't send any logical clipping amounts @@ -171,10 +171,10 @@ Create a black and white ZJS stream: .RS .nf -gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE \ - -sPAPERSIZE=letter -r600x600 -sDEVICE=pbmraw \ - -sOutputFile=- - < testpage.ps \ -| foo2hp -r600x600 -g5100x6600 -p1 >testpage.zm +gs \-q \-dBATCH \-dSAFER \-dQUIET \-dNOPAUSE \ + \-sPAPERSIZE=letter \-r600x600 \-sDEVICE=pbmraw \ + \-sOutputFile=- \- < testpage.ps \ +| foo2hp \-r600x600 \-g5100x6600 \-p1 >testpage.zm .fi .RE .P @@ -182,10 +182,10 @@ Create a color ZJS stream: .RS .nf -gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE \ - -sPAPERSIZE=letter -g5100x6600 -r600x600 -sDEVICE=bitcmyk \ - -sOutputFile=- - < testpage.ps \ -| foo2hp -r600x600 -g5100x6600 -p1 >testpage.zc +gs \-q \-dBATCH \-dSAFER \-dQUIET \-dNOPAUSE \ + \-sPAPERSIZE=letter \-g5100x6600 \-r600x600 \-sDEVICE=bitcmyk \ + \-sOutputFile=- \- < testpage.ps \ +| foo2hp \-r600x600 \-g5100x6600 \-p1 >testpage.zc .fi .RE diff --git a/foo2hp.c b/foo2hp.c index 297635d..0f73451 100644 --- a/foo2hp.c +++ b/foo2hp.c @@ -25,8 +25,8 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +along with this program; if not, see +. If you want to use this program under different license conditions, then contact the author for an arrangement. diff --git a/foo2hp2600-wrapper b/foo2hp2600-wrapper deleted file mode 100755 index c63e183..0000000 --- a/foo2hp2600-wrapper +++ /dev/null @@ -1,819 +0,0 @@ -#!/bin/sh - -#* Copyright (C) 2005-2006 Rick Richardson -#* -#* This program is free software; you can redistribute it and/or modify -#* it under the terms of the GNU General Public License as published by -#* the Free Software Foundation; either version 2 of the License, or -#* (at your option) any later version. -#* -#* This program is distributed in the hope that it will be useful, -#* but WITHOUT ANY WARRANTY; without even the implied warranty of -#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -#* GNU General Public License for more details. -#* -#* You should have received a copy of the GNU General Public License -#* along with this program; if not, write to the Free Software -#* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#* -#* Authors: Rick Richardson - -VERSION='$Id: foo2hp2600-wrapper.in,v 1.77 2011/01/20 00:59:57 rick Exp $' - -# -# Printer Notes: -# -# HP Color LaserJet 1600: -z0 -# HP Color LaserJet 2600n: -z0 -# HP Color LaserJet CP1215: -z1 -# - -PROGNAME="$0" -BASENAME=`basename $PROGNAME` -PREFIX=/usr -SHARE=$PREFIX/share/foo2hp -PATH=$PATH:/sw/bin:/opt/local/bin - -# -# Log the command line, for debugging and problem reports -# -if [ -x /usr/bin/logger -o -x /bin/logger ]; then - logger -t "$BASENAME" -p lpr.info -- "$BASENAME $@" x Set device resolution in pixels/inch [$RES] --s source Source code to send to printer [$SOURCE] - 1=tray2, 2=tray3, 4=manual/tray1, 7=auto - Code numbers may vary with printer model. --t Draft mode. Every other pixel is white. --2/-3/-4/-6/-8/-10/-12/-14/-15/-16/-18 - Print with N-up (requires psutils) --o orient For N-up: -op is portrait, -ol is landscape, -os is seascape. - -Printer Tweaking Options: --u x Set offset of upper left printable in pixels [varies] --l x Set offset of lower right printable in pixels [varies] --L mask Send logical clipping values from -u/-l in ZjStream [3] - 0=no, 1=Y, 2=X, 3=XY --P Do not output START_PLANE codes. May be needed by some - monochrome-only printers. --X padlen Add extra zero padding to the end of BID segments [16] --z model Model: 0=HP CLJ 1600/2600n; 1=HP CLJ CP1215 [$MODEL] --O parm=val Alignment of CMYK. "parm" is c,m,y, or k. "val" is in rows. - -Color Tweaking Options: --g gsopts Additional options to pass to Ghostscript, such as - -dDITHERPPI=nnn, etc. May appear more than once. [] --G profile.icm Convert profile.icm to a Postscript CRD using icc2ps and - adjust colors using the setcolorrendering PS operator. - $SHARE/icm/ will be searched for profile.icm. --I intent Select profile intent from ICM file [$INTENT] - 0=Perceptual, 1=Colorimetric, 2=Saturation, 3=Absolute --G gamma-file.ps Prepend gamma-file to the Postscript input to perform - color correction using the setcolortransfer PS operator. - -Debugging Options: --S plane Output just a single color plane from a color print [all] - 1=Cyan, 2=Magenta, 3=Yellow, 4=Black --D lvl Set Debug level [$DEBUG] --V $VERSION -EOF - - exit 1 -} - -# -# Report an error and exit -# -error() { - echo "$BASENAME: $1" >&2 - exit 1 -} - -dbgcmd() { - if [ $DEBUG -ge 1 ]; then - echo "$@" >&2 - fi - "$@" -} - -# -# Portable version of 'which' -# -pathfind() { - if [ "$1" = -p ]; then - optp=1 - shift - else - optp=0 - fi - OLDIFS="$IFS" - IFS=: - for p in $PATH; do - if [ -x "$p/$*" ]; then - if [ $optp = 1 ]; then - echo "$p/$*" - fi - IFS="$OLDIFS" - return 0 - fi - done - IFS="$OLDIFS" - return 1 -} - -# -# Returns true if $1 is 32-bit binary -# -is32() { - if pathfind file; then - path=`pathfind -p "$*"` - is32=`file -L "$path" | grep 32-bit` - if [ "$is32" = "" ]; then - return 1 - else - return 0 - fi - else - return 1 - fi -} - -# -# N-up-ify the job. Requires psnup from psutils package -# -nup() { - case "$NUP" in - [2368]|1[0458]) - tr '\r' '\n' | psnup $NUP_ORIENT -d2 -$NUP -m.3in -p$paper -q - ;; - [49]|1[26]) - tr '\r' '\n' | psnup $NUP_ORIENT -d2 -$NUP -m.5in -p$paper -q - ;; - *) - error "Illegal call to nup()." - ;; - esac -} - -# -# Process the options -# - -# Try to use a local copy of GhostScript 8.54, if available. Otherwise, -# fallback to whatever the Linux distro has installed (usually 7.07) -# -# N.B. := operator used here, when :- would be better, because "ash" -# doesn't have :- -if eval gs.foo -v >/dev/null 2>&1; then - GSBIN=${GSBIN:-gs.foo} -else - GSBIN=${GSBIN:-gs} -fi - -CMDLINE="$*" -DEBUG=0 -DUPLEX=1 -BPP=1 -COLOR= -COLORMODE=default -MODEL=0 -QUALITY=1 -QUALITY=wts -MEDIA=1 -COPIES=1 -PAPER=1 -RES=600x600 -SOURCE=7 -NUP= -CLIP_UL= -CLIP_LR= -CLIP_LOG= -BC= -AIB= -NOPLANES= -COLOR2MONO= -GAMMAFILE=default -INTENT=0 -GSOPTS= -EXTRAPAD= -SAVETONER= -NUP_ORIENT= -OFF_C=0 -OFF_M=0 -OFF_Y=0 -OFF_K=0 -GSDEV=-sDEVICE=pbmraw -SEGFAULT=0 -# What mode to use if the user wants us to pick the "best" mode -case `$GSBIN --version` in -7*) - DEFAULTCOLORMODE=10 - ;; -8.1*) - # Buggy 8.14/8.15 in Ubuntu - DEFAULTCOLORMODE=10 - if is32 $GSBIN; then - GAMMAFILE=km2430_2.icm - else - GAMMAFILE=hpclj2600n-0.icm - SEGFAULT=1 - fi - QUALITY=1 - ;; -*) - DEFAULTCOLORMODE=10 - ;; -esac - -while getopts "1:23456789o:b:cC:d:g:l:u:L:m:n:p:q:r:s:tz:ABS:D:G:I:PO:X:Vh?-" opt -do - case $opt in - b) BPP="$OPTARG";; - c) COLOR=-c;; - d) DUPLEX="$OPTARG";; - g) GSOPTS="$GSOPTS $OPTARG";; - m) MEDIA="$OPTARG";; - n) COPIES="$OPTARG";; - p) PAPER="$OPTARG";; - q) QUALITY="$OPTARG";; - r) RES="$OPTARG";; - s) SOURCE="$OPTARG";; - t) SAVETONER="-t";; - z) MODEL="$OPTARG";; - l) CLIP_LR="-l $OPTARG";; - u) CLIP_UL="-u $OPTARG";; - L) CLIP_LOG="-L $OPTARG";; - A) AIB=-A;; - B) BC=-B;; - C) COLORMODE="$OPTARG";; - S) COLOR2MONO="-S$OPTARG";; - D) DEBUG="$OPTARG";; - G) GAMMAFILE="$OPTARG";; - I) INTENT="$OPTARG";; - O) case "$OPTARG" in - c=*|C=*) OFF_C=`echo "$OPTARG" | sed "s/^..//"`;; - m=*|M=*) OFF_M=`echo "$OPTARG" | sed "s/^..//"`;; - y=*|Y=*) OFF_Y=`echo "$OPTARG" | sed "s/^..//"`;; - k=*|K=*) OFF_K=`echo "$OPTARG" | sed "s/^..//"`;; - *) error "Not [cmyk]=NUM!";; - esac - ;; - P) NOPLANES=-P;; - X) EXTRAPAD="-X $OPTARG";; - [234689]) NUP="$opt";; - [57]) error "Can't find acceptable layout for $opt-up";; - 1) case "$OPTARG" in - [024568]) NUP="1$OPTARG";; - *) error "Can't find acceptable layout for 1$OPTARG-up";; - esac - ;; - o) case "$OPTARG" in - l*) NUP_ORIENT=-l;; - s*) NUP_ORIENT=-r;; - p*|*) NUP_ORIENT=;; - esac;; - -) - echo aaa - echo "$OPTARG"; - ;; - V) echo "$VERSION"; foo2hp -V; foo2zjs-pstops -V; exit 0;; - h|\?) - if [ "$CMDLINE" != "-?" -a "$CMDLINE" != -h ]; then - echo "Illegal command:" - echo " $0 $CMDLINE" - echo - fi - usage;; - esac -done -shift `expr $OPTIND - 1` - -# -# If there is an argument left, take it as the file to print. -# Else, the input comes from stdin. -# -if [ $# -ge 1 ]; then - if [ "$LPJOB" = "" ]; then - : # LPJOB="$1" - fi - exec < $1 -fi - - -# -# Select the ghostscript device to use -# -case "$BPP" in -1) if [ "" = "$COLOR" ]; then - GSDEV=-sDEVICE=pbmraw - else - GSDEV=-sDEVICE=bitcmyk - fi - case "$GAMMAFILE" in - default) - case "$MODEL" in - 0) - if [ $SEGFAULT = 0 ]; then - GAMMAFILE=hpclj2600n-1.icm - else - GAMMAFILE=hpclj2600n-0.icm - fi - ;; - 1) - GAMMAFILE=hp1215-argyll-0.icm - ;; - esac - ;; - none) GAMMAFILE=;; - esac - ;; -2) if [ "" = "$COLOR" ]; - then - # GSDEV=-sDEVICE=pgmraw - # error "2-bpp monochrome is not yet supported" - GSDEV="-sDEVICE=cups -dcupsColorSpace=3 -dcupsBitsPerColor=2" - GSDEV="$GSDEV -dcupsColorOrder=2" - else - GSDEV="-sDEVICE=cups -dcupsColorSpace=6 -dcupsBitsPerColor=2" - GSDEV="$GSDEV -dcupsColorOrder=2" - fi - if [ $GSBIN = "gs.foo" ]; then - GSBIN=gs - fi - - case "$GAMMAFILE" in - default) - case "$MODEL" in - 0) - if is32 $GSBIN; then - GAMMAFILE=km2430_2.icm - GAMMAFILE=hpclj2600n-1.icm - else - GAMMAFILE= - fi - ;; - 1) - GAMMAFILE=hp1215-argyll-0.icm - ;; - esac - ;; - none) GAMMAFILE=;; - esac - ;; -*) error "Illegal number of bits per plane ($BPP)";; -esac - -# -# Validate model code -# -case "$MODEL" in -0|1) ;; -*) error "Unknown model code $MODEL";; -esac - -# -case "$QUALITY" in -0) - GSOPTS="-dCOLORSCREEN $GSOPTS" - ;; -1) - GSOPTS="-dCOLORSCREEN $GSOPTS" - ;; -2) - GSOPTS="-dMaxBitmap=500000000 $GSOPTS" - ;; -as) - GSOPTS="-dCOLORSCREEN -dMaxBitmap=500000000 $GSOPTS" - ;; -wts) - GSOPTS="-dCOLORSCREEN -dMaxBitmap=500000000 $GSOPTS" - ;; -esac - -# -# Validate media code -# -case "$MEDIA" in -1|plain) MEDIA=1;; -514|preprinted) MEDIA=514;; -513|letterhead) MEDIA=513;; -2|transparency) MEDIA=2;; -515|prepunched) MEDIA=515;; -265|labels) MEDIA=265;; -260|bond) MEDIA=260;; -516|recycled) MEDIA=516;; -512|color) MEDIA=512;; -276|tough) MEDIA=276;; -267|envelope) MEDIA=267;; -258|light) MEDIA=258;; -262|heavy) MEDIA=262;; -261|cardstock) MEDIA=261;; -268|lightglossy) MEDIA=268;; -269|glossy) MEDIA=269;; -270|heavyglossy) MEDIA=270;; -277|cover) MEDIA=277;; -278|photo) MEDIA=278;; -[0-9]*) ;; -*) error "Unknown media code $MEDIA";; -esac - -# -# Validate source (InputSlot) code -# -case "$SOURCE" in -1|tray2) SOURCE=1;; -4|tray1) SOURCE=4;; -7|auto) SOURCE=7;; -[0-9]*) ;; -*) error "Unknown source code $SOURCE";; -esac - -# -# Validate Duplex code -# -case "$DUPLEX" in -1|off|none) DUPLEX=1;; -2|long*) DUPLEX=2;; -3|short*) DUPLEX=3;; -[0-9]*) ;; -*) error "Unknown duplex code $DUPLEX";; -esac - -# -# Validate Resolution -# -case "$RES" in -600x600) ;; -1200x600) ;; -2400x600) ;; -*) error "Illegal resolution $RES";; -esac - -# -# 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" in -Custom*x*) - # Command line only - XDIM=`echo "$PAPER" | sed -e "s/Custom.//" -e "s/x.*//" ` - YDIM=`echo "$PAPER" | sed -e "s/.*x//" ` - if [ "$XDIM" = "" -o "$YDIM" = "" ]; then - error "Custom page size '$PAPER' != 1-99999" - fi - if [ "$XDIM" -eq 0 -o "$YDIM" -eq 0 ]; then - error "Custom page size '$PAPER' != 1-99999" - fi - XDIM=`dc -e "$XDIM 1200* 72/p"` - YDIM=`dc -e "$YDIM 600* 72/p"` - PAPER=1; paper=letter; - set_clipping 2 80 2 80 - ;; -Custom*) - #%%BeginFeature: *CustomPageSize True - #216 - #360 - #0 - #0 - #0 - #pop pop pop pop pop - - #%%BeginFeature: *CustomPageSize True - #792.000000 612.000000 1 0.000000 0.000000 - #pop pop pop pop pop - - if [ $DEBUG = 0 ]; then - TMPFILE=/tmp/cus$$ - else - TMPFILE=/tmp/custom.ps - fi - cat >$TMPFILE - exec <$TMPFILE - - tmp=`head -n 10000 $TMPFILE \ - | sed -n '/CustomPageSize/{n;p;n;p;}' \ - | tr '\n' ' '` - case "$tmp" in - [0-9]*\ [0-9]*) - XDIM=`echo "$tmp" | sed 's/ .*//'` - YDIM=`echo "$tmp" | sed -e 's/^[^ ]* //' -e 's/ .*//'` - ;; - *) - if [ $DEBUG = 0 ]; then rm -f $TMPFILE; fi - error "Custom page size [XY]DIM != 1-99999" - ;; - esac - XDIM=`dc -e "$XDIM 1200* 72/p"` - YDIM=`dc -e "$YDIM 600* 72/p"` - PAPER=1; paper=letter; - set_clipping 2 80 2 80 - ;; -1|letter) PAPER=1; paper=letter; XDIM="10200"; YDIM="6600" - set_clipping 172 80 172 80 - ;; -5|legal) PAPER=5; paper=legal; XDIM="10200"; YDIM="8400" - set_clipping 172 80 172 80 - ;; -7|executive) PAPER=7; paper=executive; XDIM="8700"; YDIM="6300" - set_clipping 174 78 174 78 - ;; -9|a4|A4) PAPER=9; paper=a4; XDIM="9920"; YDIM="7016" - set_clipping 176 84 176 84 - ;; -11|a5|A5) PAPER=11; paper=a5; XDIM="6992"; YDIM="4960" - set_clipping 176 80 176 80 - ;; -13|b5|B5|b5jis) PAPER=13; paper=b5; XDIM="8598"; YDIM="6070" - set_clipping 172 83 171 83 - ;; -20|"env#10") PAPER=20; paper=env10; XDIM="4950"; YDIM="5700" - set_clipping 171 78 171 78 - ;; -27|envDL) PAPER=27; paper=envDL; XDIM="5200"; YDIM="5200" - set_clipping 176 84 176 84 - ;; -28|envC5) PAPER=28; paper=envC5; XDIM="7650"; YDIM="5408" - set_clipping 170 80 169 80 - ;; -34|envB5) PAPER=34; paper=envB5; XDIM="8316"; YDIM="5892" - set_clipping 174 74 174 74 - ;; -37|envMonarch) PAPER=37; paper=envMonarch;XDIM="4650"; YDIM="4500" - set_clipping 174 78 173 78 - ;; -*) error "Unimplemented paper code $PAPER";; -esac -# e.g. /usr/share/ghostscript/7.07/lib/gs_statd.ps -PAPERSIZE="-sPAPERSIZE=$paper"; - -case "$RES" in -600x600) XDIM=`expr $XDIM / 2`;; -1200x600) ;; -2400x600) XDIM=`expr $XDIM \* 2`;; -esac -DIM="${XDIM}x${YDIM}" - -# -# Filter thru psnup if N-up printing has been requested -# -case $NUP in -[234689]|1[024568]) PREFILTER="nup";; -*) PREFILTER=cat;; -esac -if [ "$DEBUG" -ge 9 ]; then - PREFILTER="tee /tmp/$BASENAME.ps" -fi - -# -# 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.icm | */none.icm) - ;; - *) - if [ -x /usr/bin/logger ]; then - logger -t "$BASENAME" -p lpr.info -- \ - "`basename $ICC2PS` -o $GAMMAFILE -t$INTENT > $ICCTMP.crd.ps" - fi - $ICC2PS -o $GAMMAFILE -t$INTENT > $ICCTMP.crd.ps 2>$ICCTMP.log \ - || error "Problem converting .ICM file to Postscript" - ;; - esac - - PSTOPS_OPTS="$PSTOPS_OPTS -c" - cat > $ICCTMP.usecie.ps <<-EOF - %!PS-Adobe-3.0 - <>setpagedevice - EOF - if [ "$QUALITY" = wts -o "$QUALITY" = as ]; then - if [ "$QUALITY" = wts ]; then - cat >> $ICCTMP.usecie.ps <<-EOF - << /UseWTS true >> setuserparams - EOF - else - cat >> $ICCTMP.usecie.ps <<-EOF - << /UseWTS false >> setuserparams - EOF - fi - cat >> $ICCTMP.usecie.ps <<-EOF - << - /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.icm | */none.icm) GAMMAFILE="$ICCTMP.usecie.ps";; - *) GAMMAFILE="$ICCTMP.usecie.ps $ICCTMP.crd.ps $ICCTMP.selcrd.ps";; - esac - else - GAMMAFILE= - fi -} - -if [ $DEBUG -gt 0 ]; then - ICCTMP=/tmp/icc -else - ICCTMP=/tmp/icc$$ -fi - -if [ "" = "$COLOR" ]; then - COLORMODE= - GAMMAFILE= -else - case "$COLORMODE" in - default) COLORMODE=$DEFAULTCOLORMODE;; - esac -fi - -CRDBASE="$PREFIX/share/foo2zjs/crd" -PSFILES="$PREFIX/share/foo2hp/psfiles" -case "$RES" in - 600x600) SCREEN=screen1200.ps;; - 1200x600) SCREEN=screen1200.ps;; - 2400x600) SCREEN=screen2400.ps;; -esac - -PSTOPS_OPTS="-n" - -case "$COLORMODE" in -0|"") - # Monochrome - ;; -10|icm) - # Use old ICM method - AIB=-A - BC=-B - case "$GAMMAFILE" in - 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 - ;; -*.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'" - ;; -esac - -if [ "$COLOR" != "" -a "$QUALITY" = wts ]; then - PSTOPS_OPTS="$PSTOPS_OPTS -w" -elif [ "$COLOR" != "" -a "$QUALITY" = as ]; then - PSTOPS_OPTS="$PSTOPS_OPTS -a" -fi - -if [ "" != "$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 - fi -fi - -# -# 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. -# -# CUPS also does grief by adding its own PS code to the input file. -# We take care of that with the sed command. Thus, Well Tempered -# Screening now works! -# -GS="$GSBIN -q -dBATCH -dSAFER -dQUIET -dNOPAUSE" - -foo2zjs-pstops $PSTOPS_OPTS | \ -$PREFILTER \ -| ($GS $PAPERSIZE -g$DIM -r$RES $GSDEV $GSOPTS \ - -sOutputFile="|cat 1>&3" $GAMMAFILE -_ >/dev/null 2>&1) 3>&1 \ -| foo2hp -r$RES -g$DIM -p$PAPER -m$MEDIA -n$COPIES -d$DUPLEX -s$SOURCE \ - $COLOR -b$BPP $CLIP_UL $CLIP_LR $CLIP_LOG $SAVETONER \ - -O$OFF_C,$OFF_M,$OFF_Y,$OFF_K -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 -- \ - "foo2hp -r$RES -g$DIM -p$PAPER -m$MEDIA \ --n$COPIES -d$DUPLEX -s$SOURCE $COLOR -b$BPP $CLIP_UL $CLIP_LR $CLIP_LOG \ -$SAVETONER -O$OFF_C,$OFF_M,$OFF_Y,$OFF_K $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 -fi - -exit 0 diff --git a/foo2hp2600-wrapper.1 b/foo2hp2600-wrapper.1 deleted file mode 100644 index c2104b4..0000000 --- a/foo2hp2600-wrapper.1 +++ /dev/null @@ -1,417 +0,0 @@ -'\" t -'\" -'\" DO NOT EDIT! This file is generated from foo2hp2600-wrapper.1in -'\" -'\" t -.TH foo2hp2600-wrapper 1 "Sun May 26 18:25:20 2024" "foo2hp2600-wrapper 0.0" -'\" -'\" -'\"========================================================================== -'\" STRINGS and MACROS -'\"========================================================================== -'\" -'\" Define strings for special characters that nroff doesn't have -'\" -'\" N.B. using .if cua to test for special characters did not work. -'\" -.if !'\*[.T]'ps' .ds ua up -.if '\*[.T]'ps' .ds ua \(ua -.if !'\*[.T]'ps' .ds da down -.if '\*[.T]'ps' .ds da \(da -.if !'\*[.T]'ps' .ds <- left -.if '\*[.T]'ps' .ds <- \(<- -.if !'\*[.T]'ps' .ds -> right -.if '\*[.T]'ps' .ds -> \(-> -'\" -'\" bx - box a Courier string for making keycaps -'\" -'\" N.B. this mess is to make the line drawing come out only -'\" if we are really generating postscript -'\" -.de bx -.ie !'\*[.T]'ps' \{\ -. RB [ \\$1 ]\\$2 -.\} -.el \{\ -. ie !r ps4html \{\ -'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul' -. ft CW -. nr par*bxw \w'\\$1'+.4m -\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\ -\Z'\h'.2m'\s-1\\$1\s+1'\ -\h'\\n[par*bxw]u'\\$2 -. ft P -. \} -. el \{\ -. RB [ \\$1 ]\\$2 -. \} -.\} -.. -'\" -'\" strings to set current color (null with old groff) -'\" -.if mred .ds red \m[red] -.if mgreen .ds green \m[green] -.if mblue .ds blue \m[blue] -.if mblack .ds black \m[black] -.if mblack .ds mP \mP -'\" -'\" fix for grotty + xterm. We call for orange, grotty outputs yellow, -'\" but xterm displays yellow as orange. The cycle is complete. -'\" -.if n .defcolor orange rgb #ffff00 -'\" -'\" color - set the current color (ignores request with old groff) -'\" -.de color -.if mred \m[\\$1]\c -.. -'\" -'\" colorword - colorize a word (ignored by old groff) -'\" -.de colorword -.ie m\\$1 \m[\\$1]\\$2\mP\c -.el \\$2\c -.. -'\" -'\" colbox - colorize a word in a filled box -'\" -.de colbox -.ie mred \M[\\$2]\ -\v'+.167v'\ -\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\ -\v'-.167v'\ -\m[\\$1]\\$3\mP\MP -.el \\$3\c -.. -'\" -'\" Macros for doing pdfmarks -'\" -.de specialps -.if '\*[.T]'ps' \\k_\X'ps: \\$*'\h'|\\n_u'\c -.. -'\" -'\" pdfmark PDFMARKCODE -'\" -.ds pdfmarks -.if d pdfmarks \{\ -.de pdfmark -. specialps exec [\\$1 pdfmark -.. -'\" -'\" pdfdest LINKNAME -'\" -.de pdfdest -.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST" -.. -'\" -'\" pdfbookmark COUNT LINKNAME STRING -'\" -.de pdfbookmark -. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT" -.. -'\" -'\" Define the SH and SS macros to save pdfmark information -'\" in "arrays" of numbers and strings. -'\" -.if !r rr_n \{\ -.nr rr_n 0 1 -.am SH -. nr rr_levels!\\n+[rr_n] 2 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.am SS -. nr rr_levels!\\n+[rr_n] 3 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.\} -'\" -'\" Called at the end of the document to generate the pdfmark outline -'\" -.de pdf_outline -.nr rr_levels!\\n+[rr_n] 1 -.nr rr_i 0 1 -.while \\n+[rr_i]<\\n[rr_n] \{\ -. nr rr_ip1 \\n[rr_i]+1 -. nr rr_count 0 -. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\ -. nr rr_j \\n[rr_i] 1 -. while \\n+[rr_j]<\\n[rr_n] \{\ -. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\ -. break -. \} -. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\ -. nr rr_count \\n[rr_count]+1 -. \} -. \} -. \} -. ds hhh \\*[rr_labels!\\n[rr_i]] -. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]" -.\} -.. -'\" -'\" Some postscript to make pdfmarks harmless on old interpreters... -'\" -.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse" -'\" -'\" Force display of Bookmarks in Acrobat when document is viewed. -'\" -.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW" -'\" -'\" Output the document info in pdfmarks -'\" -.pdfmark "\ - /Title (\*[an-title](\*[an-section])) \ - /Subject (\*[an-title] Manual Page) \ - /Author (Rick Richardson) \ - /Keywords (printing) \ - /Creator (groff \n(.x.\n(.y.\n(.Y -man) \ - /CreationDate (\*[an-extra1]) \ - /ModDate (\*[an-extra1]) \ - /DOCINFO" -\} -'\" -'\" The manual page name is only 1st level mark -'\" -.nr rr_levels!\n+[rr_n] 1 -.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section]) -.pdfdest Link\n[rr_n] -'\" -'\"========================================================================== -'\" MANUAL PAGE SOURCE -'\"========================================================================== -.SH NAME -foo2hp2600-wrapper \- Convert Postscript into a ZJS printer stream -.SH SYNOPSIS -.B foo2hp2600-wrapper -.RI [ options "] [" ps-file ] -.SH DESCRIPTION -.B foo2hp2600-wrapper -is a Foomatic compatible printer wrapper for the \fBfoo2hp\fP printer driver. -This script reads a Postscript \fIps-file\fP or standard input -and converts it to Zenographics ZjStream printer format -for driving the Hewlett-Packard 2600n color laser printer -and other Zenographics-based printers. -.P -This script can be used in a standalone fashion, but is intended to -be called from a printer spooler system which uses the Foomatic -printer database. - -.SH COMMAND LINE OPTIONS -.SS Normal Options -These are the options used to select the parameters of a -print job that are usually controlled on a per job basis. -.TP -.BI \-b\0 bits -Number of bits per plane. 1 or 2. [1]. -.TP -.BI \-c -Print in color (else monochrome). -.TP -.BI \-d\0 duplex -Duplex code to send to printer [1]. -.TS -| n l | n l | n l . -1 off 2 long edge 3 short edge -.TE -.TP -.BI \-m\0 media -Media code to send to printer [1]. -.TS -l l -l n. -_ -Media HPLJ 2600n -_ -plain 1 -preprinted 514 -letterhead 513 -transparency 2 -prepunched 515 -labels 265 -bond 260 -recycled 516 -color 512 -tough 276 -envelope 267 -light 258 -heavy 262 -cardstock 261 -lightglossy 268 -glossy 269 -heavyglossy 270 -cover 277 -photo 278 -.TE -.TP -.BI \-p\0 paper -Paper size code to send to printer [1]. -.TS -box; -| n l | n l. -1 letter 9 A4 -5 legal 11 A5 -7 executive 13 B5jis -20 env #10 27 env DL -28 env C5 34 env B5 -37 env Monarch -.TE -.TP -.BI \-n\0 copies -Number of copies [1]. -.TP -.BI \-r\0 xres x yres -Set device resolution in pixels/inch [1200x600]. -.TP -.BI \-s\0 source -Source (Input Slot) code to send to printer [7]. -.TS -| n l | n l. -1 tray 2 4 manual/tray 1 -2 tray 3 7 auto -.TE -.TP -.BI \-t -Draft mode. Every other pixel is white. -.TP -.BI "\-2 \-3 \-4 \-5 \-6 \-8 \-9 \-10 \-12 \-14 \-15 \-16 \-18" -Print in N-up. Requires the \fBpsutils\fP package. -.TP -.BI \-o\0 orient -Orientation used for N-up. -.TS -l l l. -Portrait -op (normal) -Landscape -ol (rotated 90 degrees anticlockwise) -Seascape -os (rotated 90 degrees clockwise) -.TE -.SS Printer Tweaking Options -These are the options used to customize the operation of \fBfoo2hp\fP -for a particular printer. -.TP -.BI \-u\0 xoff x yoff -Set the offset of the start of the printable region from the -upper left corner, in pixels [varies with paper size]. -The defaults should work on the 2200DL and 2300DL, and have not -been tested on any other printers. -.TP -.BI \-l\0 xoff x yoff -Set the offset of the end of the printable region from the -lower right corner, in pixels [varies with paper size]. -The defaults should work on the 2200DL and 2300DL, and have not -been tested on any other printers. -.TP -.BI \-L\0 mask -Send the logical clipping values from -u/-l in the ZjStream. -\fBfoo2hp2600-wrapper\fP always runs Ghostscript with the ideal page dimensions, -so that the scale of the image is correct, -regardless whether or not the printer has unprintable regions. -This option is used to move the position of the clipped image -back to where it belongs on the page. The default is to send -the amount which was clipped by -u and -l, and should be -good in most cases. -.TS -l l. -0 don't send any logical clipping amounts -1 only send Y clipping amount -2 only send X clipping amount -3 send both X and Y clipping amounts -.TE -.TP -.BI \-O\0 parm=val -Alignment of CMYK. \fIparm\fP is c, m, y, or k. -\fIval\fP is in rows. Multiple options are allowed. -The default is "-Oc=0 -Om=0 -Oy=0 -Ok=0". -.TP -.BI \-P -Do not send START_PLANE codes on monochrome output. May be -needed by some monochrome-only printers, such as the -HP LaserJet 1000. -.TP -.BI \-X\0 padlen -Add extra zero padding to the end of BID segments. The default is -16 bytes. Padding 16 bytes of zeroes -is needed for older ZjStream printers, such as the Minolta 2200DL -and HP LaserJet 1000, and seems harmless to newer ones, such as -the Minolta 2300DL. So the default should be good for all cases. -.TP -.BI \-z\0 model -Model: Model: 0=HP CLJ 1600/2600n; 1=HP CLJ CP1215 -.SS Color Tweaking Options -These are the options used to control the quality of color output. -Color correction is currently a WORK IN PROGRESS. -.TP -.BI \-g\0 gsopts -Additional options to pass to Ghostscript, such as -g\(lq-dDITHERPPI=nnn\(rq, -etc. This option may appear more than once. -.TP -.BI \-G\0 profile.icm -Convert \fIprofile.icm\fP to a Postscript color rendering -dictionary (CRD) using \fBfoo2zjs-icc2ps\fP and -adjust the printer colors by using the Postscript \fBsetcolorrendering\fP -operator. If \fIprofile.icm\fP is none.icm, then prepare for ordering a -ICM custom printer profile (i.e. from www.ICCFactory.com). -.TP -.BI \-G\0 gamma-file.ps -Prepend \fIgamma-file.ps\fP to the Postscript input to perform -color correction using the \fBsetcolortransfer\fP Postscript operator. -For example, the file might contain: -.br -{0.333 exp} {0.333 exp} {0.333 exp} {0.333 exp} setcolortransfer -.TP -.BI \-I\0 intent -Select profile intent from the ICM file. -0=Perceptual, 1=Colorimetric, 2=Saturation, 3=Absolute. -Default is 0 (perceptual). -.SS Debugging Options -These options are used for debugging \fBfoo2hp\fP and its wrapper. -.TP -.BI \-S\0 plane -Output just a single color plane from a color print and print it -on the black plane. The default is to output all color planes. -.TS -l l. -1 Cyan -2 Magenta -3 Yellow -4 Black -.TE -.TP -.BI \-D\0 level -Set Debug level [0]. - -.SH EXAMPLES -Create a monochrome ZjStream from a Postscript document, -examine it, and then print it using a RAW print queue: - -.RS -.nf -foo2hp2600-wrapper testpage.ps > testpage.zm -zjsdecode < testpage.zm -lpr -P raw testpage.zm -.fi -.RE -.P -Create a color ZjStream stream from a Postscript document: - -.RS -.nf -foo2hp2600-wrapper -c testpage.ps > testpage.zc -.fi -.RE - -.SH FILES -.BR /usr/bin/foo2hp2600-wrapper -.SH SEE ALSO -.BR foo2hp (1), -.BR zjsdecode (1) -.SH "AUTHOR" -Rick Richardson -.br -http://foo2hp.rkkda.com/ -'\" -'\" -'\" -.em pdf_outline diff --git a/foo2hp2600-wrapper.1in b/foo2hp2600-wrapper.1in index a71617d..26b69ae 100644 --- a/foo2hp2600-wrapper.1in +++ b/foo2hp2600-wrapper.1in @@ -107,9 +107,9 @@ Print in N-up. Requires the \fBpsutils\fP package. Orientation used for N-up. .TS l l l. -Portrait -op (normal) -Landscape -ol (rotated 90 degrees anticlockwise) -Seascape -os (rotated 90 degrees clockwise) +Portrait \-op (normal) +Landscape \-ol (rotated 90 degrees anticlockwise) +Seascape \-os (rotated 90 degrees clockwise) .TE .SS Printer Tweaking Options These are the options used to customize the operation of \fBfoo2hp\fP @@ -128,13 +128,13 @@ The defaults should work on the 2200DL and 2300DL, and have not been tested on any other printers. .TP .BI \-L\0 mask -Send the logical clipping values from -u/-l in the ZjStream. +Send the logical clipping values from \-u/-l in the ZjStream. \fBfoo2hp2600-wrapper\fP always runs Ghostscript with the ideal page dimensions, so that the scale of the image is correct, regardless whether or not the printer has unprintable regions. This option is used to move the position of the clipped image back to where it belongs on the page. The default is to send -the amount which was clipped by -u and -l, and should be +the amount which was clipped by \-u and \-l, and should be good in most cases. .TS l l. @@ -147,7 +147,7 @@ l l. .BI \-O\0 parm=val Alignment of CMYK. \fIparm\fP is c, m, y, or k. \fIval\fP is in rows. Multiple options are allowed. -The default is "-Oc=0 -Om=0 -Oy=0 -Ok=0". +The default is "\-Oc=0 \-Om=0 \-Oy=0 \-Ok=0". .TP .BI \-P Do not send START_PLANE codes on monochrome output. May be @@ -168,7 +168,7 @@ These are the options used to control the quality of color output. Color correction is currently a WORK IN PROGRESS. .TP .BI \-g\0 gsopts -Additional options to pass to Ghostscript, such as -g\(lq-dDITHERPPI=nnn\(rq, +Additional options to pass to Ghostscript, such as \-g\(lq-dDITHERPPI=nnn\(rq, etc. This option may appear more than once. .TP .BI \-G\0 profile.icm @@ -214,7 +214,7 @@ examine it, and then print it using a RAW print queue: .nf foo2hp2600-wrapper testpage.ps > testpage.zm zjsdecode < testpage.zm -lpr -P raw testpage.zm +lpr \-P raw testpage.zm .fi .RE .P @@ -222,7 +222,7 @@ Create a color ZjStream stream from a Postscript document: .RS .nf -foo2hp2600-wrapper -c testpage.ps > testpage.zc +foo2hp2600-wrapper \-c testpage.ps > testpage.zc .fi .RE diff --git a/foo2hp2600-wrapper.in b/foo2hp2600-wrapper.in index c63e183..8b44535 100755 --- a/foo2hp2600-wrapper.in +++ b/foo2hp2600-wrapper.in @@ -13,8 +13,8 @@ #* GNU General Public License for more details. #* #* You should have received a copy of the GNU General Public License -#* along with this program; if not, write to the Free Software -#* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +#* along with this program; if not, see +#* . #* #* Authors: Rick Richardson diff --git a/foo2lava b/foo2lava deleted file mode 100755 index 07bd894..0000000 Binary files a/foo2lava and /dev/null differ diff --git a/foo2lava-wrapper b/foo2lava-wrapper deleted file mode 100755 index eeb57fe..0000000 --- a/foo2lava-wrapper +++ /dev/null @@ -1,759 +0,0 @@ -#!/bin/sh - -#* Copyright (C) 2003-2006 Rick Richardson -#* -#* This program is free software; you can redistribute it and/or modify -#* it under the terms of the GNU General Public License as published by -#* the Free Software Foundation; either version 2 of the License, or -#* (at your option) any later version. -#* -#* This program is distributed in the hope that it will be useful, -#* but WITHOUT ANY WARRANTY; without even the implied warranty of -#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -#* GNU General Public License for more details. -#* -#* You should have received a copy of the GNU General Public License -#* along with this program; if not, write to the Free Software -#* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#* -#* Authors: Rick Richardson - -VERSION='$Id: foo2lava-wrapper.in,v 1.47 2011/01/14 23:21:39 rick Exp $' - -# -# Printer Notes: -# -# LAVAFLOW: -# Konica Minolta magicolor 2530 DL - -z0 -# Konica Minolta magicolor 2490 MF - -z0 -# Xerox Phaser 6115MFP - -z0 -# Konica Minolta magicolor 1600W - -z2 -# Konica Minolta magicolor 1680MF - -z2 -# Konica Minolta magicolor 1690MF - -z2 -# Oki C110 - -z2 -# -# OPL: -# Konica Minolta 2480 MF - -z1 -# - -PROGNAME="$0" -BASENAME=`basename $PROGNAME` -PREFIX=/usr -SHARE=$PREFIX/share/foo2lava -PATH=$PATH:/sw/bin:/opt/local/bin - -# -# Log the command line, for debugging and problem reports -# -if [ -x /usr/bin/logger -o -x /bin/logger ]; then - logger -t "$BASENAME" -p lpr.info -- "foo2lava-wrapper $@" x Set device resolution in pixels/inch [$RES] --s source Source code to send to printer [$SOURCE] - 1=upper, 2=lower, 4=manual, 7=auto - Code numbers may vary with printer model. --t Draft mode. Every other pixel is white. --2/-3/-4/-6/-8/-10/-12/-14/-15/-16/-18 - Print with N-up (requires psutils) --o orient For N-up: -op is portrait, -ol is landscape, -os is seascape. - -Printer Tweaking Options: --u x Set offset of upper left printable in pixels [varies] --l x Set offset of lower right printable in pixels [varies] --L mask Send logical clipping values from -u/-l in ZjStream [3] - 0=no, 1=Y, 2=X, 3=XY --P Do not output START_PLANE codes. May be needed by some - monochrome-only printers. --X padlen Add extra zero padding to the end of BID segments [16] --z model Model: 0=2530DL or 2=1600W (LAVAFLOW) or 1=2480MF (OPL) [0] - -Color Tweaking Options: --g gsopts Additional options to pass to Ghostscript, such as - -dDITHERPPI=nnn, etc. May appear more than once. [] --G profile.icm Convert profile.icm to a Postscript CRD using icc2ps and - adjust colors using the setcolorrendering PS operator. - $SHARE/icm/ will be searched for profile.icm. --I intent Select profile intent from ICM file [$INTENT] - 0=Perceptual, 1=Colorimetric, 2=Saturation, 3=Absolute --G gamma-file.ps Prepend gamma-file to the Postscript input to perform - color correction using the setcolortransfer PS operator. - -Debugging Options: --S plane Output just a single color plane from a color print [all] - 1=Cyan, 2=Magenta, 3=Yellow, 4=Black --D lvl Set Debug level [$DEBUG] --V $VERSION -EOF - - exit 1 -} - -# -# Report an error and exit -# -error() { - echo "$BASENAME: $1" >&2 - exit 1 -} - -dbgcmd() { - if [ $DEBUG -ge 1 ]; then - echo "$@" >&2 - fi - "$@" -} - -# -# N-up-ify the job. Requires psnup from psutils package -# -nup() { - case "$NUP" in - [2368]|1[0458]) - tr '\r' '\n' | psnup $NUP_ORIENT -d2 -$NUP -m.3in -p$paper -q - ;; - [49]|1[26]) - tr '\r' '\n' | psnup $NUP_ORIENT -d2 -$NUP -m.5in -p$paper -q - ;; - *) - error "Illegal call to nup()." - ;; - esac -} - -# -# Process the options -# - -# Try to use a local copy of GhostScript 8.14, if available. Otherwise, -# fallback to whatever the Linux distro has installed (usually 7.05) -# -# N.B. := operator used here, when :- would be better, because "ash" -# doesn't have :- -if eval gs.foo -v >/dev/null 2>&1; then - GSBIN=${GSBIN:-gs.foo} -else - GSBIN=${GSBIN:-gs} -fi - -CMDLINE="$*" -DEBUG=0 -DUPLEX=1 -COLOR= -COLORMODE=default -MODEL=0 -QUALITY=1 -QUALITY=wts -MEDIA=0 -COPIES=1 -PAPER=2 -RES=1200x600 -SOURCE=255 -NUP= -CLIP_UL= -CLIP_LR= -CLIP_LOG= -BC= -AIB= -NOPLANES= -COLOR2MONO= -GAMMAFILE=default -INTENT=0 -GSOPTS= -EXTRAPAD= -SAVETONER= -NUP_ORIENT= -GSDEV=-sDEVICE=pbmraw -# What mode to use if the user wants us to pick the "best" mode -case `$GSBIN --version` in -7*) DEFAULTCOLORMODE=10 - DEFAULTCOLORMODE=2 - DEFAULTCOLORMODE=10 - ;; -8.1*) - QUALITY=1 - DEFAULTCOLORMODE=10 - ;; -*) DEFAULTCOLORMODE=2 - DEFAULTCOLORMODE=10 - ;; -esac -while getopts "1:23456789o:b:cC:d:g:l:u:L:m:n:p:q:r:s:tz:ABS:D:G:I:PX:Vh?" opt -do - case $opt in - b) GSBIN="$OPTARG";; - c) COLOR=-c;; - d) DUPLEX="$OPTARG";; - g) GSOPTS="$GSOPTS $OPTARG";; - m) MEDIA="$OPTARG";; - n) COPIES="$OPTARG";; - p) PAPER="$OPTARG";; - q) QUALITY="$OPTARG";; - r) RES="$OPTARG";; - s) SOURCE="$OPTARG";; - t) SAVETONER="-t";; - z) MODEL="$OPTARG";; - l) CLIP_LR="-l $OPTARG";; - u) CLIP_UL="-u $OPTARG";; - L) CLIP_LOG="-L $OPTARG";; - A) AIB=-A;; - B) BC=-B;; - C) COLORMODE="$OPTARG";; - S) COLOR2MONO="-S$OPTARG";; - D) DEBUG="$OPTARG";; - G) GAMMAFILE="$OPTARG";; - I) INTENT="$OPTARG";; - P) NOPLANES=-P;; - X) EXTRAPAD="-X $OPTARG";; - [234689]) NUP="$opt";; - [57]) error "Can't find acceptable layout for $opt-up";; - 1) case "$OPTARG" in - [024568]) NUP="1$OPTARG";; - *) error "Can't find acceptable layout for 1$OPTARG-up";; - esac - ;; - o) case "$OPTARG" in - l*) NUP_ORIENT=-l;; - s*) NUP_ORIENT=-r;; - p*|*) NUP_ORIENT=;; - esac;; - V) echo "$VERSION"; foo2lava -V; foo2zjs-pstops -V; exit 0;; - h|\?) - if [ "$CMDLINE" != "-?" -a "$CMDLINE" != -h ]; then - echo "Illegal command:" - echo " $0 $CMDLINE" - echo - fi - usage;; - esac -done -shift `expr $OPTIND - 1` - -# -# If there is an argument left, take it as the file to print. -# Else, the input comes from stdin. -# -if [ $# -ge 1 ]; then - if [ "$LPJOB" = "" ]; then - : # LPJOB="$1" - fi - exec < $1 -fi - - -# -# Select the ghostscript device to use -# -if [ "" = "$COLOR" ]; then - GSDEV=-sDEVICE=pbmraw -else - GSDEV=-sDEVICE=bitcmyk -fi -case "$GAMMAFILE" in -default) - if [ $MODEL = 0 ]; then - GAMMAFILE=km2530-jconner-d50.icm - else - GAMMAFILE=km-1600-rgb-392-bpp1.icm - fi - ;; -none) GAMMAFILE=;; -esac - -# -case "$QUALITY" in -0) - GSOPTS="-dCOLORSCREEN $GSOPTS" - ;; -1) - GSOPTS="-dCOLORSCREEN $GSOPTS" - ;; -2) - GSOPTS="-dMaxBitmap=500000000 $GSOPTS" - ;; -as) - GSOPTS="-dCOLORSCREEN -dMaxBitmap=500000000 $GSOPTS" - ;; -wts) - GSOPTS="-dCOLORSCREEN -dMaxBitmap=500000000 $GSOPTS" - ;; -esac - -# -# Validate model code -# -case "$MODEL" in -0|1|2) ;; -*) error "Unknown model code $MODEL";; -esac - -# -# Validate media code -# -case "$MEDIA" in -0|plain) MEDIA=0; if [ $MODEL = 1 ]; then MEDIA=plain; fi;; -4|transparency) MEDIA=4; if [ $MODEL = 1 ]; then MEDIA=transparency; fi;; -20|thickstock) MEDIA=20; if [ $MODEL = 1 ]; then MEDIA=cardstock; fi;; -22|envelope) MEDIA=22; if [ $MODEL = 1 ]; then MEDIA=envelope; fi;; -23|letterhead) MEDIA=23; if [ $MODEL = 1 ]; then MEDIA=stationery-letterhead; fi;; -25|postcard) MEDIA=25; if [ $MODEL = 1 ]; then MEDIA=photographic-matte; fi;; -26|labels) MEDIA=26; if [ $MODEL = 1 ]; then MEDIA=labels; fi;; -27|recycled) MEDIA=27; if [ $MODEL = 1 ]; then MEDIA=plain; fi;; -28|glossy) MEDIA=28; if [ $MODEL = 1 ]; then MEDIA=photographic-glossy; fi;; -[0-9]*) ;; -*) error "Unknown media code $MEDIA";; -esac - -# -# Validate source (InputSlot) code -# -case "$SOURCE" in -1|tray1) SOURCE=1;; -4|tray2) SOURCE=4;; -255|auto) SOURCE=255;; -[0-9]*) ;; -*) error "Unknown source code $SOURCE";; -esac - -# -# Validate Duplex code -# -case "$DUPLEX" in -1|off|none) DUPLEX=1;; -2|long*) DUPLEX=2;; -3|short*) DUPLEX=3;; -[0-9]*) ;; -*) error "Unknown duplex code $DUPLEX";; -esac - -# -# Validate Resolution -# -case "$RES" in -600x600) ;; -1200x600) ;; -2400x600) ;; -*) error "Illegal resolution $RES";; -esac - -# -# 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" in -Custom*x*) - # Command line only - XDIM=`echo "$PAPER" | sed -e "s/Custom.//" -e "s/x.*//" ` - YDIM=`echo "$PAPER" | sed -e "s/.*x//" ` - if [ "$XDIM" = "" -o "$YDIM" = "" ]; then - error "Custom page size '$PAPER' != 1-99999" - fi - if [ "$XDIM" -eq 0 -o "$YDIM" -eq 0 ]; then - error "Custom page size '$PAPER' != 1-99999" - fi - xmm=`dc -e "$XDIM 25.4 * 36 + 72/p"` - XDIM=`dc -e "$XDIM 1200* 72/p"` - ymm=`dc -e "$YDIM 25.4 * 36 + 72/p"` - YDIM=`dc -e "$YDIM 600* 72/p"` - PAPER=101; paper=letter; - MEDIA=20 - set_clipping 2 100 2 100 - if [ $MODEL = 1 ]; then PAPER=custom_size_${xmm}x${ymm}mm; fi - ;; -Custom*) - #%%BeginFeature: *CustomPageSize True - #216 - #360 - #0 - #0 - #0 - #pop pop pop pop pop - - #%%BeginFeature: *CustomPageSize True - #792.000000 612.000000 1 0.000000 0.000000 - #pop pop pop pop pop - - if [ $DEBUG = 0 ]; then - TMPFILE=/tmp/cus$$ - else - TMPFILE=/tmp/custom.ps - fi - cat >$TMPFILE - exec <$TMPFILE - - tmp=`head -n 10000 $TMPFILE \ - | sed -n '/CustomPageSize/{n;p;n;p;}' \ - | tr '\n' ' '` - case "$tmp" in - [0-9]*\ [0-9]*) - XDIM=`echo "$tmp" | sed 's/ .*//'` - YDIM=`echo "$tmp" | sed -e 's/^[^ ]* //' -e 's/ .*//'` - ;; - *) - if [ $DEBUG = 0 ]; then rm -f $TMPFILE; fi - error "Custom page size [XY]DIM != 1-99999" - ;; - esac - xmm=`dc -e "$XDIM 25.4 * 36 + 72/p"` - XDIM=`dc -e "$XDIM 1200* 72/p"` - ymm=`dc -e "$YDIM 25.4 * 36 + 72/p"` - YDIM=`dc -e "$YDIM 600* 72/p"` - PAPER=101; paper=letter; - MEDIA=20 - set_clipping 2 100 2 100 - if [ $MODEL = 1 ]; then PAPER=custom_size_${xmm}x${ymm}mm; fi - ;; -1|executive) PAPER=1; paper=executive; XDIM="8700"; YDIM="6300" - set_clipping 206 110 206 110 - if [ $MODEL = 1 ]; then PAPER=na_executive_7.25x10.5in; fi - ;; -2|letter) PAPER=2; paper=letter; XDIM="10200"; YDIM="6600" - set_clipping 204 100 204 100 - if [ $MODEL = 1 ]; then PAPER=na_letter_8.5x11in; fi - ;; -3|legal) PAPER=3; paper=legal; XDIM="10200"; YDIM="8400" - set_clipping 204 104 204 104 - if [ $MODEL = 1 ]; then PAPER=na_legal_8.5x14in; fi - ;; -25|a5|A5) PAPER=25; paper=a5; XDIM="6992"; YDIM="4960" - set_clipping 216 112 216 112 - if [ $MODEL = 1 ]; then PAPER=iso_a5_148x210mm; fi - ;; -26|a4|A4) PAPER=26; paper=a4; XDIM="9920"; YDIM="7016" - set_clipping 208 100 208 100 - if [ $MODEL = 1 ]; then PAPER=iso_a4_210x297mm; fi - ;; -45|b5jis|B5jis) PAPER=45; paper=b5; XDIM="8598"; YDIM="6070" - set_clipping 204 107 202 107 - if [ $MODEL = 1 ]; then PAPER=jis_b5_182x257mm; fi - ;; -65|b5iso|B5iso) PAPER=65; paper=b5; XDIM="8314"; YDIM="5906" - set_clipping 206 105 204 105 - ;; -80|envMonarch) PAPER=80; paper=envMonarch;XDIM="4650"; YDIM="4500" - set_clipping 214 106 212 106 - if [ $MODEL = 1 ]; then PAPER=na_monarch_3.875x7.5in; fi - ;; -81|"env#10") PAPER=81; paper=env10; XDIM="4950"; YDIM="5700" - set_clipping 204 114 202 114 - if [ $MODEL = 1 ]; then PAPER=na_number-10_4.125x9.5in; fi - ;; -90|envDL) PAPER=90; paper=envDL; XDIM="5200"; YDIM="5200" - set_clipping 216 104 216 104 - if [ $MODEL = 1 ]; then PAPER=iso_dl_110x220mm; fi - ;; -91|envC5) PAPER=91; paper=envC5; XDIM="7650"; YDIM="5408" - set_clipping 210 112 208 112 - if [ $MODEL = 1 ]; then PAPER=iso_c5_162x229mm; fi - ;; -92|envC6) PAPER=92; paper=envC6; XDIM="5386"; YDIM="3826" - set_clipping 214 105 212 105 - if [ $MODEL = 1 ]; then PAPER=iso_c6_114x162mm; fi - ;; -835|photo4x6) PAPER=835; paper=photo4x6; XDIM="4800"; YDIM="3600" - set_clipping 224 104 224 104 - ;; -837|photo10x15) PAPER=837; paper=photo10x15; XDIM="4818"; YDIM="3590" - # Actually, 102x152 - set_clipping 201 115 201 115 - ;; -*) error "Unimplemented paper code $PAPER";; -esac -# e.g. /usr/share/ghostscript/7.07/lib/gs_statd.ps -PAPERSIZE="-sPAPERSIZE=$paper"; - -case "$RES" in -600x600) XDIM=`expr $XDIM / 2`;; -1200x600) ;; -2400x600) XDIM=`expr $XDIM \* 2`;; -esac -DIM="${XDIM}x${YDIM}" - -# -# Filter thru psnup if N-up printing has been requested -# -case $NUP in -[234689]|1[024568]) PREFILTER="nup";; -*) PREFILTER=cat;; -esac -if [ "$DEBUG" -ge 9 ]; then - PREFILTER="tee /tmp/$BASENAME.ps" -fi - -# -# 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.icm | */none.icm) - ;; - *) - if [ -x /usr/bin/logger ]; then - logger -t "$BASENAME" -p lpr.info -- \ - "`basename $ICC2PS` -o $GAMMAFILE -t$INTENT > $ICCTMP.crd.ps" - fi - $ICC2PS -o $GAMMAFILE -t$INTENT > $ICCTMP.crd.ps 2>$ICCTMP.log \ - || error "Problem converting .ICM file to Postscript" - ;; - esac - - PSTOPS_OPTS="$PSTOPS_OPTS -c" - cat > $ICCTMP.usecie.ps <<-EOF - %!PS-Adobe-3.0 - <>setpagedevice - EOF - if [ "$QUALITY" = wts -o "$QUALITY" = as ]; then - if [ "$QUALITY" = wts ]; then - cat >> $ICCTMP.usecie.ps <<-EOF - << /UseWTS true >> setuserparams - EOF - else - cat >> $ICCTMP.usecie.ps <<-EOF - << /UseWTS false >> setuserparams - EOF - fi - cat >> $ICCTMP.usecie.ps <<-EOF - << - /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.icm | */none.icm) GAMMAFILE="$ICCTMP.usecie.ps";; - *) GAMMAFILE="$ICCTMP.usecie.ps $ICCTMP.crd.ps $ICCTMP.selcrd.ps";; - esac - else - GAMMAFILE= - fi -} - -if [ $DEBUG -gt 0 ]; then - ICCTMP=/tmp/icc -else - ICCTMP=/tmp/icc$$ -fi - -if [ "" = "$COLOR" ]; then - COLORMODE= - GAMMAFILE= -else - case "$COLORMODE" in - default) COLORMODE=$DEFAULTCOLORMODE;; - esac -fi - -CRDBASE="$PREFIX/share/foo2zjs/crd" -case "$RES" in - 600x600) SCREEN=screen1200.ps;; - 1200x600) SCREEN=screen1200.ps;; - 2400x600) SCREEN=screen2400.ps;; -esac - -PSTOPS_OPTS="-n" - -case "$COLORMODE" in -0|"") - # Monochrome - ;; -10|icm) - # Use old ICM method - AIB=-A - BC=-B - case "$GAMMAFILE" in - 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|photo) - # Photo - GAMMAFILE="$CRDBASE/prolog.ps" - GAMMAFILE="$GAMMAFILE $CRDBASE/2300w-1200@150-l250-kx,ucr125,75-per.crd" - GAMMAFILE="$GAMMAFILE $CRDBASE/$SCREEN" - ;; -2|graphics) - # Photo and Text - GAMMAFILE="$CRDBASE/prolog.ps" - #GAMMAFILE="$GAMMAFILE $CRDBASE/2300w-1200@150-l250-kx,ucr100,75-per.crd" - GAMMAFILE="$GAMMAFILE $CRDBASE/kh.crd" - GAMMAFILE="$GAMMAFILE $CRDBASE/$SCREEN" - ;; -3|text) - # Graphic and Text - GAMMAFILE="$CRDBASE/prolog.ps" - #GAMMAFILE="$GAMMAFILE $CRDBASE/2300w-1200@150-l250-kx,ucr100,50-per.crd" - GAMMAFILE="$GAMMAFILE $CRDBASE/kx.crd" - GAMMAFILE="$GAMMAFILE $CRDBASE/$SCREEN" - ;; -4|tonersave) - # Reduced toner - GAMMAFILE="$CRDBASE/prolog.ps" - GAMMAFILE="$GAMMAFILE $CRDBASE/2300w-1200@150-l250-kx,ucr100,0-per.crd" - GAMMAFILE="$GAMMAFILE $CRDBASE/$SCREEN" - ;; -*.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'" - ;; -esac - -if [ "$COLOR" != "" -a "$QUALITY" = wts ]; then - PSTOPS_OPTS="$PSTOPS_OPTS -w" -elif [ "$COLOR" != "" -a "$QUALITY" = as ]; then - PSTOPS_OPTS="$PSTOPS_OPTS -a" -fi - -if [ "" != "$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 - fi -fi - -# -# 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" - -foo2zjs-pstops $PSTOPS_OPTS | \ -$PREFILTER \ -| ($GS $PAPERSIZE -g$DIM -r$RES $GSDEV $GSOPTS \ - -sOutputFile="|cat 1>&3" $GAMMAFILE -_ >/dev/null) 3>&1 \ -| foo2lava -r$RES -g$DIM -p$PAPER -m$MEDIA -n$COPIES -d$DUPLEX -s$SOURCE \ - -z$MODEL $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 -- \ - "foo2lava -r$RES -g$DIM -p$PAPER -m$MEDIA \ --n$COPIES -d$DUPLEX -s$SOURCE -z$MODEL $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 -fi - -exit 0 diff --git a/foo2lava-wrapper.1 b/foo2lava-wrapper.1 deleted file mode 100644 index a52e81f..0000000 --- a/foo2lava-wrapper.1 +++ /dev/null @@ -1,411 +0,0 @@ -'\" t -'\" -'\" DO NOT EDIT! This file is generated from foo2lava-wrapper.1in -'\" -'\" t -.TH foo2lava-wrapper 1 "Sun May 26 18:25:20 2024" "foo2lava-wrapper 0.0" -'\" -'\" -'\"========================================================================== -'\" STRINGS and MACROS -'\"========================================================================== -'\" -'\" Define strings for special characters that nroff doesn't have -'\" -'\" N.B. using .if cua to test for special characters did not work. -'\" -.if !'\*[.T]'ps' .ds ua up -.if '\*[.T]'ps' .ds ua \(ua -.if !'\*[.T]'ps' .ds da down -.if '\*[.T]'ps' .ds da \(da -.if !'\*[.T]'ps' .ds <- left -.if '\*[.T]'ps' .ds <- \(<- -.if !'\*[.T]'ps' .ds -> right -.if '\*[.T]'ps' .ds -> \(-> -'\" -'\" bx - box a Courier string for making keycaps -'\" -'\" N.B. this mess is to make the line drawing come out only -'\" if we are really generating postscript -'\" -.de bx -.ie !'\*[.T]'ps' \{\ -. RB [ \\$1 ]\\$2 -.\} -.el \{\ -. ie !r ps4html \{\ -'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul' -. ft CW -. nr par*bxw \w'\\$1'+.4m -\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\ -\Z'\h'.2m'\s-1\\$1\s+1'\ -\h'\\n[par*bxw]u'\\$2 -. ft P -. \} -. el \{\ -. RB [ \\$1 ]\\$2 -. \} -.\} -.. -'\" -'\" strings to set current color (null with old groff) -'\" -.if mred .ds red \m[red] -.if mgreen .ds green \m[green] -.if mblue .ds blue \m[blue] -.if mblack .ds black \m[black] -.if mblack .ds mP \mP -'\" -'\" fix for grotty + xterm. We call for orange, grotty outputs yellow, -'\" but xterm displays yellow as orange. The cycle is complete. -'\" -.if n .defcolor orange rgb #ffff00 -'\" -'\" color - set the current color (ignores request with old groff) -'\" -.de color -.if mred \m[\\$1]\c -.. -'\" -'\" colorword - colorize a word (ignored by old groff) -'\" -.de colorword -.ie m\\$1 \m[\\$1]\\$2\mP\c -.el \\$2\c -.. -'\" -'\" colbox - colorize a word in a filled box -'\" -.de colbox -.ie mred \M[\\$2]\ -\v'+.167v'\ -\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\ -\v'-.167v'\ -\m[\\$1]\\$3\mP\MP -.el \\$3\c -.. -'\" -'\" Macros for doing pdfmarks -'\" -.de specialps -.if '\*[.T]'ps' \\k_\X'ps: \\$*'\h'|\\n_u'\c -.. -'\" -'\" pdfmark PDFMARKCODE -'\" -.ds pdfmarks -.if d pdfmarks \{\ -.de pdfmark -. specialps exec [\\$1 pdfmark -.. -'\" -'\" pdfdest LINKNAME -'\" -.de pdfdest -.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST" -.. -'\" -'\" pdfbookmark COUNT LINKNAME STRING -'\" -.de pdfbookmark -. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT" -.. -'\" -'\" Define the SH and SS macros to save pdfmark information -'\" in "arrays" of numbers and strings. -'\" -.if !r rr_n \{\ -.nr rr_n 0 1 -.am SH -. nr rr_levels!\\n+[rr_n] 2 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.am SS -. nr rr_levels!\\n+[rr_n] 3 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.\} -'\" -'\" Called at the end of the document to generate the pdfmark outline -'\" -.de pdf_outline -.nr rr_levels!\\n+[rr_n] 1 -.nr rr_i 0 1 -.while \\n+[rr_i]<\\n[rr_n] \{\ -. nr rr_ip1 \\n[rr_i]+1 -. nr rr_count 0 -. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\ -. nr rr_j \\n[rr_i] 1 -. while \\n+[rr_j]<\\n[rr_n] \{\ -. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\ -. break -. \} -. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\ -. nr rr_count \\n[rr_count]+1 -. \} -. \} -. \} -. ds hhh \\*[rr_labels!\\n[rr_i]] -. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]" -.\} -.. -'\" -'\" Some postscript to make pdfmarks harmless on old interpreters... -'\" -.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse" -'\" -'\" Force display of Bookmarks in Acrobat when document is viewed. -'\" -.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW" -'\" -'\" Output the document info in pdfmarks -'\" -.pdfmark "\ - /Title (\*[an-title](\*[an-section])) \ - /Subject (\*[an-title] Manual Page) \ - /Author (Rick Richardson) \ - /Keywords (printing) \ - /Creator (groff \n(.x.\n(.y.\n(.Y -man) \ - /CreationDate (\*[an-extra1]) \ - /ModDate (\*[an-extra1]) \ - /DOCINFO" -\} -'\" -'\" The manual page name is only 1st level mark -'\" -.nr rr_levels!\n+[rr_n] 1 -.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section]) -.pdfdest Link\n[rr_n] -'\" -'\"========================================================================== -'\" MANUAL PAGE SOURCE -'\"========================================================================== -.SH NAME -foo2lava-wrapper \- Convert Postscript into a LAVAFLOW or OPL printer stream -.SH SYNOPSIS -.B foo2lava-wrapper -.RI [ options "] [" ps-file ] -.SH DESCRIPTION -.B foo2lava-wrapper -is a Foomatic compatible printer wrapper for the \fBfoo2lava\fP printer driver. -This script reads a Postscript \fIps-file\fP or standard input -and converts it to Zenographics LAVAFLOW printer format -for driving -the Konica Minolta magicolor 1600W color laser printer, -the Konica Minolta magicolor 1680MF/1690MF AIO printer, -the Konica Minolta magicolor 2480/2490 MF AIO printer, -the Konica Minolta magicolor 2530 DL network color laser printer, -and other Zenographics-based LAVAFLOW printers. -.P -This script can be used in a standalone fashion, but is intended to -be called from a printer spooler system which uses the Foomatic -printer database. - -.SH COMMAND LINE OPTIONS -.SS Normal Options -These are the options used to select the parameters of a -print job that are usually controlled on a per job basis. -.TP -.BI \-c -Print in color (else monochrome). -.TP -.BI \-C\0 colormode -Color correction mode [0]. -.TS -n l . -1 Photos (using m2300w CRDs) -2 Photos and text (using m2300w CRDs) -3 Graphics and text (using m2300w CRDs) -10 ICM color profile (using -G *.icm file) -.TE -.TP -.BI \-d\0 duplex -Duplex code to send to printer [1]. -.TS -| n l | n l | n l . -1 off 2 long edge 3 short edge -.TE -.TP -.BI \-m\0 media -Media code to send to printer [0]. -.TS -l l l -l n n. -_ -Media 2530DL -_ -plain 0 -transparency 4 -thick stock 20 -envelope 22 -letterhead 23 -postcard 25 -labels 26 -recycled 27 -.TE -.TP -.BI \-p\0 paper -Paper size code to send to printer [2]. -.TS -box; -| n l | n l. -1 executive 25 A5 -2 letter 26 A4 -3 legal 45 B5jis -80 env Monarch 65 B5iso -81 env #10 90 env DL -91 env C5 92 env B5 -835 4x6" photo 837 10x15cm photo -.TE -.TP -.BI \-n\0 copies -Number of copies [1]. -.TP -.BI \-r\0 xres x yres -Set device resolution in pixels/inch [1200x600]. -.TP -.BI \-s\0 source -Source (Input Slot) code to send to printer [255]. -.TS -| n l | n l. -1 Tray 1 255 auto -4 Tray 2 -.TE -.TP -.BI \-t -Draft mode. Every other pixel is white. -.TP -.BI "\-2 \-3 \-4 \-5 \-6 \-8 \-9 \-10 \-12 \-14 \-15 \-16 \-18" -Print in N-up. Requires the \fBpsutils\fP package. -.TP -.BI \-o\0 orient -Orientation used for N-up. -.TS -l l l. -Portrait -op (normal) -Landscape -ol (rotated 90 degrees anticlockwise) -Seascape -os (rotated 90 degrees clockwise) -.TE -.SS Printer Tweaking Options -These are the options used to customize the operation of \fBfoo2lava\fP -for a particular printer. -.TP -.BI \-u\0 xoff x yoff -Set the offset of the start of the printable region from the -upper left corner, in pixels [varies with paper size]. -The defaults should work on the 2200DL and 2300DL, and have not -been tested on any other printers. -.TP -.BI \-l\0 xoff x yoff -Set the offset of the end of the printable region from the -lower right corner, in pixels [varies with paper size]. -The defaults should work on the 2200DL and 2300DL, and have not -been tested on any other printers. -.TP -.BI \-L\0 mask -Send the logical clipping values from -u/-l in the LAVAFLOW stream. -\fBfoo2lava-wrapper\fP always runs Ghostscript with the ideal page dimensions, -so that the scale of the image is correct, -regardless whether or not the printer has unprintable regions. -This option is used to move the position of the clipped image -back to where it belongs on the page. The default is to send -the amount which was clipped by -u and -l, and should be -good in most cases. -.TS -l l. -0 don't send any logical clipping amounts -1 only send Y clipping amount -2 only send X clipping amount -3 send both X and Y clipping amounts -.TE -.TP -.BI \-z\0 model -Model. The default is [0]. -.TS -l l l. -model protocol Description -0 LAVAFLOW magicolor 2490 MF -0 LAVAFLOW magicolor 2530 DL -1 OPL magicolor 2480 MF -2 LAVAFLOW magicolor 1600W -2 LAVAFLOW magicolor 1680MF -2 LAVAFLOW magicolor 1690MF -.TE -.SS Color Tweaking Options -These are the options used to control the quality of color output. -Color correction is currently a WORK IN PROGRESS. -.TP -.BI \-g\0 gsopts -Additional options to pass to Ghostscript, such as -g\(lq-dDITHERPPI=nnn\(rq, -etc. This option may appear more than once. -.TP -.BI \-G\0 profile.icm -Convert \fIprofile.icm\fP to a Postscript color rendering -dictionary (CRD) using \fBfoo2zjs-icc2ps\fP and -adjust the printer colors by using the Postscript \fBsetcolorrendering\fP -operator. (WORK IN PROGRESS). -.TP -.BI \-G\0 gamma-file.ps -Prepend \fIgamma-file.ps\fP to the Postscript input to perform -color correction using the \fBsetcolortransfer\fP Postscript operator. -For example, the file might contain: -.br -{0.333 exp} {0.333 exp} {0.333 exp} {0.333 exp} setcolortransfer -.TP -.BI \-I\0 intent -Select profile intent from the ICM file. -0=Perceptual, 1=Colorimetric, 2=Saturation, 3=Absolute. -Default is 0 (perceptual). -.SS Debugging Options -These options are used for debugging \fBfoo2lava\fP and its wrapper. -.TP -.BI \-S\0 plane -Output just a single color plane from a color print and print it -on the black plane. The default is to output all color planes. -.TS -l l. -1 Cyan -2 Magenta -3 Yellow -4 Black -.TE -.TP -.BI \-D\0 level -Set Debug level [0]. - -.SH EXAMPLES -Create a monochrome LAVAFLOW stream from a Postscript document, -examine it, and then print it using a RAW print queue: - -.RS -.nf -foo2lava-wrapper testpage.ps > testpage.zm -lavadecode < testpage.zm -lpr -P raw testpage.zm -.fi -.RE -.P -Create a color LAVAFLOW stream from a Postscript document: - -.RS -.nf -foo2lava-wrapper -c testpage.ps > testpage.zc -.fi -.RE - -.SH FILES -.BR /usr/bin/foo2lava-wrapper -.SH SEE ALSO -.BR foo2lava (1), -.BR lavadecode (1) -.BR opldecode (1) -.SH "AUTHOR" -Rick Richardson -.br -http://foo2zjs.rkkda.com/ -'\" -'\" -'\" -.em pdf_outline diff --git a/foo2lava-wrapper.1in b/foo2lava-wrapper.1in index f02d899..60629ea 100644 --- a/foo2lava-wrapper.1in +++ b/foo2lava-wrapper.1in @@ -42,7 +42,7 @@ n l . 1 Photos (using m2300w CRDs) 2 Photos and text (using m2300w CRDs) 3 Graphics and text (using m2300w CRDs) -10 ICM color profile (using -G *.icm file) +10 ICM color profile (using \-G *.icm file) .TE .TP .BI \-d\0 duplex @@ -108,9 +108,9 @@ Print in N-up. Requires the \fBpsutils\fP package. Orientation used for N-up. .TS l l l. -Portrait -op (normal) -Landscape -ol (rotated 90 degrees anticlockwise) -Seascape -os (rotated 90 degrees clockwise) +Portrait \-op (normal) +Landscape \-ol (rotated 90 degrees anticlockwise) +Seascape \-os (rotated 90 degrees clockwise) .TE .SS Printer Tweaking Options These are the options used to customize the operation of \fBfoo2lava\fP @@ -129,13 +129,13 @@ The defaults should work on the 2200DL and 2300DL, and have not been tested on any other printers. .TP .BI \-L\0 mask -Send the logical clipping values from -u/-l in the LAVAFLOW stream. +Send the logical clipping values from \-u/-l in the LAVAFLOW stream. \fBfoo2lava-wrapper\fP always runs Ghostscript with the ideal page dimensions, so that the scale of the image is correct, regardless whether or not the printer has unprintable regions. This option is used to move the position of the clipped image back to where it belongs on the page. The default is to send -the amount which was clipped by -u and -l, and should be +the amount which was clipped by \-u and \-l, and should be good in most cases. .TS l l. @@ -162,7 +162,7 @@ These are the options used to control the quality of color output. Color correction is currently a WORK IN PROGRESS. .TP .BI \-g\0 gsopts -Additional options to pass to Ghostscript, such as -g\(lq-dDITHERPPI=nnn\(rq, +Additional options to pass to Ghostscript, such as \-g\(lq-dDITHERPPI=nnn\(rq, etc. This option may appear more than once. .TP .BI \-G\0 profile.icm @@ -207,7 +207,7 @@ examine it, and then print it using a RAW print queue: .nf foo2lava-wrapper testpage.ps > testpage.zm lavadecode < testpage.zm -lpr -P raw testpage.zm +lpr \-P raw testpage.zm .fi .RE .P @@ -215,7 +215,7 @@ Create a color LAVAFLOW stream from a Postscript document: .RS .nf -foo2lava-wrapper -c testpage.ps > testpage.zc +foo2lava-wrapper \-c testpage.ps > testpage.zc .fi .RE diff --git a/foo2lava.1 b/foo2lava.1 deleted file mode 100644 index 528c15a..0000000 --- a/foo2lava.1 +++ /dev/null @@ -1,369 +0,0 @@ -'\" t -'\" -'\" DO NOT EDIT! This file is generated from foo2lava.1in -'\" -'\" t -.TH foo2lava 1 "Sun May 26 18:25:20 2024" "foo2lava 0.0" -'\" -'\" -'\"========================================================================== -'\" STRINGS and MACROS -'\"========================================================================== -'\" -'\" Define strings for special characters that nroff doesn't have -'\" -'\" N.B. using .if cua to test for special characters did not work. -'\" -.if !'\*[.T]'ps' .ds ua up -.if '\*[.T]'ps' .ds ua \(ua -.if !'\*[.T]'ps' .ds da down -.if '\*[.T]'ps' .ds da \(da -.if !'\*[.T]'ps' .ds <- left -.if '\*[.T]'ps' .ds <- \(<- -.if !'\*[.T]'ps' .ds -> right -.if '\*[.T]'ps' .ds -> \(-> -'\" -'\" bx - box a Courier string for making keycaps -'\" -'\" N.B. this mess is to make the line drawing come out only -'\" if we are really generating postscript -'\" -.de bx -.ie !'\*[.T]'ps' \{\ -. RB [ \\$1 ]\\$2 -.\} -.el \{\ -. ie !r ps4html \{\ -'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul' -. ft CW -. nr par*bxw \w'\\$1'+.4m -\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\ -\Z'\h'.2m'\s-1\\$1\s+1'\ -\h'\\n[par*bxw]u'\\$2 -. ft P -. \} -. el \{\ -. RB [ \\$1 ]\\$2 -. \} -.\} -.. -'\" -'\" strings to set current color (null with old groff) -'\" -.if mred .ds red \m[red] -.if mgreen .ds green \m[green] -.if mblue .ds blue \m[blue] -.if mblack .ds black \m[black] -.if mblack .ds mP \mP -'\" -'\" fix for grotty + xterm. We call for orange, grotty outputs yellow, -'\" but xterm displays yellow as orange. The cycle is complete. -'\" -.if n .defcolor orange rgb #ffff00 -'\" -'\" color - set the current color (ignores request with old groff) -'\" -.de color -.if mred \m[\\$1]\c -.. -'\" -'\" colorword - colorize a word (ignored by old groff) -'\" -.de colorword -.ie m\\$1 \m[\\$1]\\$2\mP\c -.el \\$2\c -.. -'\" -'\" colbox - colorize a word in a filled box -'\" -.de colbox -.ie mred \M[\\$2]\ -\v'+.167v'\ -\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\ -\v'-.167v'\ -\m[\\$1]\\$3\mP\MP -.el \\$3\c -.. -'\" -'\" Macros for doing pdfmarks -'\" -.de specialps -.if '\*[.T]'ps' \\k_\X'ps: \\$*'\h'|\\n_u'\c -.. -'\" -'\" pdfmark PDFMARKCODE -'\" -.ds pdfmarks -.if d pdfmarks \{\ -.de pdfmark -. specialps exec [\\$1 pdfmark -.. -'\" -'\" pdfdest LINKNAME -'\" -.de pdfdest -.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST" -.. -'\" -'\" pdfbookmark COUNT LINKNAME STRING -'\" -.de pdfbookmark -. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT" -.. -'\" -'\" Define the SH and SS macros to save pdfmark information -'\" in "arrays" of numbers and strings. -'\" -.if !r rr_n \{\ -.nr rr_n 0 1 -.am SH -. nr rr_levels!\\n+[rr_n] 2 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.am SS -. nr rr_levels!\\n+[rr_n] 3 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.\} -'\" -'\" Called at the end of the document to generate the pdfmark outline -'\" -.de pdf_outline -.nr rr_levels!\\n+[rr_n] 1 -.nr rr_i 0 1 -.while \\n+[rr_i]<\\n[rr_n] \{\ -. nr rr_ip1 \\n[rr_i]+1 -. nr rr_count 0 -. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\ -. nr rr_j \\n[rr_i] 1 -. while \\n+[rr_j]<\\n[rr_n] \{\ -. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\ -. break -. \} -. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\ -. nr rr_count \\n[rr_count]+1 -. \} -. \} -. \} -. ds hhh \\*[rr_labels!\\n[rr_i]] -. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]" -.\} -.. -'\" -'\" Some postscript to make pdfmarks harmless on old interpreters... -'\" -.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse" -'\" -'\" Force display of Bookmarks in Acrobat when document is viewed. -'\" -.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW" -'\" -'\" Output the document info in pdfmarks -'\" -.pdfmark "\ - /Title (\*[an-title](\*[an-section])) \ - /Subject (\*[an-title] Manual Page) \ - /Author (Rick Richardson) \ - /Keywords (printing) \ - /Creator (groff \n(.x.\n(.y.\n(.Y -man) \ - /CreationDate (\*[an-extra1]) \ - /ModDate (\*[an-extra1]) \ - /DOCINFO" -\} -'\" -'\" The manual page name is only 1st level mark -'\" -.nr rr_levels!\n+[rr_n] 1 -.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section]) -.pdfdest Link\n[rr_n] -'\" -'\"========================================================================== -'\" MANUAL PAGE SOURCE -'\"========================================================================== -.SH NAME -foo2lava \- Convert Ghostscript pbmraw or bitcmyk format into a -LAVAFLOW or a OPL printer stream -.SH SYNOPSIS -.B foo2lava -.RI [ options "] <" pbmraw-file " >" lava-file -.sp 1 -.B foo2lava -.RI [ options "] <" bitcmyk-file " >" lava-file -.sp 1 -.B foo2lava -.RI [ options "] <" pksmraw-file " >" lava-file -.SH DESCRIPTION -.B foo2lava -converts Ghostscript pbmraw, bitcmyk, or pksmraw output formats to monochrome -or color LAVAFLOW or OPL streams, -for driving the Konica Minolta magicolor 2530 DL network color laser printer, -the Konica Minolta magicolor 2480/2480 MF AIO printer, -and other Zenographics-based LAVAFLOW printers. - -.SH COMMAND LINE OPTIONS -.SS Normal Options -These are the options used to select the parameters of a -print job that are usually controlled on a per job basis. -.TP -.BI \-c -Force color mode if autodetect doesn't work. -.TP -.BI \-d\0 duplex -Duplex code to send to printer [1]. -.TS -| n l | n l | n l . -1 off 2 long edge 3 short edge -.TE -.TP -.BI \-g\0 xpix x ypix -Set page dimensions in pixels [10200x6600]. -.TP -.BI \-m\0 media -Media code to send to printer [0]. -.TS -l l l -l n n. -_ -Media 2530DL -_ -plain 0 -transparency 4 -thick stock 20 -envelope 22 -letterhead 23 -postcard 25 -labels 26 -recycled 27 -.TE -.TP -.BI \-p\0 paper -Paper code to send to printer [2]. -.TS -box; -| n l | n l. -1 executive 25 A5 -2 letter 26 A4 -3 legal 45 B5jis -80 env Monarch 65 B5iso -81 env #10 90 env DL -91 env C5 92 env C6 -835 4x6" photo 837 10x15cm photo -.TE -.TP -.BI \-n\0 copies -Number of copies [1]. -.TP -.BI \-r\0 xres x yres -Set device resolution in pixels/inch [1200x600]. -.TP -.BI \-s\0 source -Source (InputSlot) code to send to printer [255]. -.TS -| n l | n l. -1 Tray 1 255 auto -4 Tray 2 -.TE -.TP -.BI \-t -Draft mode. Every other pixel is white. -.TP -.BI \-J\0 filename -Filename string to send to printer. -.TP -.BI \-U\0 username -Username string to send to printer. -.SS Printer Tweaking Options -These are the options used to customize the operation of \fBfoo2lava\fP -for a particular printer. -.TP -.BI \-u\0 xoff x yoff -Set the offset of the start of the printable region from the -upper left corner, in pixels [0x0]. -.TP -.BI \-l\0 xoff x yoff -Set the offset of the end of the printable region from the -lower right corner, in pixels [0x0]. -.TP -.BI \-L\0 mask -Send logical clipping amounts implied by -u/-l in the LAVAFLOW stream [3]. -.TS -l l. -0 don't send any logical clipping amounts -1 only send Y clipping amount -2 only send X clipping amount -3 send both X and Y clipping amounts -.TE -.TP -.BI \-A -AllIsBlack: convert C=1,M=1,Y=1 to just K=1. Works with bitcmyk input only. -.TP -.BI \-B -BlackClears: K=1 forces C,M,Y to 0. Works with bitcmyk input only. -.TP -.BI \-z\0 model -Model. The default is [0]. -.TS -l l l. -model protocol Description -0 LAVAFLOW magicolor 2490 MF -0 LAVAFLOW magicolor 2530 DL -1 OPL magicolor 2480 MF -2 LAVAFLOW magicolor 1600W -2 LAVAFLOW magicolor 1680MF -2 LAVAFLOW magicolor 1690MF -.TE -.SS Debugging Options -These options are used for debugging \fBfoo2lava\fP. -.TP -.BI \-S\0 plane -Output just a single color plane from a color print and print it -on the black plane. The default is to output all color planes. -.TS -l l. -1 Cyan -2 Magenta -3 Yellow -4 Black -.TE -.TP -.BI \-D\0 level -Set Debug level [0]. - -.SH EXAMPLES -Create a black and white LAVAFLOW stream: - -.RS -.nf -gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE \ - -sPAPERSIZE=letter -r1200x600 -sDEVICE=pbmraw \ - -sOutputFile=- - < testpage.ps \ -| foo2lava -r1200x600 -g10200x6600 -p1 >testpage.zm -.fi -.RE -.P -Create a color LAVAFLOW stream: - -.RS -.nf -gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE \ - -sPAPERSIZE=letter -g10200x6600 -r1200x600 -sDEVICE=bitcmyk \ - -sOutputFile=- - < testpage.ps \ -| foo2lava -r1200x600 -g10200x6600 -p1 >testpage.zc -.fi -.RE - -.SH FILES -.BR /usr/bin/foo2lava -.SH SEE ALSO -.BR foo2lava-wrapper (1), -.BR lavadecode (1) -.SH "AUTHOR" -Rick Richardson -.br -http://foo2zjs.rkkda.com/ -'\" -'\" -'\" -.em pdf_outline diff --git a/foo2lava.1in b/foo2lava.1in index 2328ae5..0b88544 100644 --- a/foo2lava.1in +++ b/foo2lava.1in @@ -111,7 +111,7 @@ Set the offset of the end of the printable region from the lower right corner, in pixels [0x0]. .TP .BI \-L\0 mask -Send logical clipping amounts implied by -u/-l in the LAVAFLOW stream [3]. +Send logical clipping amounts implied by \-u/-l in the LAVAFLOW stream [3]. .TS l l. 0 don't send any logical clipping amounts @@ -160,10 +160,10 @@ Create a black and white LAVAFLOW stream: .RS .nf -gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE \ - -sPAPERSIZE=letter -r1200x600 -sDEVICE=pbmraw \ - -sOutputFile=- - < testpage.ps \ -| foo2lava -r1200x600 -g10200x6600 -p1 >testpage.zm +gs \-q \-dBATCH \-dSAFER \-dQUIET \-dNOPAUSE \ + \-sPAPERSIZE=letter \-r1200x600 \-sDEVICE=pbmraw \ + \-sOutputFile=- \- < testpage.ps \ +| foo2lava \-r1200x600 \-g10200x6600 \-p1 >testpage.zm .fi .RE .P @@ -171,10 +171,10 @@ Create a color LAVAFLOW stream: .RS .nf -gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE \ - -sPAPERSIZE=letter -g10200x6600 -r1200x600 -sDEVICE=bitcmyk \ - -sOutputFile=- - < testpage.ps \ -| foo2lava -r1200x600 -g10200x6600 -p1 >testpage.zc +gs \-q \-dBATCH \-dSAFER \-dQUIET \-dNOPAUSE \ + \-sPAPERSIZE=letter \-g10200x6600 \-r1200x600 \-sDEVICE=bitcmyk \ + \-sOutputFile=- \- < testpage.ps \ +| foo2lava \-r1200x600 \-g10200x6600 \-p1 >testpage.zc .fi .RE diff --git a/foo2oak b/foo2oak deleted file mode 100755 index 573e909..0000000 Binary files a/foo2oak and /dev/null differ diff --git a/foo2oak-wrapper b/foo2oak-wrapper deleted file mode 100755 index 033eade..0000000 --- a/foo2oak-wrapper +++ /dev/null @@ -1,732 +0,0 @@ -#!/bin/sh - -#* Copyright (C) 2003-2006 Rick Richardson -#* -#* This program is free software; you can redistribute it and/or modify -#* it under the terms of the GNU General Public License as published by -#* the Free Software Foundation; either version 2 of the License, or -#* (at your option) any later version. -#* -#* This program is distributed in the hope that it will be useful, -#* but WITHOUT ANY WARRANTY; without even the implied warranty of -#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -#* GNU General Public License for more details. -#* -#* You should have received a copy of the GNU General Public License -#* along with this program; if not, write to the Free Software -#* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#* -#* Authors: Rick Richardson - -VERSION='$Id: foo2oak-wrapper.in,v 1.60 2011/08/07 16:49:30 rick Exp $' - -# -# Printer Notes: -# -# HP Color LaserJet 1500: -z0 (mirror bytes) -# -# Kyocera Mita KM-1635: -z1 (rotate 90) -# Kyocera Mita KM-2035: -z1 (rotate 90) -# - -PROGNAME="$0" -BASENAME=`basename $PROGNAME` -PREFIX=/usr -SHARE=$PREFIX/share/foo2oak -PATH=$PATH:/sw/bin:/opt/local/bin - -# -# Log the command line, for debugging and problem reports -# -if [ -x /usr/bin/logger -o -x /bin/logger ]; then - logger -t "$BASENAME" -p lpr.info -- "$BASENAME $@" x Set device resolution in pixels/inch [$RES] --s source Source code to send to printer [$SOURCE] - 1=tray1, 2=tray2, 4=manual, 7=auto - Code numbers may vary with printer model. --2/-3/-4/-6/-8/-10/-12/-14/-15/-16/-18 - Print with N-up (requires psutils) --o orient For N-up: -op is portrait, -ol is landscape, -os is seascape. - -Printer Tweaking Options: --u x Set offset of upper left printable in pixels [varies] --l x Set offset of lower right printable in pixels [varies] --L mask Send logical clipping values from -u/-l in ZjStream [3] - 0=no, 1=Y, 2=X, 3=XY --z model Model: 0=HP CLJ 1500, 1=KM-1635/KM-2035 [$MODEL] - -Color Tweaking Options: --g gsopts Additional options to pass to Ghostscript, such as - -dDITHERPPI=nnn, etc. May appear more than once. [] --G profile.icm Convert profile.icm to a Postscript CRD using icc2ps and - adjust colors using the setcolorrendering PS operator. - $SHARE/icm/ will be searched for profile.icm. --I intent Select profile intent from ICM file [$INTENT] - 0=Perceptual, 1=Colorimetric, 2=Saturation, 3=Absolute --G gamma-file.ps Prepend gamma-file to the Postscript input to perform - color correction using the setcolortransfer PS operator. - -Debugging Options: --S plane Output just a single color plane from a color print [all] - 1=Cyan, 2=Magenta, 3=Yellow, 4=Black --D lvl Set Debug level [$DEBUG] --V $VERSION -EOF - - exit 1 -} - -# -# Report an error and exit -# -error() { - echo "$BASENAME: $1" >&2 - exit 1 -} - -dbgcmd() { - if [ $DEBUG -ge 1 ]; then - echo "$@" >&2 - fi - "$@" -} - -# -# N-up-ify the job. Requires psnup from psutils package -# -nup() { - case "$NUP" in - [2368]|1[0458]) - tr '\r' '\n' | psnup $NUP_ORIENT -d2 -$NUP -m.3in -p$paper -q - ;; - [49]|1[26]) - tr '\r' '\n' | psnup $NUP_ORIENT -d2 -$NUP -m.5in -p$paper -q - ;; - *) - error "Illegal call to nup()." - ;; - esac -} - -# -# Process the options -# - -# Try to use a local copy of GhostScript 8.54, if available. Otherwise, -# fallback to whatever the Linux distro has installed (usually 7.07) -# -# N.B. := operator used here, when :- would be better, because "ash" -# doesn't have :- -if eval gs.foo -v >/dev/null 2>&1; then - GSBIN=${GSBIN:-gs.foo} -else - GSBIN=${GSBIN:-gs} -fi - -BPP=1 -CMDLINE="$*" -DEBUG=0 -DUPLEX=1 -COLOR= -COLORMODE=default -MODEL=0 -QUALITY=1 -QUALITY=wts -MEDIA=1 -COPIES=1 -PAPER=1 -RES=600x600 -SOURCE=7 -NUP= -CLIP_UL= -CLIP_LR= -CLIP_LOG= -BC= -AIB= -COLOR2MONO= -GAMMAFILE=default -INTENT=0 -GSOPTS= -NUP_ORIENT= -GSDEV=-sDEVICE=pbmraw -# What mode to use if the user wants us to pick the "best" mode -case `$GSBIN --version` in -7*) DEFAULTCOLORMODE=10 - ;; -8.1*) - DEFAULTCOLORMODE=10 - QUALITY=1 - ;; -*) DEFAULTCOLORMODE=10 - ;; -esac -while getopts "1:23456789o:b:cC:d:g:l:u:L:m:n:p:q:r:s:z:ABS:D:G:I:Vh?" opt -do - case $opt in - b) BPP=$OPTARG;; - c) COLOR=-c;; - d) DUPLEX="$OPTARG";; - g) GSOPTS="$GSOPTS $OPTARG";; - m) MEDIA="$OPTARG";; - n) COPIES="$OPTARG";; - p) PAPER="$OPTARG";; - q) QUALITY="$OPTARG";; - r) RES="$OPTARG";; - s) SOURCE="$OPTARG";; - z) MODEL="$OPTARG";; - l) CLIP_LR="-l $OPTARG";; - u) CLIP_UL="-u $OPTARG";; - L) CLIP_LOG="-L $OPTARG";; - A) AIB=-A;; - B) BC=-B;; - C) COLORMODE="$OPTARG";; - S) COLOR2MONO="-S$OPTARG";; - D) DEBUG="$OPTARG";; - G) GAMMAFILE="$OPTARG";; - I) INTENT="$OPTARG";; - [234689]) NUP="$opt";; - [57]) error "Can't find acceptable layout for $opt-up";; - 1) case "$OPTARG" in - [024568]) NUP="1$OPTARG";; - *) error "Can't find acceptable layout for 1$OPTARG-up";; - esac - ;; - o) case "$OPTARG" in - l*) NUP_ORIENT=-l;; - s*) NUP_ORIENT=-r;; - p*|*) NUP_ORIENT=;; - esac;; - V) echo "$VERSION"; foo2oak -V; foo2zjs-pstops -V; exit 0;; - h|\?) - if [ "$CMDLINE" != "-?" -a "$CMDLINE" != -h ]; then - echo "Illegal command:" - echo " $0 $CMDLINE" - echo - fi - usage;; - esac -done -shift `expr $OPTIND - 1` - -# -# If there is an argument left, take it as the file to print. -# Else, the input comes from stdin. -# -if [ $# -ge 1 ]; then - if [ "$LPJOB" = "" ]; then - : # LPJOB="$1" - fi - exec < $1 -fi - -# -# Select the ghostscript device to use -# -case "$BPP" in -1) if [ "" = "$COLOR" ]; then - GSDEV=-sDEVICE=pbmraw - else - GSDEV=-sDEVICE=bitcmyk - fi - ;; -2) if [ "" = "$COLOR" ]; - then - GSDEV=-sDEVICE=pgmraw - else - GSDEV="-sDEVICE=cups -dcupsColorSpace=6 -dcupsBitsPerColor=2" - fi - ;; -*) error "Illegal number of bits per plane ($BPP)";; -esac - -# -case "$QUALITY" in -0) - GSOPTS="-dCOLORSCREEN $GSOPTS" - ;; -1) - GSOPTS="-dCOLORSCREEN $GSOPTS" - ;; -2) - GSOPTS="-dMaxBitmap=500000000 $GSOPTS" - ;; -as) - GSOPTS="-dCOLORSCREEN -dMaxBitmap=500000000 $GSOPTS" - ;; -wts) - GSOPTS="-dCOLORSCREEN -dMaxBitmap=500000000 $GSOPTS" - ;; -esac - -# -# Validate model code -# -case "$MODEL" in -0) MIRROR=1; ROTATE90=0;; -1) MIRROR=0; ROTATE90=1;; -*) error "Unknown model code $MODEL";; -esac - -# -# Validate media code -# -case "$MEDIA" in -0|auto) MEDIA=0;; -1|plain) MEDIA=1;; -2|preprinted) MEDIA=2;; -3|letterhead) MEDIA=3;; -4|transparency) MEDIA=4;; -5|prepunched) MEDIA=5;; -6|labels) MEDIA=6;; -7|bond) MEDIA=7;; -8|recylcled) MEDIA=8;; -9|color) MEDIA=9;; -10|cardstock) MEDIA=10;; -11|heavy) MEDIA=11;; -12|envelope) MEDIA=12;; -13|light) MEDIA=13;; -14|tough) MEDIA=14;; - -15|vellum) MEDIA=15;; -16|rough) MEDIA=16;; -19|thick) MEDIA=19;; -20|highqual) MEDIA=20;; -[0-9]*) ;; -*) error "Unknown media code $MEDIA";; -esac - -# -# Validate source (InputSlot) code -# -case "$SOURCE" in -1|tray1) SOURCE=1;; -2|tray2) SOURCE=2;; -4|manual|mp) SOURCE=4;; -7|auto) SOURCE=7;; -[0-9]*) ;; -*) error "Unknown source code $SOURCE";; -esac - -# -# Validate Duplex code -# -case "$DUPLEX" in -1|off|none) DUPLEX=1;; -2|long*) DUPLEX=2;; -3|short*) DUPLEX=3;; -[0-9]*) ;; -*) error "Unknown duplex code $DUPLEX";; -esac - -# -# Validate Resolution -# -case "$RES" in -600x600) ;; -1200x600) ;; -2400x600) ;; -*) error "Illegal resolution $RES";; -esac - -# -# Figure out the paper dimensions in pixels/inch, and set the -# default clipping region. -# -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" in -Custom*x*) - # Command line only - XDIM=`echo "$PAPER" | sed -e "s/Custom.//" -e "s/x.*//" ` - YDIM=`echo "$PAPER" | sed -e "s/.*x//" ` - if [ "$XDIM" = "" -o "$YDIM" = "" ]; then - error "Custom page size '$PAPER' != 1-99999" - fi - if [ "$XDIM" -eq 0 -o "$YDIM" -eq 0 ]; then - error "Custom page size '$PAPER' != 1-99999" - fi - XDIM=`dc -e "$XDIM 1200* 72/p"` - YDIM=`dc -e "$YDIM 600* 72/p"` - PAPER=296; paper=letter; - set_clipping 2 100 2 100 - ;; -Custom*) - #%%BeginFeature: *CustomPageSize True - #216 - #360 - #0 - #0 - #0 - #pop pop pop pop pop - - #%%BeginFeature: *CustomPageSize True - #792.000000 612.000000 1 0.000000 0.000000 - #pop pop pop pop pop - - if [ $DEBUG = 0 ]; then - TMPFILE=/tmp/cus$$ - else - TMPFILE=/tmp/custom.ps - fi - cat >$TMPFILE - exec <$TMPFILE - - tmp=`head -n 10000 $TMPFILE \ - | sed -n '/CustomPageSize/{n;p;n;p;}' \ - | tr '\n' ' '` - case "$tmp" in - [0-9]*\ [0-9]*) - XDIM=`echo "$tmp" | sed 's/ .*//'` - YDIM=`echo "$tmp" | sed -e 's/^[^ ]* //' -e 's/ .*//'` - ;; - *) - if [ $DEBUG = 0 ]; then rm -f $TMPFILE; fi - error "Custom page size [XY]DIM != 1-99999" - ;; - esac - XDIM=`dc -e "$XDIM 1200* 72/p"` - YDIM=`dc -e "$YDIM 600* 72/p"` - PAPER=296; paper=letter; - set_clipping 2 100 2 100 - ;; -1|letter) PAPER=1; paper=letter; XDIM="10200"; YDIM="6600" - set_clipping 140 100 140 100 - ;; -3|ledger) PAPER=3; paper=ledger; XDIM="20400"; YDIM="6600" - set_clipping 140 100 140 100 - ;; -5|legal) PAPER=5; paper=legal; XDIM="10200"; YDIM="8400" - set_clipping 140 100 140 100 - ;; -6|statement) PAPER=6; paper=statement; XDIM="6600"; YDIM="5100" - set_clipping 140 100 140 100 - ;; -7|executive) PAPER=7; paper=executive; XDIM="8700"; YDIM="6300" - set_clipping 140 100 140 100 - ;; -8|a3|A3) PAPER=8; paper=a3; XDIM="19842"; YDIM="7014" - set_clipping 160 100 160 100 - ;; -9|a4|A4) PAPER=9; paper=a4; XDIM="9920"; YDIM="7014" - set_clipping 160 100 160 100 - ;; -11|a5|A5) PAPER=11; paper=a5; XDIM="6992"; YDIM="4960" - set_clipping 140 100 140 100 - ;; -12|b4|B4) PAPER=12; paper=b4; XDIM="12142"; YDIM="8598" - set_clipping 140 100 140 100 - ;; -13|b5jis|B5jis) PAPER=13; paper=b5; XDIM="8598"; YDIM="6070" - set_clipping 140 100 140 100 - ;; -14|folio|Folio) PAPER=14; paper=folio; XDIM="9922"; YDIM="7796" - set_clipping 140 100 140 100 - ;; -19|env9|"env#9") - PAPER=19; paper=env9; XDIM="4650"; YDIM="5362" - set_clipping 140 100 140 100 - ;; -20|env10|"env#10") - PAPER=20; paper=env10; XDIM="4950"; YDIM="5700" - set_clipping 140 100 140 100 - ;; -27|envDL) PAPER=27; paper=envDL; XDIM="5200"; YDIM="5200" - set_clipping 140 100 140 100 - ;; -28|envC5) PAPER=28; paper=envC5; XDIM="7650"; YDIM="5408" - set_clipping 140 100 140 100 - ;; -30|envC4) PAPER=30; paper=envC4; XDIM="10818"; YDIM="7654" - set_clipping 140 100 140 100 - ;; -#34|envB5) PAPER=34; paper=envB5; XDIM="8316"; YDIM="5892" -# set_clipping 140 100 140 100 -# ;; -37|envMonarch) PAPER=37; paper=envMonarch;XDIM="4650"; YDIM="4500" - set_clipping 140 100 140 100 - ;; -257|a6|A6) PAPER=257; paper=a6; XDIM="4961"; YDIM="3496" - set_clipping 140 100 140 100 - ;; -258|b6|B6) PAPER=258; paper=b6; XDIM="6048"; YDIM="4300" - set_clipping 140 100 140 100 - ;; -259|b5iso|B5iso) - PAPER=259; paper=b5iso; XDIM="8516"; YDIM="5906" - set_clipping 140 100 140 100 - ;; -260|env6|"env#6") - PAPER=260; paper=env6; XDIM="4356"; YDIM="3900" - set_clipping 140 100 140 100 - ;; -*) error "Unimplemented paper code $PAPER";; -esac -# e.g. /usr/share/ghostscript/7.07/lib/gs_statd.ps -PAPERSIZE="-sPAPERSIZE=$paper"; - - -case "$RES" in -600x600) XDIM=`expr $XDIM / 2`;; -1200x600) ;; -2400x600) XDIM=`expr $XDIM \* 2`;; -esac -if [ $ROTATE90 = 1 ]; then - tmp=$XDIM - XDIM=$YDIM - YDIM=$tmp - case "$RES" in - 600x600) YDIMpoints=`dc -e "6k $YDIM 600 / 72 *p"`;; - 1200x600) YDIMpoints=`dc -e "6k $YDIM 1200 / 72 *p"`;; - 2400x600) YDIMpoints=`dc -e "6k $YDIM 2400 / 72 *p"`;; - esac -fi -DIM="${XDIM}x${YDIM}" - -# -# Filter thru psnup if N-up printing has been requested -# -case $NUP in -[234689]|1[024568]) PREFILTER="nup";; -*) PREFILTER=cat;; -esac -if [ "$DEBUG" -ge 9 ]; then - PREFILTER="tee /tmp/$BASENAME.ps" -fi - -# -# 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) - ;; - *) - if [ -x /usr/bin/logger ]; then - logger -t "$BASENAME" -p lpr.info -- \ - "`basename $ICC2PS` -o $GAMMAFILE -t$INTENT > $ICCTMP.crd.ps" - fi - $ICC2PS -o $GAMMAFILE -t$INTENT > $ICCTMP.crd.ps 2>$ICCTMP.log \ - || error "Problem converting .ICM file to Postscript" - ;; - esac - - PSTOPS_OPTS="$PSTOPS_OPTS -c" - cat > $ICCTMP.usecie.ps <<-EOF - %!PS-Adobe-3.0 - <>setpagedevice - EOF - if [ "$QUALITY" = wts -o "$QUALITY" = as ]; then - if [ "$QUALITY" = wts ]; then - cat >> $ICCTMP.usecie.ps <<-EOF - << /UseWTS true >> setuserparams - EOF - else - cat >> $ICCTMP.usecie.ps <<-EOF - << /UseWTS false >> setuserparams - EOF - fi - cat >> $ICCTMP.usecie.ps <<-EOF - << - /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 - GAMMAFILE= - fi -} - -if [ $DEBUG -gt 0 ]; then - ICCTMP=/tmp/icc -else - ICCTMP=/tmp/icc$$ -fi - -if [ "" = "$COLOR" ]; then - COLORMODE= - GAMMAFILE= -else - case "$COLORMODE" in - default) COLORMODE=$DEFAULTCOLORMODE;; - esac - case "$GAMMAFILE" in - default) GAMMAFILE=hpclj2500rgb.icm;; - esac -fi - -PSTOPS_OPTS="-n" -if [ $ROTATE90 = 1 ]; then - case $paper in - a3) ;; - ledger) ;; - *) PSTOPS_OPTS="$PSTOPS_OPTS -h $YDIMpoints -r";; - esac -fi - -case "$COLORMODE" in -0|"") - # 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 -esac - -if [ "$COLOR" != "" -a "$QUALITY" = wts ]; then - PSTOPS_OPTS="$PSTOPS_OPTS -w" -elif [ "$COLOR" != "" -a "$QUALITY" = as ]; then - PSTOPS_OPTS="$PSTOPS_OPTS -a" -fi - -if [ "" != "$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 - fi -fi - -# -# 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" - -foo2zjs-pstops $PSTOPS_OPTS | \ -$PREFILTER \ -| ($GS $PAPERSIZE -g$DIM -r$RES $GSDEV $GSOPTS \ - -sOutputFile="|cat 1>&3" $GAMMAFILE -_ >/dev/null 2>/dev/null) 3>&1 \ -| foo2oak -r$RES -g$DIM -p$PAPER -m$MEDIA -n$COPIES -d$DUPLEX -s$SOURCE \ - -z$MODEL -M$MIRROR $COLOR -b$BPP $CLIP_UL $CLIP_LR $CLIP_LOG \ - -J "$LPJOB" -U "$USER" \ - $BC $AIB $COLOR2MONO -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 -- \ - "foo2oak -r$RES -g$DIM -p$PAPER -m$MEDIA \ --n$COPIES -d$DUPLEX -s$SOURCE -z$MODEL -M$MIRROR $COLOR -b$BPP \ -$CLIP_UL $CLIP_LR $CLIP_LOG \ -$BC $AIB $COLOR2MONO" -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 -fi - -exit 0 diff --git a/foo2oak-wrapper.1 b/foo2oak-wrapper.1 deleted file mode 100644 index 749a3e1..0000000 --- a/foo2oak-wrapper.1 +++ /dev/null @@ -1,403 +0,0 @@ -'\" t -'\" -'\" DO NOT EDIT! This file is generated from foo2oak-wrapper.1in -'\" -'\" t -.TH foo2oak-wrapper 1 "Sun May 26 18:25:20 2024" "foo2oak-wrapper 0.0" -'\" -'\" -'\"========================================================================== -'\" STRINGS and MACROS -'\"========================================================================== -'\" -'\" Define strings for special characters that nroff doesn't have -'\" -'\" N.B. using .if cua to test for special characters did not work. -'\" -.if !'\*[.T]'ps' .ds ua up -.if '\*[.T]'ps' .ds ua \(ua -.if !'\*[.T]'ps' .ds da down -.if '\*[.T]'ps' .ds da \(da -.if !'\*[.T]'ps' .ds <- left -.if '\*[.T]'ps' .ds <- \(<- -.if !'\*[.T]'ps' .ds -> right -.if '\*[.T]'ps' .ds -> \(-> -'\" -'\" bx - box a Courier string for making keycaps -'\" -'\" N.B. this mess is to make the line drawing come out only -'\" if we are really generating postscript -'\" -.de bx -.ie !'\*[.T]'ps' \{\ -. RB [ \\$1 ]\\$2 -.\} -.el \{\ -. ie !r ps4html \{\ -'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul' -. ft CW -. nr par*bxw \w'\\$1'+.4m -\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\ -\Z'\h'.2m'\s-1\\$1\s+1'\ -\h'\\n[par*bxw]u'\\$2 -. ft P -. \} -. el \{\ -. RB [ \\$1 ]\\$2 -. \} -.\} -.. -'\" -'\" strings to set current color (null with old groff) -'\" -.if mred .ds red \m[red] -.if mgreen .ds green \m[green] -.if mblue .ds blue \m[blue] -.if mblack .ds black \m[black] -.if mblack .ds mP \mP -'\" -'\" fix for grotty + xterm. We call for orange, grotty outputs yellow, -'\" but xterm displays yellow as orange. The cycle is complete. -'\" -.if n .defcolor orange rgb #ffff00 -'\" -'\" color - set the current color (ignores request with old groff) -'\" -.de color -.if mred \m[\\$1]\c -.. -'\" -'\" colorword - colorize a word (ignored by old groff) -'\" -.de colorword -.ie m\\$1 \m[\\$1]\\$2\mP\c -.el \\$2\c -.. -'\" -'\" colbox - colorize a word in a filled box -'\" -.de colbox -.ie mred \M[\\$2]\ -\v'+.167v'\ -\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\ -\v'-.167v'\ -\m[\\$1]\\$3\mP\MP -.el \\$3\c -.. -'\" -'\" Macros for doing pdfmarks -'\" -.de specialps -.if '\*[.T]'ps' \\k_\X'ps: \\$*'\h'|\\n_u'\c -.. -'\" -'\" pdfmark PDFMARKCODE -'\" -.ds pdfmarks -.if d pdfmarks \{\ -.de pdfmark -. specialps exec [\\$1 pdfmark -.. -'\" -'\" pdfdest LINKNAME -'\" -.de pdfdest -.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST" -.. -'\" -'\" pdfbookmark COUNT LINKNAME STRING -'\" -.de pdfbookmark -. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT" -.. -'\" -'\" Define the SH and SS macros to save pdfmark information -'\" in "arrays" of numbers and strings. -'\" -.if !r rr_n \{\ -.nr rr_n 0 1 -.am SH -. nr rr_levels!\\n+[rr_n] 2 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.am SS -. nr rr_levels!\\n+[rr_n] 3 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.\} -'\" -'\" Called at the end of the document to generate the pdfmark outline -'\" -.de pdf_outline -.nr rr_levels!\\n+[rr_n] 1 -.nr rr_i 0 1 -.while \\n+[rr_i]<\\n[rr_n] \{\ -. nr rr_ip1 \\n[rr_i]+1 -. nr rr_count 0 -. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\ -. nr rr_j \\n[rr_i] 1 -. while \\n+[rr_j]<\\n[rr_n] \{\ -. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\ -. break -. \} -. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\ -. nr rr_count \\n[rr_count]+1 -. \} -. \} -. \} -. ds hhh \\*[rr_labels!\\n[rr_i]] -. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]" -.\} -.. -'\" -'\" Some postscript to make pdfmarks harmless on old interpreters... -'\" -.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse" -'\" -'\" Force display of Bookmarks in Acrobat when document is viewed. -'\" -.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW" -'\" -'\" Output the document info in pdfmarks -'\" -.pdfmark "\ - /Title (\*[an-title](\*[an-section])) \ - /Subject (\*[an-title] Manual Page) \ - /Author (Rick Richardson) \ - /Keywords (printing) \ - /Creator (groff \n(.x.\n(.y.\n(.Y -man) \ - /CreationDate (\*[an-extra1]) \ - /ModDate (\*[an-extra1]) \ - /DOCINFO" -\} -'\" -'\" The manual page name is only 1st level mark -'\" -.nr rr_levels!\n+[rr_n] 1 -.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section]) -.pdfdest Link\n[rr_n] -'\" -'\"========================================================================== -'\" MANUAL PAGE SOURCE -'\"========================================================================== -.SH NAME -foo2oak-wrapper \- Convert Postscript into an OAKT printer stream -.SH SYNOPSIS -.B foo2oak-wrapper -.RI [ options "] [" ps-file ] -.SH DESCRIPTION -.B foo2oak-wrapper -is a Foomatic compatible printer wrapper for the \fBfoo2oak\fP printer driver. -This script reads a Postscript \fIps-file\fP or standard input -and converts it to Oak Technology OAKT printer format -for driving the HP Color LaserJet 1500 laser printer, -Kyocera KM-1636/KM-2035 copiers, -and other OAKT-based printers. -.P -This script can be used in a standalone fashion, but is intended to -be called from a printer spooler system which uses the Foomatic -printer database. - -.SH COMMAND LINE OPTIONS -.SS Normal Options -These are the options used to select the parameters of a -print job that are usually controlled on a per job basis. -.TP -.BI \-b\0 bits -Number of bits per plane (1 or 2) [1]. -.TP -.BI \-c -Print in color (else monochrome). -.TP -.BI \-d\0 duplex -Duplex code to send to printer [1]. -.TS -| n l | n l | n l . -1 off 2 long edge 3 short edge -.TE -.TP -.BI \-m\0 media -Media code to send to printer [1]. -.TS -l l l -l n n. -_ -Media HP CLJ 1500 KM-1635 - -z0 -z1 -_ -autoselect 0 0 -plain 1 1 -preprinted 2 2 -letterhead 3 3 -transparency 4 4 -prepunched 5 5 -labels 6 6 -bond 7 7 -recycled 8 8 -color 9 9 -cardstock 10 10 -envelope 11 11 -light 13 na -tough 14 na -vellum na 15 -rough na 16 -thick na 19 -highqual na 20 -.TE -.TP -.BI \-p\0 paper -Paper size code to send to printer [1]. -.TS -box; -| n l | n l. -1 letter 3 ledger -5 legal 6 statement -7 executive 8 A3 -9 A4 11 A5 -12 B4 13 B5jis -14 folio 19 env9 -20 env10 27 envDL -28 envC5 30 envC4 -37 envMonarch 257 A6 -258 B6 259 B5iso -260 env6 -.TE -.TP -.BI \-n\0 copies -Number of copies [1]. -.TP -.BI \-r\0 xres x yres -Set device resolution in pixels/inch [600x600]. -.TP -.BI \-s\0 source -Source (Input Slot) code to send to printer [7]. -.TS -| n l | n l. -1 tray1 2 tray2 -4 manual 7 auto -.TE -.TP -.BI "\-2 \-3 \-4 \-5 \-6 \-8 \-9 \-10 \-12 \-14 \-15 \-16 \-18" -Print in N-up. Requires the \fBpsutils\fP package. -.TP -.BI \-o\0 orient -Orientation used for N-up. -.TS -l l l. -Portrait -op (normal) -Landscape -ol (rotated 90 degrees anticlockwise) -Seascape -os (rotated 90 degrees clockwise) -.TE -.SS Printer Tweaking Options -These are the options used to customize the operation of \fBfoo2oak\fP -for a particular printer. -.TP -.BI \-u\0 xoff x yoff -Set the offset of the start of the printable region from the -upper left corner, in pixels [varies with paper size]. -The defaults should work on the 2200DL and 2300DL, and have not -been tested on any other printers. -.TP -.BI \-l\0 xoff x yoff -Set the offset of the end of the printable region from the -lower right corner, in pixels [varies with paper size]. -The defaults should work on the 2200DL and 2300DL, and have not -been tested on any other printers. -.TP -.BI \-L\0 mask -Send the logical clipping values from -u/-l in the OAKT stream. -\fBfoo2oak-wrapper\fP always runs Ghostscript with the ideal page dimensions, -so that the scale of the image is correct, -regardless whether or not the printer has unprintable regions. -This option is used to move the position of the clipped image -back to where it belongs on the page. The default is to send -the amount which was clipped by -u and -l, and should be -good in most cases. -.TS -l l. -0 don't send any logical clipping amounts -1 only send Y clipping amount -2 only send X clipping amount -3 send both X and Y clipping amounts -.TE -.TP -.BI \-z\0 model -Model is 0 for the HP Color LaserJet 1500, -and 1 for the Kyocera KM-1635/KM-2035 copiers. The default is 0. -.SS Color Tweaking Options -These are the options used to control the quality of color output. -Color correction is currently a WORK IN PROGRESS. -.TP -.BI \-g\0 gsopts -Additional options to pass to Ghostscript, such as -g\(lq-dDITHERPPI=nnn\(rq, -etc. This option may appear more than once. -.TP -.BI \-G\0 profile.icm -Convert \fIprofile.icm\fP to a Postscript color rendering -dictionary (CRD) using \fBfoo2zjs-icc2ps\fP and -adjust the printer colors by using the Postscript \fBsetcolorrendering\fP -operator. (WORK IN PROGRESS). -.TP -.BI \-G\0 gamma-file.ps -Prepend \fIgamma-file.ps\fP to the Postscript input to perform -color correction using the \fBsetcolortransfer\fP Postscript operator. -For example, the file might contain: -.br -{0.333 exp} {0.333 exp} {0.333 exp} {0.333 exp} setcolortransfer -.TP -.BI \-I\0 intent -Select profile intent from the ICM file. -0=Perceptual, 1=Colorimetric, 2=Saturation, 3=Absolute. -Default is 0 (perceptual). -.SS Debugging Options -These options are used for debugging \fBfoo2oak\fP and its wrapper. -.TP -.BI \-S\0 plane -Output just a single color plane from a color print and print it -on the black plane. The default is to output all color planes. -.TS -l l. -1 Cyan -2 Magenta -3 Yellow -4 Black -.TE -.TP -.BI \-D\0 level -Set Debug level [0]. - -.SH EXAMPLES -Create a monochrome OAKT stream from a Postscript document, -examine it, and then print it using a RAW print queue: - -.RS -.nf -foo2oak-wrapper testpage.ps > testpage.oak -oakdecode < testpage.oak -lpr -P raw testpage.oak -.fi -.RE -.P -Create a color OAKT stream from a Postscript document: - -.RS -.nf -foo2oak-wrapper -c testpage.ps > testpage.oak -.fi -.RE - -.SH FILES -.BR /usr/bin/foo2oak-wrapper -.SH SEE ALSO -.BR foo2oak (1), -.BR oak (1) -.SH "AUTHOR" -Rick Richardson -.br -http://foo2oak.rkkda.com/ -'\" -'\" -'\" -.em pdf_outline diff --git a/foo2oak-wrapper.1in b/foo2oak-wrapper.1in index 435dae3..bbf1d23 100644 --- a/foo2oak-wrapper.1in +++ b/foo2oak-wrapper.1in @@ -49,7 +49,7 @@ l l l l n n. _ Media HP CLJ 1500 KM-1635 - -z0 -z1 + \-z0 \-z1 _ autoselect 0 0 plain 1 1 @@ -110,9 +110,9 @@ Print in N-up. Requires the \fBpsutils\fP package. Orientation used for N-up. .TS l l l. -Portrait -op (normal) -Landscape -ol (rotated 90 degrees anticlockwise) -Seascape -os (rotated 90 degrees clockwise) +Portrait \-op (normal) +Landscape \-ol (rotated 90 degrees anticlockwise) +Seascape \-os (rotated 90 degrees clockwise) .TE .SS Printer Tweaking Options These are the options used to customize the operation of \fBfoo2oak\fP @@ -131,13 +131,13 @@ The defaults should work on the 2200DL and 2300DL, and have not been tested on any other printers. .TP .BI \-L\0 mask -Send the logical clipping values from -u/-l in the OAKT stream. +Send the logical clipping values from \-u/-l in the OAKT stream. \fBfoo2oak-wrapper\fP always runs Ghostscript with the ideal page dimensions, so that the scale of the image is correct, regardless whether or not the printer has unprintable regions. This option is used to move the position of the clipped image back to where it belongs on the page. The default is to send -the amount which was clipped by -u and -l, and should be +the amount which was clipped by \-u and \-l, and should be good in most cases. .TS l l. @@ -155,7 +155,7 @@ These are the options used to control the quality of color output. Color correction is currently a WORK IN PROGRESS. .TP .BI \-g\0 gsopts -Additional options to pass to Ghostscript, such as -g\(lq-dDITHERPPI=nnn\(rq, +Additional options to pass to Ghostscript, such as \-g\(lq-dDITHERPPI=nnn\(rq, etc. This option may appear more than once. .TP .BI \-G\0 profile.icm @@ -200,7 +200,7 @@ examine it, and then print it using a RAW print queue: .nf foo2oak-wrapper testpage.ps > testpage.oak oakdecode < testpage.oak -lpr -P raw testpage.oak +lpr \-P raw testpage.oak .fi .RE .P @@ -208,7 +208,7 @@ Create a color OAKT stream from a Postscript document: .RS .nf -foo2oak-wrapper -c testpage.ps > testpage.oak +foo2oak-wrapper \-c testpage.ps > testpage.oak .fi .RE diff --git a/foo2oak-wrapper.in b/foo2oak-wrapper.in index 033eade..bf5ec1f 100755 --- a/foo2oak-wrapper.in +++ b/foo2oak-wrapper.in @@ -13,8 +13,8 @@ #* GNU General Public License for more details. #* #* You should have received a copy of the GNU General Public License -#* along with this program; if not, write to the Free Software -#* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +#* along with this program; if not, see +#* . #* #* Authors: Rick Richardson diff --git a/foo2oak.1 b/foo2oak.1 deleted file mode 100644 index af08624..0000000 --- a/foo2oak.1 +++ /dev/null @@ -1,376 +0,0 @@ -'\" t -'\" -'\" DO NOT EDIT! This file is generated from foo2oak.1in -'\" -'\" t -.TH foo2oak 1 "Sun May 26 18:25:20 2024" "foo2oak 0.0" -'\" -'\" -'\"========================================================================== -'\" STRINGS and MACROS -'\"========================================================================== -'\" -'\" Define strings for special characters that nroff doesn't have -'\" -'\" N.B. using .if cua to test for special characters did not work. -'\" -.if !'\*[.T]'ps' .ds ua up -.if '\*[.T]'ps' .ds ua \(ua -.if !'\*[.T]'ps' .ds da down -.if '\*[.T]'ps' .ds da \(da -.if !'\*[.T]'ps' .ds <- left -.if '\*[.T]'ps' .ds <- \(<- -.if !'\*[.T]'ps' .ds -> right -.if '\*[.T]'ps' .ds -> \(-> -'\" -'\" bx - box a Courier string for making keycaps -'\" -'\" N.B. this mess is to make the line drawing come out only -'\" if we are really generating postscript -'\" -.de bx -.ie !'\*[.T]'ps' \{\ -. RB [ \\$1 ]\\$2 -.\} -.el \{\ -. ie !r ps4html \{\ -'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul' -. ft CW -. nr par*bxw \w'\\$1'+.4m -\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\ -\Z'\h'.2m'\s-1\\$1\s+1'\ -\h'\\n[par*bxw]u'\\$2 -. ft P -. \} -. el \{\ -. RB [ \\$1 ]\\$2 -. \} -.\} -.. -'\" -'\" strings to set current color (null with old groff) -'\" -.if mred .ds red \m[red] -.if mgreen .ds green \m[green] -.if mblue .ds blue \m[blue] -.if mblack .ds black \m[black] -.if mblack .ds mP \mP -'\" -'\" fix for grotty + xterm. We call for orange, grotty outputs yellow, -'\" but xterm displays yellow as orange. The cycle is complete. -'\" -.if n .defcolor orange rgb #ffff00 -'\" -'\" color - set the current color (ignores request with old groff) -'\" -.de color -.if mred \m[\\$1]\c -.. -'\" -'\" colorword - colorize a word (ignored by old groff) -'\" -.de colorword -.ie m\\$1 \m[\\$1]\\$2\mP\c -.el \\$2\c -.. -'\" -'\" colbox - colorize a word in a filled box -'\" -.de colbox -.ie mred \M[\\$2]\ -\v'+.167v'\ -\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\ -\v'-.167v'\ -\m[\\$1]\\$3\mP\MP -.el \\$3\c -.. -'\" -'\" Macros for doing pdfmarks -'\" -.de specialps -.if '\*[.T]'ps' \\k_\X'ps: \\$*'\h'|\\n_u'\c -.. -'\" -'\" pdfmark PDFMARKCODE -'\" -.ds pdfmarks -.if d pdfmarks \{\ -.de pdfmark -. specialps exec [\\$1 pdfmark -.. -'\" -'\" pdfdest LINKNAME -'\" -.de pdfdest -.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST" -.. -'\" -'\" pdfbookmark COUNT LINKNAME STRING -'\" -.de pdfbookmark -. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT" -.. -'\" -'\" Define the SH and SS macros to save pdfmark information -'\" in "arrays" of numbers and strings. -'\" -.if !r rr_n \{\ -.nr rr_n 0 1 -.am SH -. nr rr_levels!\\n+[rr_n] 2 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.am SS -. nr rr_levels!\\n+[rr_n] 3 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.\} -'\" -'\" Called at the end of the document to generate the pdfmark outline -'\" -.de pdf_outline -.nr rr_levels!\\n+[rr_n] 1 -.nr rr_i 0 1 -.while \\n+[rr_i]<\\n[rr_n] \{\ -. nr rr_ip1 \\n[rr_i]+1 -. nr rr_count 0 -. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\ -. nr rr_j \\n[rr_i] 1 -. while \\n+[rr_j]<\\n[rr_n] \{\ -. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\ -. break -. \} -. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\ -. nr rr_count \\n[rr_count]+1 -. \} -. \} -. \} -. ds hhh \\*[rr_labels!\\n[rr_i]] -. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]" -.\} -.. -'\" -'\" Some postscript to make pdfmarks harmless on old interpreters... -'\" -.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse" -'\" -'\" Force display of Bookmarks in Acrobat when document is viewed. -'\" -.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW" -'\" -'\" Output the document info in pdfmarks -'\" -.pdfmark "\ - /Title (\*[an-title](\*[an-section])) \ - /Subject (\*[an-title] Manual Page) \ - /Author (Rick Richardson) \ - /Keywords (printing) \ - /Creator (groff \n(.x.\n(.y.\n(.Y -man) \ - /CreationDate (\*[an-extra1]) \ - /ModDate (\*[an-extra1]) \ - /DOCINFO" -\} -'\" -'\" The manual page name is only 1st level mark -'\" -.nr rr_levels!\n+[rr_n] 1 -.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section]) -.pdfdest Link\n[rr_n] -'\" -'\"========================================================================== -'\" MANUAL PAGE SOURCE -'\"========================================================================== -.SH NAME -foo2oak \- Convert Ghostscript pbmraw, pgmraw or bitcmyk format into an -OAKT printer stream -.SH SYNOPSIS -.B foo2oak -.RI [ options "] <" pbmraw-file " >" OAKT-file -.sp 1 -.B foo2oak -.RI [ options "] <" pgmraw-file " >" OAKT-file -.sp 1 -.B foo2oak -.RI [ options "] <" bitcmyk-file " >" OAKT-file -.SH DESCRIPTION -.B foo2oak -converts Ghostscript pbmraw or bitcmyk output formats to monochrome -or color OAKT streams, -for driving the HP Color LaserJet 1500 laser printer, -Kyocera KM-1636/KM-2035 copiers, -and other OAKT-based printers. - -.SH COMMAND LINE OPTIONS -.SS Normal Options -These are the options used to select the parameters of a -print job that are usually controlled on a per job basis. -.TP -.BI \-c -Force color mode if autodetect doesn't work. -.TP -.BI \-d\0 duplex -Duplex code to send to printer [1]. -.TS -| n l | n l | n l . -1 off 2 long edge 3 short edge -.TE -.TP -.BI \-g\0 xpix x ypix -Set page dimensions in pixels [10200x6600]. -.TP -.BI \-m\0 media -Media code to send to printer [1]. -.TS -l l -l n. -_ -Media Code -_ -autoselect 0 -plain 1 -preprinted 2 -letterhead 3 -transparency 4 -prepunched 5 -labels 6 -bond 7 -recycled 8 -color 9 -cardstock 10 -envelope 11 -light 13 -tough 14 -vellum 15 -rough 16 -thick 19 -highqual 20 -.TE -.TP -.BI \-p\0 paper -Paper code to send to printer [1]. -.TS -box; -| n l | n l. -1 letter 3 ledger -5 legal 6 statement -7 executive 8 A3 -9 A4 11 A5 -12 B4 13 B5jis -14 folio 19 env9 -20 env10 27 envDL -28 envC5 30 envC4 -37 envMonarch 257 A6 -258 B6 259 B5iso -260 env6 -.TE -.TP -.BI \-n\0 copies -Number of copies [1]. -.TP -.BI \-r\0 xres x yres -Set device resolution in pixels/inch [600x600]. -.TP -.BI \-s\0 source -Source (InputSlot) code to send to printer [7]. -.TS -| n l | n l. -1 tray1 2 tray2 -4 manual 7 auto -.TE -.TP -.BI \-J\0 filename -Filename string to send to printer. -.TP -.BI \-U\0 username -Username string to send to printer. -.SS Printer Tweaking Options -These are the options used to customize the operation of \fBfoo2oak\fP -for a particular printer. -.TP -.BI \-u\0 xoff x yoff -Set the offset of the start of the printable region from the -upper left corner, in pixels [0x0]. -.TP -.BI \-l\0 xoff x yoff -Set the offset of the end of the printable region from the -lower right corner, in pixels [0x0]. -.TP -.BI \-L\0 mask -Send logical clipping amounts implied by -u/-l in the OAKT stream [3]. -.TS -l l. -0 don't send any logical clipping amounts -1 only send Y clipping amount -2 only send X clipping amount -3 send both X and Y clipping amounts -.TE -.TP -.BI \-A -AllIsBlack: convert C=1,M=1,Y=1 to just K=1. Works with bitcmyk input only. -.TP -.BI \-B -BlackClears: K=1 forces C,M,Y to 0. Works with bitcmyk input only. -.TP -.BI \-M\0 mirror -Mirror bytes. Mirror is 0 for Kyocera KM-1635/KM-2035 and 1 for the -HP Color LaserJet 1500. The default is 1. -.TP -.BI \-z\0 model -Model is 0 for the HP Color LaserJet 1500, -and 1 for the Kyocera KM-1635/KM-2035 copiers. -The default is 0. -.SS Debugging Options -These options are used for debugging \fBfoo2oak\fP. -.TP -.BI \-S\0 plane -Output just a single color plane from a color print and print it -on the black plane. The default is to output all color planes. -.TS -l l. -1 Cyan -2 Magenta -3 Yellow -4 Black -.TE -.TP -.BI \-D\0 level -Set Debug level [0]. - -.SH EXAMPLES -Create a black and white OAKT stream: - -.RS -.nf -gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE \ - -sPAPERSIZE=letter -r600x600 -sDEVICE=pbmraw \ - -sOutputFile=- - < testpage.ps \ -| foo2oak -r600x600 -g5100x6600 -p1 >testpage.oak -.fi -.RE -.P -Create a color OAKT stream: - -.RS -.nf -gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE \ - -sPAPERSIZE=letter -g5100x6600 -r600x600 -sDEVICE=bitcmyk \ - -sOutputFile=- - < testpage.ps \ -| foo2oak -r600x600 -g5100x6600 -p1 >testpage.oak -.fi -.RE - -.SH FILES -.BR /usr/bin/foo2oak -.SH SEE ALSO -.BR foo2oak-wrapper (1), -.BR oakdecode (1) -.SH "AUTHOR" -Rick Richardson -.br -http://foo2oak.rkkda.com/ -'\" -'\" -'\" -.em pdf_outline diff --git a/foo2oak.1in b/foo2oak.1in index 1a1c863..94b3ed6 100644 --- a/foo2oak.1in +++ b/foo2oak.1in @@ -122,7 +122,7 @@ Set the offset of the end of the printable region from the lower right corner, in pixels [0x0]. .TP .BI \-L\0 mask -Send logical clipping amounts implied by -u/-l in the OAKT stream [3]. +Send logical clipping amounts implied by \-u/-l in the OAKT stream [3]. .TS l l. 0 don't send any logical clipping amounts @@ -167,10 +167,10 @@ Create a black and white OAKT stream: .RS .nf -gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE \ - -sPAPERSIZE=letter -r600x600 -sDEVICE=pbmraw \ - -sOutputFile=- - < testpage.ps \ -| foo2oak -r600x600 -g5100x6600 -p1 >testpage.oak +gs \-q \-dBATCH \-dSAFER \-dQUIET \-dNOPAUSE \ + \-sPAPERSIZE=letter \-r600x600 \-sDEVICE=pbmraw \ + \-sOutputFile=- \- < testpage.ps \ +| foo2oak \-r600x600 \-g5100x6600 \-p1 >testpage.oak .fi .RE .P @@ -178,10 +178,10 @@ Create a color OAKT stream: .RS .nf -gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE \ - -sPAPERSIZE=letter -g5100x6600 -r600x600 -sDEVICE=bitcmyk \ - -sOutputFile=- - < testpage.ps \ -| foo2oak -r600x600 -g5100x6600 -p1 >testpage.oak +gs \-q \-dBATCH \-dSAFER \-dQUIET \-dNOPAUSE \ + \-sPAPERSIZE=letter \-g5100x6600 \-r600x600 \-sDEVICE=bitcmyk \ + \-sOutputFile=- \- < testpage.ps \ +| foo2oak \-r600x600 \-g5100x6600 \-p1 >testpage.oak .fi .RE diff --git a/foo2oak.c b/foo2oak.c index 0a40d1e..65acdfc 100644 --- a/foo2oak.c +++ b/foo2oak.c @@ -36,8 +36,8 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +along with this program; if not, see +. If you want to use this program under different license conditions, then contact the author for an arrangement. @@ -65,7 +65,7 @@ Status: 0x18 * TODO: Handle 2 bit mono and color output */ -static char Version[] = "$Id: foo2oak.c,v 1.69 2011/11/08 20:25:27 rick Exp $"; +static char Version[] = "$Id: foo2oak.c,v 1.70 2018/05/04 18:16:50 rick Exp $"; #include #include @@ -487,7 +487,8 @@ start_doc(FILE *fp) if (Model == MODEL_KM1635) { memset(&recdriver, 0, sizeof(recdriver)); - strncpy(recdriver.string, Version+5, 36); + strncpy(recdriver.string, Version+5, sizeof(recdriver.string) - 1); + recdriver.string[sizeof(recdriver.string) - 1] = 0; oak_record(fp, OAK_TYPE_DRIVER, &recdriver, sizeof(recdriver)); } memset(&recother, 0, sizeof(recother)); diff --git a/foo2qpdl b/foo2qpdl deleted file mode 100755 index f2ee3eb..0000000 Binary files a/foo2qpdl and /dev/null differ diff --git a/foo2qpdl-wrapper b/foo2qpdl-wrapper deleted file mode 100755 index 2d9993b..0000000 --- a/foo2qpdl-wrapper +++ /dev/null @@ -1,756 +0,0 @@ -#!/bin/sh - -#* Copyright (C) 2003-2006 Rick Richardson -#* -#* This program is free software; you can redistribute it and/or modify -#* it under the terms of the GNU General Public License as published by -#* the Free Software Foundation; either version 2 of the License, or -#* (at your option) any later version. -#* -#* This program is distributed in the hope that it will be useful, -#* but WITHOUT ANY WARRANTY; without even the implied warranty of -#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -#* GNU General Public License for more details. -#* -#* You should have received a copy of the GNU General Public License -#* along with this program; if not, write to the Free Software -#* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#* -#* Authors: Rick Richardson - -VERSION='$Id: foo2qpdl-wrapper.in,v 1.57 2014/01/27 02:34:29 rick Exp $' - -# -# Printer Notes: -# -# Samsung CLP-300: -z0, ICM -# Samsung CLP-310: -z2, ICM -# Samsung CLP-315: -z2, ICM -# Samsung CLP-325: -z2, ICM alpha -# Samsung CLP-365: -z3, ICM alpha -# Samsung CLP-600: -z1, CRD, need ICM for black text -# Samsung CLP-610: -z2, CRD, need ICM for black text -# Samsung CLP-620: -z3, CRD, need ICM for black text -# Samsung CLX-2160: -z0, ICM -# Samsung CLX-3160: -z0, ICM -# Samsung CLX-3175: -z2, ICM -# Samsung CLX-3185: -z2, ICM alpha -# Xerox Phaser 6110: -z0, ICM -# Xerox Phaser 6110MFP: -z0, ICM -# - -PROGNAME="$0" -BASENAME=`basename $PROGNAME` -PREFIX=/usr -SHARE=$PREFIX/share/foo2qpdl -PATH=$PATH:/sw/bin:/opt/local/bin - -# -# Log the command line, for debugging and problem reports -# -if [ -x /usr/bin/logger -o -x /bin/logger ]; then - logger -t "$BASENAME" -p lpr.info -- "$BASENAME $@" x Set device resolution in pixels/inch [$RES] --s source Source code to send to printer [$SOURCE] - 1=upper, 2=lower, 4=manual, 7=auto - Code numbers may vary with printer model. --t Draft mode. Every other pixel is white. --2/-3/-4/-6/-8/-10/-12/-14/-15/-16/-18 - Print with N-up (requires psutils) --o orient For N-up: -op is portrait, -ol is landscape, -os is seascape. - -Printer Tweaking Options: --u x Set offset of upper left printable in pixels [varies] --l x Set offset of lower right printable in pixels [varies] --L mask Send logical clipping values from -u/-l in ZjStream [3] - 0=no, 1=Y, 2=X, 3=XY --P Do not output START_PLANE codes. May be needed by some - monochrome-only printers. --X padlen Add extra zero padding to the end of BID segments [16] --z model Printer Model [$MODEL] - 0=CLP-300, CLX-2160, CLX-3160 - 1=CLP-600 - 2=CLP-310, CLP-315, CLP-610, CLX-3175 - 3=CLP-620, CLP-360, CLP-365 - -Color Tweaking Options: --a parm=val Color Adjust. "parm" is b,c,s,cr,mg,yb. "val" is 0-100 --g gsopts Additional options to pass to Ghostscript, such as - -dDITHERPPI=nnn, etc. May appear more than once. [] --G profile.icm Convert profile.icm to a Postscript CRD using icc2ps and - adjust colors using the setcolorrendering PS operator. - $SHARE/icm/ will be searched for profile.icm. --I intent Select profile intent from ICM file [$INTENT] - 0=Perceptual, 1=Colorimetric, 2=Saturation, 3=Absolute --G gamma-file.ps Prepend gamma-file to the Postscript input to perform - color correction using the setcolortransfer PS operator. - -Debugging Options: --S plane Output just a single color plane from a color print [all] - 1=Cyan, 2=Magenta, 3=Yellow, 4=Black --D lvl Set Debug level [$DEBUG] --V $VERSION -EOF - - exit 1 -} - -# -# Report an error and exit -# -error() { - echo "$BASENAME: $1" >&2 - exit 1 -} - -dbgcmd() { - if [ $DEBUG -ge 1 ]; then - echo "$@" >&2 - fi - "$@" -} - -# -# N-up-ify the job. Requires psnup from psutils package -# -nup() { - case "$NUP" in - [2368]|1[0458]) - tr '\r' '\n' | psnup $NUP_ORIENT -d2 -$NUP -m.3in -p$paper -q - ;; - [49]|1[26]) - tr '\r' '\n' | psnup $NUP_ORIENT -d2 -$NUP -m.5in -p$paper -q - ;; - *) - error "Illegal call to nup()." - ;; - esac -} - -# -# Process the options -# - -# Try to use a local copy of GhostScript 8.54, if available. Otherwise, -# fallback to whatever the Linux distro has installed (usually 7.07) -# -# N.B. := operator used here, when :- would be better, because "ash" -# doesn't have :- -if eval gs.foo -v >/dev/null 2>&1; then - GSBIN=${GSBIN:-gs.foo} -else - GSBIN=${GSBIN:-gs} -fi - -CMDLINE="$*" -DEBUG=0 -DUPLEX=1 -COLOR= -COLORMODE=default -MODEL=0 -QUALITY=1 -QUALITY=wts -MEDIA=0 -COPIES=1 -PAPER=0 -RES=1200x600 -SOURCE=1 -NUP= -CLIP_UL= -CLIP_LR= -CLIP_LOG= -BC= -AIB= -NOPLANES= -COLOR2MONO= -GAMMAFILE=default -INTENT=0 -GSOPTS= -EXTRAPAD= -SAVETONER= -NUP_ORIENT= -CA_B=50 #Color Adjust Brightness -CA_C=50 #Color Adjust Contrast -CA_S=50 #Color Adjust Saturation -CA_CR=50 #Color Adjust Cyan-Red Balance -CA_MG=50 #Color Adjust Magenta-Green Balance -CA_YB=50 #Color Adjust Yellow-Blue Balance -GSDEV=-sDEVICE=pbmraw -# What mode to use if the user wants us to pick the "best" mode -case `$GSBIN --version` in -7*) DEFAULTCOLORMODE=10 - DEFAULTCOLORMODE=1 - ;; -8.1*) - DEFAULTCOLORMODE=1 - QUALITY=1 - ;; -*) DEFAULTCOLORMODE=1 - ;; -esac -while getopts "1:23456789o:a:b:cC:d:g:l:u:L:m:n:p:q:r:s:tz:ABS:D:G:I:PX:Vh?" opt -do - case $opt in - a) case "$OPTARG" in - b=*|B=*) CA_B=`echo "$OPTARG" | sed "s/^..//"`;; - c=*|C=*) CA_C=`echo "$OPTARG" | sed "s/^..//"`;; - s=*|S=*) CA_S=`echo "$OPTARG" | sed "s/^..//"`;; - cr=*|CR=*) CA_CR=`echo "$OPTARG" | sed "s/^...//"`;; - mg=*|MG=*) CA_MG=`echo "$OPTARG" | sed "s/^...//"`;; - yb=*|YB=*) CA_YB=`echo "$OPTARG" | sed "s/^...//"`;; - *) error "-a is not (b, c, s, cr, mg, yb)=NUM!";; - esac - ;; - b) GSBIN="$OPTARG";; - c) COLOR=-c;; - d) DUPLEX="$OPTARG";; - g) GSOPTS="$GSOPTS $OPTARG";; - m) MEDIA="$OPTARG";; - n) COPIES="$OPTARG";; - p) PAPER="$OPTARG";; - q) QUALITY="$OPTARG";; - r) RES="$OPTARG";; - s) SOURCE="$OPTARG";; - t) SAVETONER="-t";; - z) MODEL="$OPTARG";; - l) CLIP_LR="-l $OPTARG";; - u) CLIP_UL="-u $OPTARG";; - L) CLIP_LOG="-L $OPTARG";; - A) AIB=-A;; - B) BC=-B;; - C) COLORMODE="$OPTARG";; - S) COLOR2MONO="-S$OPTARG";; - D) DEBUG="$OPTARG";; - G) GAMMAFILE="$OPTARG";; - I) INTENT="$OPTARG";; - P) NOPLANES=-P;; - X) EXTRAPAD="-X $OPTARG";; - [234689]) NUP="$opt";; - [57]) error "Can't find acceptable layout for $opt-up";; - 1) case "$OPTARG" in - [024568]) NUP="1$OPTARG";; - *) error "Can't find acceptable layout for 1$OPTARG-up";; - esac - ;; - o) case "$OPTARG" in - l*) NUP_ORIENT=-l;; - s*) NUP_ORIENT=-r;; - p*|*) NUP_ORIENT=;; - esac;; - V) echo "$VERSION"; foo2qpdl -V; foo2zjs-pstops -V; exit 0;; - h|\?) - if [ "$CMDLINE" != "-?" -a "$CMDLINE" != -h ]; then - echo "Illegal command:" - echo " $0 $CMDLINE" - echo - fi - usage;; - esac -done -shift `expr $OPTIND - 1` - -# -# If there is an argument left, take it as the file to print. -# Else, the input comes from stdin. -# -if [ $# -ge 1 ]; then - if [ "$LPJOB" = "" ]; then - : # LPJOB="$1" - fi - exec < $1 -fi - -# -case "$QUALITY" in -0) - GSOPTS="-dCOLORSCREEN $GSOPTS" - ;; -1) - GSOPTS="-dCOLORSCREEN $GSOPTS" - ;; -2) - GSOPTS="-dMaxBitmap=500000000 $GSOPTS" - ;; -as) - GSOPTS="-dCOLORSCREEN -dMaxBitmap=500000000 $GSOPTS" - ;; -wts) - GSOPTS="-dCOLORSCREEN -dMaxBitmap=500000000 $GSOPTS" - ;; -esac - -# -# Validate model code -# -case "$MODEL" in -0|1|2|3) ;; -*) error "Unknown model code $MODEL";; -esac - -# -# Validate media code -# -case "$MEDIA" in -0|plain) MEDIA=0;; -1|thick) MEDIA=1;; -2|thin) MEDIA=2;; -3|bond) MEDIA=3;; -4|color) MEDIA=4;; -5|card) MEDIA=5;; -6|labels) MEDIA=6;; -7|envelope) MEDIA=7;; -8|preprinted) MEDIA=8;; -9|cotton) MEDIA=9;; -10|recycled) MEDIA=10;; -[0-9]*) ;; -*) error "Unknown media code $MEDIA";; -esac - -# -# Validate source (InputSlot) code -# -case "$SOURCE" in -1|auto) SOURCE=1;; -2|manual) SOURCE=2;; -3|multi) SOURCE=3;; -4|tray1) SOURCE=4;; -[0-9]*) ;; -*) error "Unknown source code $SOURCE";; -esac - -# -# Validate Duplex code -# -case "$DUPLEX" in -1|off|none) DUPLEX=1;; -2|long*) DUPLEX=2;; -3|short*) DUPLEX=3;; -[0-9]*) ;; -*) error "Unknown duplex code $DUPLEX";; -esac - -# -# Validate Resolution -# -case "$RES" in -600x600) ;; -1200x600) ;; -1200x1200) ;; -2400x600) ;; -*) error "Illegal resolution $RES";; -esac - -# -# 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" in -Custom*x*) - # Command line only - XDIM=`echo "$PAPER" | sed -e "s/Custom.//" -e "s/x.*//" ` - YDIM=`echo "$PAPER" | sed -e "s/.*x//" ` - if [ "$XDIM" = "" -o "$YDIM" = "" ]; then - error "Custom page size '$PAPER' != 1-99999" - fi - if [ "$XDIM" -eq 0 -o "$YDIM" -eq 0 ]; then - error "Custom page size '$PAPER' != 1-99999" - fi - XDIM=`dc -e "$XDIM 1200* 72/p"` - YDIM=`dc -e "$YDIM 600* 72/p"` - PAPER=21; paper=letter; - # Doesn't work on a real printer - smudges. - # set_clipping 2 100 2 100 - set_clipping 150 100 150 100 - ;; -Custom*) - #%%BeginFeature: *CustomPageSize True - #216 - #360 - #0 - #0 - #0 - #pop pop pop pop pop - - #%%BeginFeature: *CustomPageSize True - #792.000000 612.000000 1 0.000000 0.000000 - #pop pop pop pop pop - - if [ $DEBUG = 0 ]; then - TMPFILE=/tmp/cus$$ - else - TMPFILE=/tmp/custom.ps - fi - cat >$TMPFILE - exec <$TMPFILE - - tmp=`head -n 10000 $TMPFILE \ - | sed -n '/CustomPageSize/{n;p;n;p;}' \ - | tr '\n' ' '` - case "$tmp" in - [0-9]*\ [0-9]*) - XDIM=`echo "$tmp" | sed 's/ .*//'` - YDIM=`echo "$tmp" | sed -e 's/^[^ ]* //' -e 's/ .*//'` - ;; - *) - if [ $DEBUG = 0 ]; then rm -f $TMPFILE; fi - error "Custom page size [XY]DIM != 1-99999" - ;; - esac - XDIM=`dc -e "$XDIM 1200* 72/p"` - YDIM=`dc -e "$YDIM 600* 72/p"` - PAPER=21; paper=letter; - # Doesn't work on a real printer - smudges. - # set_clipping 2 100 2 100 - set_clipping 150 100 150 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 168 100 168 100 # modulo 256 - ;; -11|b5jis|B5jis) PAPER=11; paper=b5; XDIM="8598"; YDIM="6070" - set_clipping 138 100 138 100 # modulo 256 - ;; -24|folio) PAPER=24; paper=folio; XDIM="9922"; YDIM="7796" - set_clipping 150 100 150 100 - ;; -26|"env#9") PAPER=26; paper=env9; XDIM="4496"; YDIM="5324" - set_clipping 200 100 200 100 # modulo 256 - ;; -6|"env#10") PAPER=6; paper=env10; XDIM="4950"; YDIM="5700" - set_clipping 171 100 171 100 # modulo 256 - ;; -9|envDL) PAPER=9; paper=envDL; XDIM="5200"; YDIM="5200" - set_clipping 168 100 168 100 # modulo 256 - ;; -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 189 100 189 100 # modulo 256 - ;; -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 176 100 176 100 # modulo 256 - ;; -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.ps -PAPERSIZE="-sPAPERSIZE=$paper"; - -case "$RES" in -600x600) XDIM=`expr $XDIM / 2`;; -1200x600) ;; -1200x1200) YDIM=`expr $YDIM \* 2`;; -2400x600) XDIM=`expr $XDIM \* 2`;; -esac -DIM="${XDIM}x${YDIM}" - -# -# Filter thru psnup if N-up printing has been requested -# -case $NUP in -[234689]|1[024568]) PREFILTER="nup";; -*) PREFILTER=cat;; -esac -if [ "$DEBUG" -ge 9 ]; then - PREFILTER="tee /tmp/$BASENAME.ps" -fi - -# -# 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) - ;; - *) - if [ -x /usr/bin/logger ]; then - logger -t "$BASENAME" -p lpr.info -- \ - "`basename $ICC2PS` -o $GAMMAFILE -t$INTENT > $ICCTMP.crd.ps" - fi - $ICC2PS -o $GAMMAFILE -t$INTENT > $ICCTMP.crd.ps 2>$ICCTMP.log \ - || error "Problem converting .ICM file to Postscript" - ;; - esac - - PSTOPS_OPTS="$PSTOPS_OPTS -c" - cat > $ICCTMP.usecie.ps <<-EOF - %!PS-Adobe-3.0 - <>setpagedevice - EOF - if [ "$QUALITY" = wts -o "$QUALITY" = as ]; then - if [ "$QUALITY" = wts ]; then - cat >> $ICCTMP.usecie.ps <<-EOF - << /UseWTS true >> setuserparams - EOF - else - cat >> $ICCTMP.usecie.ps <<-EOF - << /UseWTS false >> setuserparams - EOF - fi - cat >> $ICCTMP.usecie.ps <<-EOF - << - /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 - GAMMAFILE= - fi -} - -if [ $DEBUG -gt 0 ]; then - ICCTMP=/tmp/icc -else - ICCTMP=/tmp/icc$$ -fi - -if [ "" = "$COLOR" ]; then - COLORMODE= - GAMMAFILE= -else - case "$COLORMODE" in - default) COLORMODE=$DEFAULTCOLORMODE;; - esac - case "$GAMMAFILE" in - default) GAMMAFILE=samclp300-0.icm;; - esac -fi - -CRDBASE="$PREFIX/share/foo2qpdl/crd" -case "$MODEL" in - 0) model=CLP-300;; - 1) model=CLP-600;; - 2) model=CLP-600;; - 3) model=CLP-600;; -esac -case "$RES" in - 600x600) SCREEN=$model-600x600cms2;; - 1200x600) SCREEN=$model-1200x600cms2;; - 1200x1200) SCREEN=$model-1200x1200cms2;; -esac - -PSTOPS_OPTS="-n" - -case "$COLORMODE" in -0|"") - # 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'" - ;; -esac - -if [ "$COLOR" != "" -a "$QUALITY" = wts ]; then - PSTOPS_OPTS="$PSTOPS_OPTS -w" -elif [ "$COLOR" != "" -a "$QUALITY" = as ]; then - PSTOPS_OPTS="$PSTOPS_OPTS -a" -fi - -if [ "" != "$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 - fi -fi - -# -# 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" - -foo2zjs-pstops $PSTOPS_OPTS | \ -$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 \ - -z$MODEL $COLOR $CLIP_UL $CLIP_LR $CLIP_LOG $SAVETONER \ - -a$CA_B,$CA_C,$CA_S,$CA_CR,$CA_MG,$CA_YB \ - -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 -z$MODEL $COLOR $CLIP_UL $CLIP_LR $CLIP_LOG \ -$SAVETONER -a$CA_B,$CA_C,$CA_S,$CA_CR,$CA_MG,$CA_YB \ -$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 $TMPFILE2 -fi - -exit 0 diff --git a/foo2qpdl-wrapper.1 b/foo2qpdl-wrapper.1 deleted file mode 100644 index 6bb5f37..0000000 --- a/foo2qpdl-wrapper.1 +++ /dev/null @@ -1,416 +0,0 @@ -'\" t -'\" -'\" DO NOT EDIT! This file is generated from foo2qpdl-wrapper.1in -'\" -'\" t -.TH foo2qpdl-wrapper 1 "Sun May 26 18:25:20 2024" "foo2qpdl-wrapper 0.0" -'\" -'\" -'\"========================================================================== -'\" STRINGS and MACROS -'\"========================================================================== -'\" -'\" Define strings for special characters that nroff doesn't have -'\" -'\" N.B. using .if cua to test for special characters did not work. -'\" -.if !'\*[.T]'ps' .ds ua up -.if '\*[.T]'ps' .ds ua \(ua -.if !'\*[.T]'ps' .ds da down -.if '\*[.T]'ps' .ds da \(da -.if !'\*[.T]'ps' .ds <- left -.if '\*[.T]'ps' .ds <- \(<- -.if !'\*[.T]'ps' .ds -> right -.if '\*[.T]'ps' .ds -> \(-> -'\" -'\" bx - box a Courier string for making keycaps -'\" -'\" N.B. this mess is to make the line drawing come out only -'\" if we are really generating postscript -'\" -.de bx -.ie !'\*[.T]'ps' \{\ -. RB [ \\$1 ]\\$2 -.\} -.el \{\ -. ie !r ps4html \{\ -'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul' -. ft CW -. nr par*bxw \w'\\$1'+.4m -\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\ -\Z'\h'.2m'\s-1\\$1\s+1'\ -\h'\\n[par*bxw]u'\\$2 -. ft P -. \} -. el \{\ -. RB [ \\$1 ]\\$2 -. \} -.\} -.. -'\" -'\" strings to set current color (null with old groff) -'\" -.if mred .ds red \m[red] -.if mgreen .ds green \m[green] -.if mblue .ds blue \m[blue] -.if mblack .ds black \m[black] -.if mblack .ds mP \mP -'\" -'\" fix for grotty + xterm. We call for orange, grotty outputs yellow, -'\" but xterm displays yellow as orange. The cycle is complete. -'\" -.if n .defcolor orange rgb #ffff00 -'\" -'\" color - set the current color (ignores request with old groff) -'\" -.de color -.if mred \m[\\$1]\c -.. -'\" -'\" colorword - colorize a word (ignored by old groff) -'\" -.de colorword -.ie m\\$1 \m[\\$1]\\$2\mP\c -.el \\$2\c -.. -'\" -'\" colbox - colorize a word in a filled box -'\" -.de colbox -.ie mred \M[\\$2]\ -\v'+.167v'\ -\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\ -\v'-.167v'\ -\m[\\$1]\\$3\mP\MP -.el \\$3\c -.. -'\" -'\" Macros for doing pdfmarks -'\" -.de specialps -.if '\*[.T]'ps' \\k_\X'ps: \\$*'\h'|\\n_u'\c -.. -'\" -'\" pdfmark PDFMARKCODE -'\" -.ds pdfmarks -.if d pdfmarks \{\ -.de pdfmark -. specialps exec [\\$1 pdfmark -.. -'\" -'\" pdfdest LINKNAME -'\" -.de pdfdest -.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST" -.. -'\" -'\" pdfbookmark COUNT LINKNAME STRING -'\" -.de pdfbookmark -. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT" -.. -'\" -'\" Define the SH and SS macros to save pdfmark information -'\" in "arrays" of numbers and strings. -'\" -.if !r rr_n \{\ -.nr rr_n 0 1 -.am SH -. nr rr_levels!\\n+[rr_n] 2 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.am SS -. nr rr_levels!\\n+[rr_n] 3 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.\} -'\" -'\" Called at the end of the document to generate the pdfmark outline -'\" -.de pdf_outline -.nr rr_levels!\\n+[rr_n] 1 -.nr rr_i 0 1 -.while \\n+[rr_i]<\\n[rr_n] \{\ -. nr rr_ip1 \\n[rr_i]+1 -. nr rr_count 0 -. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\ -. nr rr_j \\n[rr_i] 1 -. while \\n+[rr_j]<\\n[rr_n] \{\ -. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\ -. break -. \} -. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\ -. nr rr_count \\n[rr_count]+1 -. \} -. \} -. \} -. ds hhh \\*[rr_labels!\\n[rr_i]] -. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]" -.\} -.. -'\" -'\" Some postscript to make pdfmarks harmless on old interpreters... -'\" -.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse" -'\" -'\" Force display of Bookmarks in Acrobat when document is viewed. -'\" -.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW" -'\" -'\" Output the document info in pdfmarks -'\" -.pdfmark "\ - /Title (\*[an-title](\*[an-section])) \ - /Subject (\*[an-title] Manual Page) \ - /Author (Rick Richardson) \ - /Keywords (printing) \ - /Creator (groff \n(.x.\n(.y.\n(.Y -man) \ - /CreationDate (\*[an-extra1]) \ - /ModDate (\*[an-extra1]) \ - /DOCINFO" -\} -'\" -'\" The manual page name is only 1st level mark -'\" -.nr rr_levels!\n+[rr_n] 1 -.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section]) -.pdfdest Link\n[rr_n] -'\" -'\"========================================================================== -'\" MANUAL PAGE SOURCE -'\"========================================================================== -.SH NAME -foo2qpdl-wrapper \- Convert Postscript into a QPDL printer stream -.SH SYNOPSIS -.B foo2qpdl-wrapper -.RI [ options "] [" ps-file ] -.SH DESCRIPTION -.B foo2qpdl-wrapper -is a Foomatic compatible printer wrapper for the \fBfoo2qpdl\fP printer driver. -This script reads a Postscript \fIps-file\fP or standard input -and converts it to Samsung/Xerox QPDL printer format -for driving the -Samsung CLP-300, CLX-2160, CLX-3160, CLP-315, CLX-3175, CLP-600, CLP-610, -CLP-620, CLP-360, CLP-365, -and Xerox Phaser 6110 -QPDL printers. -.P -This script can be used in a standalone fashion, but is intended to -be called from a printer spooler system which uses the Foomatic -printer database. - -.SH COMMAND LINE OPTIONS -.SS Normal Options -These are the options used to select the parameters of a -print job that are usually controlled on a per job basis. -.TP -.BI \-c -Print in color (else monochrome). -.TP -.BI \-C\0 colormode -Color correction mode [0]. -.TS -n l . -1 CRD -10 ICM color profile (using -G *.icm file) -.TE -.TP -.BI \-d\0 duplex -Duplex code to send to printer [1]. -.TS -| n l | n l | n l . -1 off 2 long edge 3 short edge -.TE -.TP -.BI \-m\0 media -Media code to send to printer [0]. -.TS -l l l -l n n. -_ -Media QPDL -_ -plain 0 -thick 1 -thin 2 -bond 3 -color 4 -card 5 -labels 6 -envelope 7 -preprinted 8 -cotton 9 -recycled 10 -transparency 11 -archive 12 -.TE -.TP -.BI \-p\0 paper -Paper size code to send to printer [0]. -.TS -box; -| n l | n l. -0 letter 1 legal -2 A4 3 executive -6 env #10 7 env Monarch -8 env C5 9 env DL -11 B5jis 12 B5iso -16 A5 17 A6 -23 env C6 24 folio -25 env 6.75 26 env #9 -28 oficio -.TE -.TP -.BI \-n\0 copies -Number of copies [1]. -.TP -.BI \-r\0 xres x yres -Set device resolution in pixels/inch [1200x600]. -.TP -.BI \-s\0 source -Source (Input Slot) code to send to printer [255]. -.TS -| n l | n l. -1 auto 2 manual -3 multi 4 tray1 -.TE -.TP -.BI \-t -Draft mode. Every other pixel is white. -.TP -.BI "\-2 \-3 \-4 \-5 \-6 \-8 \-9 \-10 \-12 \-14 \-15 \-16 \-18" -Print in N-up. Requires the \fBpsutils\fP package. -.TP -.BI \-o\0 orient -Orientation used for N-up. -.TS -l l l. -Portrait -op (normal) -Landscape -ol (rotated 90 degrees anticlockwise) -Seascape -os (rotated 90 degrees clockwise) -.TE -.SS Printer Tweaking Options -These are the options used to customize the operation of \fBfoo2qpdl\fP -for a particular printer. -.TP -.BI \-u\0 xoff x yoff -Set the offset of the start of the printable region from the -upper left corner, in pixels [varies with paper size]. -.TP -.BI \-l\0 xoff x yoff -Set the offset of the end of the printable region from the -lower right corner, in pixels [varies with paper size]. -.TP -.BI \-L\0 mask -Send the logical clipping values from -u/-l in the QPDL stream. -\fBfoo2qpdl-wrapper\fP always runs Ghostscript with the ideal page dimensions, -so that the scale of the image is correct, -regardless whether or not the printer has unprintable regions. -This option is used to move the position of the clipped image -back to where it belongs on the page. The default is to send -the amount which was clipped by -u and -l, and should be -good in most cases. -.TS -l l. -0 don't send any logical clipping amounts -1 only send Y clipping amount -2 only send X clipping amount -3 send both X and Y clipping amounts -.TE -.TP -.BI \-z\0 model -Printer model. Model 0 is the default. -.TS -l l. -model Description -0 CLP-300, CLX-2160, CLX-3160 -1 CLP-600 -2 CLP-310, CLP-315, CLP-610, CLX-3175 -3 CLP-620, CLP-360, CLP-365 -.TE -.SS Color Tweaking Options -These are the options used to control the quality of color output. -Color correction is currently a WORK IN PROGRESS. -.TP -.BI \-a\0 parm=val -Color Adjust. \fIparm\fP is b, c, s, cr, mg, yb for -brightness, contrast, saturation, cyan-red balance, magenta-green balance, -and yellow-blue balance. -\fIval\fP is 0 to 100. Multiple options are allowed. -The default is "-ab=50 -ac=50 -as=50 -acr=50 -amg=50 -ayb=50". -This only works when the -z3 (e.g. CLP-365) model is set! -.TP -.BI \-g\0 gsopts -Additional options to pass to Ghostscript, such as -g\(lq-dDITHERPPI=nnn\(rq, -etc. This option may appear more than once. -.TP -.BI \-G\0 profile.icm -Convert \fIprofile.icm\fP to a Postscript color rendering -dictionary (CRD) using \fBfoo2zjs-icc2ps\fP and -adjust the printer colors by using the Postscript \fBsetcolorrendering\fP -operator. (WORK IN PROGRESS). -.TP -.BI \-G\0 gamma-file.ps -Prepend \fIgamma-file.ps\fP to the Postscript input to perform -color correction using the \fBsetcolortransfer\fP Postscript operator. -For example, the file might contain: -.br -{0.333 exp} {0.333 exp} {0.333 exp} {0.333 exp} setcolortransfer -.TP -.BI \-I\0 intent -Select profile intent from the ICM file. -0=Perceptual, 1=Colorimetric, 2=Saturation, 3=Absolute. -Default is 0 (perceptual). -.SS Debugging Options -These options are used for debugging \fBfoo2qpdl\fP and its wrapper. -.TP -.BI \-S\0 plane -Output just a single color plane from a color print and print it -on the black plane. The default is to output all color planes. -.TS -l l. -1 Cyan -2 Magenta -3 Yellow -4 Black -.TE -.TP -.BI \-D\0 level -Set Debug level [0]. - -.SH EXAMPLES -Create a monochrome QPDL stream from a Postscript document, -examine it, and then print it using a RAW print queue: - -.RS -.nf -foo2qpdl-wrapper testpage.ps > testpage.zm -qpdldecode < testpage.zm -lpr -P raw testpage.zm -.fi -.RE -.P -Create a color QPDL stream from a Postscript document: - -.RS -.nf -foo2qpdl-wrapper -c testpage.ps > testpage.zc -.fi -.RE - -.SH FILES -.BR /usr/bin/foo2qpdl-wrapper -.SH SEE ALSO -.BR foo2qpdl (1), -.BR qpdldecode (1) -.SH "AUTHOR" -Rick Richardson -.br -http://foo2qpdl.rkkda.com/ -'\" -'\" -'\" -.em pdf_outline diff --git a/foo2qpdl-wrapper.1in b/foo2qpdl-wrapper.1in index 7e476c1..4524372 100644 --- a/foo2qpdl-wrapper.1in +++ b/foo2qpdl-wrapper.1in @@ -39,7 +39,7 @@ Color correction mode [0]. .TS n l . 1 CRD -10 ICM color profile (using -G *.icm file) +10 ICM color profile (using \-G *.icm file) .TE .TP .BI \-d\0 duplex @@ -112,9 +112,9 @@ Print in N-up. Requires the \fBpsutils\fP package. Orientation used for N-up. .TS l l l. -Portrait -op (normal) -Landscape -ol (rotated 90 degrees anticlockwise) -Seascape -os (rotated 90 degrees clockwise) +Portrait \-op (normal) +Landscape \-ol (rotated 90 degrees anticlockwise) +Seascape \-os (rotated 90 degrees clockwise) .TE .SS Printer Tweaking Options These are the options used to customize the operation of \fBfoo2qpdl\fP @@ -129,13 +129,13 @@ Set the offset of the end of the printable region from the lower right corner, in pixels [varies with paper size]. .TP .BI \-L\0 mask -Send the logical clipping values from -u/-l in the QPDL stream. +Send the logical clipping values from \-u/-l in the QPDL stream. \fBfoo2qpdl-wrapper\fP always runs Ghostscript with the ideal page dimensions, so that the scale of the image is correct, regardless whether or not the printer has unprintable regions. This option is used to move the position of the clipped image back to where it belongs on the page. The default is to send -the amount which was clipped by -u and -l, and should be +the amount which was clipped by \-u and \-l, and should be good in most cases. .TS l l. @@ -164,11 +164,11 @@ Color Adjust. \fIparm\fP is b, c, s, cr, mg, yb for brightness, contrast, saturation, cyan-red balance, magenta-green balance, and yellow-blue balance. \fIval\fP is 0 to 100. Multiple options are allowed. -The default is "-ab=50 -ac=50 -as=50 -acr=50 -amg=50 -ayb=50". -This only works when the -z3 (e.g. CLP-365) model is set! +The default is "\-ab=50 \-ac=50 \-as=50 \-acr=50 \-amg=50 \-ayb=50". +This only works when the \-z3 (e.g. CLP\-365) model is set! .TP .BI \-g\0 gsopts -Additional options to pass to Ghostscript, such as -g\(lq-dDITHERPPI=nnn\(rq, +Additional options to pass to Ghostscript, such as \-g\(lq-dDITHERPPI=nnn\(rq, etc. This option may appear more than once. .TP .BI \-G\0 profile.icm @@ -213,7 +213,7 @@ examine it, and then print it using a RAW print queue: .nf foo2qpdl-wrapper testpage.ps > testpage.zm qpdldecode < testpage.zm -lpr -P raw testpage.zm +lpr \-P raw testpage.zm .fi .RE .P @@ -221,7 +221,7 @@ Create a color QPDL stream from a Postscript document: .RS .nf -foo2qpdl-wrapper -c testpage.ps > testpage.zc +foo2qpdl-wrapper \-c testpage.ps > testpage.zc .fi .RE diff --git a/foo2qpdl-wrapper.in b/foo2qpdl-wrapper.in index 2d9993b..0261fd1 100755 --- a/foo2qpdl-wrapper.in +++ b/foo2qpdl-wrapper.in @@ -13,8 +13,8 @@ #* GNU General Public License for more details. #* #* You should have received a copy of the GNU General Public License -#* along with this program; if not, write to the Free Software -#* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +#* along with this program; if not, see +#* . #* #* Authors: Rick Richardson diff --git a/foo2qpdl.1 b/foo2qpdl.1 deleted file mode 100644 index afb8b3e..0000000 --- a/foo2qpdl.1 +++ /dev/null @@ -1,381 +0,0 @@ -'\" t -'\" -'\" DO NOT EDIT! This file is generated from foo2qpdl.1in -'\" -'\" t -.TH foo2qpdl 1 "Sun May 26 18:25:20 2024" "foo2qpdl 0.0" -'\" -'\" -'\"========================================================================== -'\" STRINGS and MACROS -'\"========================================================================== -'\" -'\" Define strings for special characters that nroff doesn't have -'\" -'\" N.B. using .if cua to test for special characters did not work. -'\" -.if !'\*[.T]'ps' .ds ua up -.if '\*[.T]'ps' .ds ua \(ua -.if !'\*[.T]'ps' .ds da down -.if '\*[.T]'ps' .ds da \(da -.if !'\*[.T]'ps' .ds <- left -.if '\*[.T]'ps' .ds <- \(<- -.if !'\*[.T]'ps' .ds -> right -.if '\*[.T]'ps' .ds -> \(-> -'\" -'\" bx - box a Courier string for making keycaps -'\" -'\" N.B. this mess is to make the line drawing come out only -'\" if we are really generating postscript -'\" -.de bx -.ie !'\*[.T]'ps' \{\ -. RB [ \\$1 ]\\$2 -.\} -.el \{\ -. ie !r ps4html \{\ -'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul' -. ft CW -. nr par*bxw \w'\\$1'+.4m -\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\ -\Z'\h'.2m'\s-1\\$1\s+1'\ -\h'\\n[par*bxw]u'\\$2 -. ft P -. \} -. el \{\ -. RB [ \\$1 ]\\$2 -. \} -.\} -.. -'\" -'\" strings to set current color (null with old groff) -'\" -.if mred .ds red \m[red] -.if mgreen .ds green \m[green] -.if mblue .ds blue \m[blue] -.if mblack .ds black \m[black] -.if mblack .ds mP \mP -'\" -'\" fix for grotty + xterm. We call for orange, grotty outputs yellow, -'\" but xterm displays yellow as orange. The cycle is complete. -'\" -.if n .defcolor orange rgb #ffff00 -'\" -'\" color - set the current color (ignores request with old groff) -'\" -.de color -.if mred \m[\\$1]\c -.. -'\" -'\" colorword - colorize a word (ignored by old groff) -'\" -.de colorword -.ie m\\$1 \m[\\$1]\\$2\mP\c -.el \\$2\c -.. -'\" -'\" colbox - colorize a word in a filled box -'\" -.de colbox -.ie mred \M[\\$2]\ -\v'+.167v'\ -\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\ -\v'-.167v'\ -\m[\\$1]\\$3\mP\MP -.el \\$3\c -.. -'\" -'\" Macros for doing pdfmarks -'\" -.de specialps -.if '\*[.T]'ps' \\k_\X'ps: \\$*'\h'|\\n_u'\c -.. -'\" -'\" pdfmark PDFMARKCODE -'\" -.ds pdfmarks -.if d pdfmarks \{\ -.de pdfmark -. specialps exec [\\$1 pdfmark -.. -'\" -'\" pdfdest LINKNAME -'\" -.de pdfdest -.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST" -.. -'\" -'\" pdfbookmark COUNT LINKNAME STRING -'\" -.de pdfbookmark -. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT" -.. -'\" -'\" Define the SH and SS macros to save pdfmark information -'\" in "arrays" of numbers and strings. -'\" -.if !r rr_n \{\ -.nr rr_n 0 1 -.am SH -. nr rr_levels!\\n+[rr_n] 2 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.am SS -. nr rr_levels!\\n+[rr_n] 3 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.\} -'\" -'\" Called at the end of the document to generate the pdfmark outline -'\" -.de pdf_outline -.nr rr_levels!\\n+[rr_n] 1 -.nr rr_i 0 1 -.while \\n+[rr_i]<\\n[rr_n] \{\ -. nr rr_ip1 \\n[rr_i]+1 -. nr rr_count 0 -. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\ -. nr rr_j \\n[rr_i] 1 -. while \\n+[rr_j]<\\n[rr_n] \{\ -. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\ -. break -. \} -. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\ -. nr rr_count \\n[rr_count]+1 -. \} -. \} -. \} -. ds hhh \\*[rr_labels!\\n[rr_i]] -. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]" -.\} -.. -'\" -'\" Some postscript to make pdfmarks harmless on old interpreters... -'\" -.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse" -'\" -'\" Force display of Bookmarks in Acrobat when document is viewed. -'\" -.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW" -'\" -'\" Output the document info in pdfmarks -'\" -.pdfmark "\ - /Title (\*[an-title](\*[an-section])) \ - /Subject (\*[an-title] Manual Page) \ - /Author (Rick Richardson) \ - /Keywords (printing) \ - /Creator (groff \n(.x.\n(.y.\n(.Y -man) \ - /CreationDate (\*[an-extra1]) \ - /ModDate (\*[an-extra1]) \ - /DOCINFO" -\} -'\" -'\" The manual page name is only 1st level mark -'\" -.nr rr_levels!\n+[rr_n] 1 -.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section]) -.pdfdest Link\n[rr_n] -'\" -'\"========================================================================== -'\" MANUAL PAGE SOURCE -'\"========================================================================== -.SH NAME -foo2qpdl \- Convert Ghostscript pbmraw or bitcmyk format into a -QPDL printer stream -.SH SYNOPSIS -.B foo2qpdl -.RI [ options "] <" pbmraw-file " >" qpdl-file -.sp 1 -.B foo2qpdl -.RI [ options "] <" bitcmyk-file " >" qpdl-file -.sp 1 -.B foo2qpdl -.RI [ options "] <" pksmraw-file " >" qpdl-file -.SH DESCRIPTION -.B foo2qpdl -converts Ghostscript pbmraw, bitcmyk, or pksmraw output formats to monochrome -or color QPDL streams, -for driving the Samsung CLP-300, CLX-2160, CLP-600, CLX-3160, CLP-610 -CLP-620, CLP-360, CLP-365, -and the Xerox Phaser 6110 -QPDL printers. - -.SH COMMAND LINE OPTIONS -.SS Normal Options -These are the options used to select the parameters of a -print job that are usually controlled on a per job basis. -.TP -.BI \-c -Force color mode if autodetect doesn't work. -.TP -.BI \-d\0 duplex -Duplex code to send to printer [1]. -.TS -| n l | n l | n l . -1 off 2 long edge 3 short edge -.TE -.TP -.BI \-g\0 xpix x ypix -Set page dimensions in pixels [10200x6600]. -.TP -.BI \-m\0 media -Media code to send to printer [0]. -.TS -l l l -l n n. -_ -Media QPDL -_ -plain 0 -thick 1 -thin 2 -bond 3 -color 4 -card 5 -labels 6 -envelope 7 -preprinted 8 -cotton 9 -recycled 10 -transparency 11 -archive 12 -.TE -.TP -.BI \-p\0 paper -Paper code to send to printer [0]. -.TS -box; -| n l | n l. -0 letter 1 legal -2 A4 3 executive -6 env #10 7 env Monarch -8 env C5 9 env DL -11 B5jis 12 B5iso -16 A5 17 A6 -23 env C6 24 folio -25 env 6.75 26 env #9 -28 oficio 21 custom -.TE -.TP -.BI \-n\0 copies -Number of copies [1]. -.TP -.BI \-r\0 xres x yres -Set device resolution in pixels/inch [1200x600]. -.TP -.BI \-s\0 source -Source (InputSlot) code to send to printer [255]. -.TS -| n l | n l. -1 auto 2 manual -3 multi 4 tray1 -.TE -.TP -.BI \-t -Draft mode. Every other pixel is white. -.TP -.BI \-J\0 filename -Filename string to send to printer. -.TP -.BI \-U\0 username -Username string to send to printer. -.SS Printer Tweaking Options -These are the options used to customize the operation of \fBfoo2qpdl\fP -for a particular printer. -.TP -.BI \-a\0 b,c,s,cr,mg,yb -Color Adjust: brightness, contrast, saturation, cyan-red balance, -magenta-green balance, and yellow-blue balance from 0 to 100. -The default is 50,50,50,50,50,50. -This only works when the -z3 (e.g. CLP-365) model is set! -.TP -.BI \-u\0 xoff x yoff -Set the offset of the start of the printable region from the -upper left corner, in pixels [0x0]. -.TP -.BI \-l\0 xoff x yoff -Set the offset of the end of the printable region from the -lower right corner, in pixels [0x0]. -.TP -.BI \-L\0 mask -Send logical clipping amounts implied by -u/-l in the QPDL stream [3]. -.TS -l l. -0 don't send any logical clipping amounts -1 only send Y clipping amount -2 only send X clipping amount -3 send both X and Y clipping amounts -.TE -.TP -.BI \-A -AllIsBlack: convert C=1,M=1,Y=1 to just K=1. Works with bitcmyk input only. -.TP -.BI \-B -BlackClears: K=1 forces C,M,Y to 0. Works with bitcmyk input only. -.TP -.BI \-z\0 model -Printer model. Model 0 is the default. -.TS -l l. -model Description -0 CLP-300, CLX-2160, CLX-3160 -1 CLP-600 -2 CLP-310, CLP-315, CLP-610, CLX-3175 -3 CLP-620, CLP-360, CLP-365 -.TE -.SS Debugging Options -These options are used for debugging \fBfoo2qpdl\fP. -.TP -.BI \-S\0 plane -Output just a single color plane from a color print and print it -on the black plane. The default is to output all color planes. -.TS -l l. -1 Cyan -2 Magenta -3 Yellow -4 Black -.TE -.TP -.BI \-D\0 level -Set Debug level [0]. - -.SH EXAMPLES -Create a black and white QPDL stream: - -.RS -.nf -gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE \ - -sPAPERSIZE=letter -r1200x600 -sDEVICE=pbmraw \ - -sOutputFile=- - < testpage.ps \ -| foo2qpdl -r1200x600 -g10200x6600 -p0 >testpage.zm -.fi -.RE -.P -Create a color QPDL stream: - -.RS -.nf -gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE \ - -sPAPERSIZE=letter -g10200x6600 -r1200x600 -sDEVICE=bitcmyk \ - -sOutputFile=- - < testpage.ps \ -| foo2qpdl -r1200x600 -g10200x6600 -p0 >testpage.zc -.fi -.RE - -.SH FILES -.BR /usr/bin/foo2qpdl -.SH SEE ALSO -.BR foo2qpdl-wrapper (1), -.BR qpdldecode (1) -.SH "AUTHOR" -Rick Richardson -.br -http://foo2qpdl.rkkda.com/ -'\" -'\" -'\" -.em pdf_outline diff --git a/foo2qpdl.1in b/foo2qpdl.1in index bdc209d..780ee0d 100644 --- a/foo2qpdl.1in +++ b/foo2qpdl.1in @@ -114,7 +114,7 @@ for a particular printer. Color Adjust: brightness, contrast, saturation, cyan-red balance, magenta-green balance, and yellow-blue balance from 0 to 100. The default is 50,50,50,50,50,50. -This only works when the -z3 (e.g. CLP-365) model is set! +This only works when the \-z3 (e.g. CLP\-365) model is set! .TP .BI \-u\0 xoff x yoff Set the offset of the start of the printable region from the @@ -125,7 +125,7 @@ Set the offset of the end of the printable region from the lower right corner, in pixels [0x0]. .TP .BI \-L\0 mask -Send logical clipping amounts implied by -u/-l in the QPDL stream [3]. +Send logical clipping amounts implied by \-u/-l in the QPDL stream [3]. .TS l l. 0 don't send any logical clipping amounts @@ -172,10 +172,10 @@ Create a black and white QPDL stream: .RS .nf -gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE \ - -sPAPERSIZE=letter -r1200x600 -sDEVICE=pbmraw \ - -sOutputFile=- - < testpage.ps \ -| foo2qpdl -r1200x600 -g10200x6600 -p0 >testpage.zm +gs \-q \-dBATCH \-dSAFER \-dQUIET \-dNOPAUSE \ + \-sPAPERSIZE=letter \-r1200x600 \-sDEVICE=pbmraw \ + \-sOutputFile=- \- < testpage.ps \ +| foo2qpdl \-r1200x600 \-g10200x6600 \-p0 >testpage.zm .fi .RE .P @@ -183,10 +183,10 @@ Create a color QPDL stream: .RS .nf -gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE \ - -sPAPERSIZE=letter -g10200x6600 -r1200x600 -sDEVICE=bitcmyk \ - -sOutputFile=- - < testpage.ps \ -| foo2qpdl -r1200x600 -g10200x6600 -p0 >testpage.zc +gs \-q \-dBATCH \-dSAFER \-dQUIET \-dNOPAUSE \ + \-sPAPERSIZE=letter \-g10200x6600 \-r1200x600 \-sDEVICE=bitcmyk \ + \-sOutputFile=- \- < testpage.ps \ +| foo2qpdl \-r1200x600 \-g10200x6600 \-p0 >testpage.zc .fi .RE diff --git a/foo2slx b/foo2slx deleted file mode 100755 index ebc1143..0000000 Binary files a/foo2slx and /dev/null differ diff --git a/foo2slx-wrapper b/foo2slx-wrapper deleted file mode 100755 index 0a3f143..0000000 --- a/foo2slx-wrapper +++ /dev/null @@ -1,728 +0,0 @@ -#!/bin/sh - -#* Copyright (C) 2003-2006 Rick Richardson -#* -#* This program is free software; you can redistribute it and/or modify -#* it under the terms of the GNU General Public License as published by -#* the Free Software Foundation; either version 2 of the License, or -#* (at your option) any later version. -#* -#* This program is distributed in the hope that it will be useful, -#* but WITHOUT ANY WARRANTY; without even the implied warranty of -#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -#* GNU General Public License for more details. -#* -#* You should have received a copy of the GNU General Public License -#* along with this program; if not, write to the Free Software -#* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#* -#* Authors: Rick Richardson - -VERSION='$Id: foo2slx-wrapper.in,v 1.22 2011/01/14 23:21:39 rick Exp $' - -# -# Printer Notes: -# -# Lexmark C500 - -# - -PROGNAME="$0" -BASENAME=`basename $PROGNAME` -PREFIX=/usr -SHARE=$PREFIX/share/foo2slx -PATH=$PATH:/sw/bin:/opt/local/bin - -# -# Log the command line, for debugging and problem reports -# -if [ -x /usr/bin/logger -o -x /bin/logger ]; then - logger -t "$BASENAME" -p lpr.info -- "$BASENAME $@" x Set device resolution in pixels/inch [$RES] --s source Source code to send to printer [$SOURCE] - 0=auto, 1=cassette1 - Code numbers may vary with printer model. --2/-3/-4/-6/-8/-10/-12/-14/-15/-16/-18 - Print with N-up (requires psutils) --o orient For N-up: -op is portrait, -ol is landscape, -os is seascape. - -Printer Tweaking Options: --u x Set offset of upper left printable in pixels [varies] --l x Set offset of lower right printable in pixels [varies] --L mask Send logical clipping values from -u/-l in ZjStream [3] - 0=no, 1=Y, 2=X, 3=XY - -Color Tweaking Options: --g gsopts Additional options to pass to Ghostscript, such as - -dDITHERPPI=nnn, etc. May appear more than once. [] --G profile.icm Convert profile.icm to a Postscript CRD using icc2ps and - adjust colors using the setcolorrendering PS operator. - $SHARE/icm/ will be searched for profile.icm. --I intent Select profile intent from ICM file [$INTENT] - 0=Perceptual, 1=Colorimetric, 2=Saturation, 3=Absolute --G gamma-file.ps Prepend gamma-file to the Postscript input to perform - color correction using the setcolortransfer PS operator. - -Debugging Options: --S plane Output just a single color plane from a color print [all] - 1=Cyan, 2=Magenta, 3=Yellow, 4=Black --D lvl Set Debug level [$DEBUG] --V $VERSION -EOF - - exit 1 -} - -# -# Report an error and exit -# -error() { - echo "$BASENAME: $1" >&2 - exit 1 -} - -dbgcmd() { - if [ $DEBUG -ge 1 ]; then - echo "$@" >&2 - fi - "$@" -} - -# -# N-up-ify the job. Requires psnup from psutils package -# -nup() { - case "$NUP" in - [2368]|1[0458]) - tr '\r' '\n' | psnup $NUP_ORIENT -d2 -$NUP -m.3in -p$paper -q - ;; - [49]|1[26]) - tr '\r' '\n' | psnup $NUP_ORIENT -d2 -$NUP -m.5in -p$paper -q - ;; - *) - error "Illegal call to nup()." - ;; - esac -} - -# -# Process the options -# - -# Try to use a local copy of GhostScript 8.54, if available. Otherwise, -# fallback to whatever the Linux distro has installed (usually 7.07) -# -# N.B. := operator used here, when :- would be better, because "ash" -# doesn't have :- -if eval gs.foo -v >/dev/null 2>&1; then - GSBIN=${GSBIN:-gs.foo} -else - GSBIN=${GSBIN:-gs} -fi - -CMDLINE="$*" -DEBUG=0 -DUPLEX=1 -COLOR= -COLORMODE=default -MODEL=0 -QUALITY=1 -QUALITY=wts -MEDIA=0 -COPIES=1 -PAPER=6 -RES=600x600 -SOURCE=0 -NUP= -CLIP_UL= -CLIP_LR= -CLIP_LOG= -BC= -AIB= -NOPLANES= -COLOR2MONO= -GAMMAFILE=default -INTENT=0 -GSOPTS= -EXTRAPAD= -SAVETONER= -NUP_ORIENT= -GSDEV=-sDEVICE=pbmraw -# What mode to use if the user wants us to pick the "best" mode -case `$GSBIN --version` in -7*) DEFAULTCOLORMODE=10 - ;; -8.1*) - DEFAULTCOLORMODE=10 - QUALITY=1 - ;; -*) DEFAULTCOLORMODE=10 - ;; -esac -while getopts "1:23456789o:b:cC:d:g:l:u:L:m:n:p:q:r:s:tz:ABS:D:G:I:PX:Vh?" opt -do - case $opt in - b) GSBIN="$OPTARG";; - c) COLOR=-c;; - d) DUPLEX="$OPTARG";; - g) GSOPTS="$GSOPTS $OPTARG";; - m) MEDIA="$OPTARG";; - n) COPIES="$OPTARG";; - p) PAPER="$OPTARG";; - q) QUALITY="$OPTARG";; - r) RES="$OPTARG";; - s) SOURCE="$OPTARG";; - t) SAVETONER="-t";; - z) MODEL="$OPTARG";; - l) CLIP_LR="-l $OPTARG";; - u) CLIP_UL="-u $OPTARG";; - L) CLIP_LOG="-L $OPTARG";; - A) AIB=-A;; - B) BC=-B;; - C) COLORMODE="$OPTARG";; - S) COLOR2MONO="-S$OPTARG";; - D) DEBUG="$OPTARG";; - G) GAMMAFILE="$OPTARG";; - I) INTENT="$OPTARG";; - P) NOPLANES=-P;; - X) EXTRAPAD="-X $OPTARG";; - [234689]) NUP="$opt";; - [57]) error "Can't find acceptable layout for $opt-up";; - 1) case "$OPTARG" in - [024568]) NUP="1$OPTARG";; - *) error "Can't find acceptable layout for 1$OPTARG-up";; - esac - ;; - o) case "$OPTARG" in - l*) NUP_ORIENT=-l;; - s*) NUP_ORIENT=-r;; - p*|*) NUP_ORIENT=;; - esac;; - V) echo "$VERSION"; foo2slx -V; foo2zjs-pstops -V; exit 0;; - h|\?) - if [ "$CMDLINE" != "-?" -a "$CMDLINE" != -h ]; then - echo "Illegal command:" - echo " $0 $CMDLINE" - echo - fi - usage;; - esac -done -shift `expr $OPTIND - 1` - -# -# If there is an argument left, take it as the file to print. -# Else, the input comes from stdin. -# -if [ $# -ge 1 ]; then - if [ "$LPJOB" = "" ]; then - : # LPJOB="$1" - fi - exec < $1 -fi - -# -case "$QUALITY" in -0) - GSOPTS="-dCOLORSCREEN $GSOPTS" - ;; -1) - GSOPTS="-dCOLORSCREEN $GSOPTS" - ;; -2) - GSOPTS="-dMaxBitmap=500000000 $GSOPTS" - ;; -as) - GSOPTS="-dCOLORSCREEN -dMaxBitmap=500000000 $GSOPTS" - ;; -wts) - GSOPTS="-dCOLORSCREEN -dMaxBitmap=500000000 $GSOPTS" - ;; -esac - -# -# Validate model code -# -case "$MODEL" in -0|1) ;; -*) error "Unknown model code $MODEL";; -esac - -# -# Validate media code -# -case "$MEDIA" in -0|plain|standard) MEDIA=0;; -1|transparency) MEDIA=1;; -2|labels) MEDIA=2;; -9|special) MEDIA=9;; -5|thin) MEDIA=5;; -8|middle) MEDIA=8;; -3|thick1) MEDIA=3;; -6|thick2) MEDIA=6;; -4|envelope1) MEDIA=4;; -7|envelope2) MEDIA=7;; -[0-9]*) ;; -*) error "Unknown media code $MEDIA";; -esac - -# -# Validate source (InputSlot) code -# -case "$SOURCE" in -1|cassette1) SOURCE=1;; -0|auto) SOURCE=0;; -[0-9]*) ;; -*) error "Unknown source code $SOURCE";; -esac - -# -# Validate Duplex code -# -case "$DUPLEX" in -1|off|none) DUPLEX=1;; -2|long*) DUPLEX=2;; -3|short*) DUPLEX=3;; -[0-9]*) ;; -*) error "Unknown duplex code $DUPLEX";; -esac - -# -# Validate Resolution -# -case "$RES" in -600x600) ;; -1200x600) ;; -*) error "Illegal resolution $RES";; -esac - -# -# 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" in -Custom*x*) - # Command line only - XDIM=`echo "$PAPER" | sed -e "s/Custom.//" -e "s/x.*//" ` - YDIM=`echo "$PAPER" | sed -e "s/.*x//" ` - if [ "$XDIM" = "" -o "$YDIM" = "" ]; then - error "Custom page size '$PAPER' != 1-99999" - fi - if [ "$XDIM" -eq 0 -o "$YDIM" -eq 0 ]; then - error "Custom page size '$PAPER' != 1-99999" - fi - XDIM=`dc -e "$XDIM 1200* 72/p"` - YDIM=`dc -e "$YDIM 600* 72/p"` - PAPER=255; paper=letter; - MEDIA=4 - set_clipping 2 100 2 100 - ;; -Custom*) - #%%BeginFeature: *CustomPageSize True - #216 - #360 - #0 - #0 - #0 - #pop pop pop pop pop - - #%%BeginFeature: *CustomPageSize True - #792.000000 612.000000 1 0.000000 0.000000 - #pop pop pop pop pop - - if [ $DEBUG = 0 ]; then - TMPFILE=/tmp/cus$$ - else - TMPFILE=/tmp/custom.ps - fi - cat >$TMPFILE - exec <$TMPFILE - - tmp=`head -n 10000 $TMPFILE \ - | sed -n '/CustomPageSize/{n;p;n;p;}' \ - | tr '\n' ' '` - case "$tmp" in - [0-9]*\ [0-9]*) - XDIM=`echo "$tmp" | sed 's/ .*//'` - YDIM=`echo "$tmp" | sed -e 's/^[^ ]* //' -e 's/ .*//'` - ;; - *) - if [ $DEBUG = 0 ]; then rm -f $TMPFILE; fi - error "Custom page size [XY]DIM != 1-99999" - ;; - esac - XDIM=`dc -e "$XDIM 1200* 72/p"` - YDIM=`dc -e "$YDIM 600* 72/p"` - PAPER=255; paper=letter; - MEDIA=4 - set_clipping 2 100 2 100 - ;; -6|letter) PAPER=6; paper=letter; XDIM="10200"; YDIM="6600" - case "$MODEL" in - 0) set_clipping 204 102 204 106;; - 1) set_clipping 192 96 192 96;; - # 1) set_clipping 96 96 288 96;; - esac - ;; -2|a4|A4) PAPER=2; paper=a4; XDIM="9920"; YDIM="7016" - case "$MODEL" in - 0) set_clipping 200 100 200 100 ;; - 1) set_clipping 192 96 192 96;; - esac - ;; -13|a5|A5) PAPER=13; paper=a5; XDIM="6992"; YDIM="4960" - case "$MODEL" in - 0) set_clipping 200 100 200 100;; - 1) set_clipping 192 96 192 96;; - esac - ;; -4|b5|B5) PAPER=4; paper=b5; XDIM="8598"; YDIM="6070" - case "$MODEL" in - 0) set_clipping 207 107 207 107;; - 1) set_clipping 192 96 192 96;; - esac - ;; -5|b5iso) PAPER=5; paper=b5iso; XDIM="8220"; YDIM="6024" - case "$MODEL" in - 0) set_clipping 207 107 207 107;; - 1) set_clipping 192 96 192 96;; - esac - ;; -8|executive) PAPER=8; paper=executive; XDIM="8700"; YDIM="6300" - case "$MODEL" in - 0) set_clipping 206 102 206 102;; - 1) set_clipping 192 96 192 96;; - esac - ;; -9|legal) PAPER=9; paper=legal; XDIM="10200"; YDIM="8400" - case "$MODEL" in - 0) set_clipping 204 102 204 106;; - 1) set_clipping 192 96 192 96;; - esac - ;; -10|"env#10") PAPER=10; paper=env10; XDIM="4950"; YDIM="5700" - case "$MODEL" in - 0) set_clipping 171 78 171 78;; - 1) set_clipping 171 78 171 78;; - esac - ;; -11|envDL) PAPER=11; paper=envDL; XDIM="5200"; YDIM="5200" - case "$MODEL" in - 0) set_clipping 176 84 176 84;; - 1) set_clipping 176 84 176 84;; - esac - ;; - -28|envC5) PAPER=28; paper=envC5; XDIM="7650"; YDIM="5408" - case "$MODEL" in - 0) set_clipping 170 80 169 80;; - 1) set_clipping 170 80 169 80;; - esac - ;; -34|envB5) PAPER=34; paper=envB5; XDIM="8316"; YDIM="5892" - case "$MODEL" in - 0) set_clipping 174 74 174 74;; - 1) set_clipping 174 74 174 74;; - esac - ;; -37|envMonarch) PAPER=37; paper=envMonarch;XDIM="4650"; YDIM="4500" - case "$MODEL" in - 0) set_clipping 174 78 173 78;; - 1) set_clipping 174 78 173 78;; - esac - ;; -*) error "Unimplemented paper code $PAPER";; -esac -# e.g. /usr/share/ghostscript/7.07/lib/gs_statd.ps -PAPERSIZE="-sPAPERSIZE=$paper"; - -case "$RES" in -600x600) XDIM=`expr $XDIM / 2`;; -1200x600) ;; -esac -DIM="${XDIM}x${YDIM}" - -# -# Filter thru psnup if N-up printing has been requested -# -case $NUP in -[234689]|1[024568]) PREFILTER="nup";; -*) PREFILTER=cat;; -esac -if [ "$DEBUG" -ge 9 ]; then - PREFILTER="tee /tmp/$BASENAME.ps" -fi - -# -# 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) - ;; - *) - if [ -x /usr/bin/logger ]; then - logger -t "$BASENAME" -p lpr.info -- \ - "`basename $ICC2PS` -o $GAMMAFILE -t$INTENT > $ICCTMP.crd.ps" - fi - $ICC2PS -o $GAMMAFILE -t$INTENT > $ICCTMP.crd.ps 2>$ICCTMP.log \ - || error "Problem converting .ICM file to Postscript" - ;; - esac - - PSTOPS_OPTS="$PSTOPS_OPTS -c" - cat > $ICCTMP.usecie.ps <<-EOF - %!PS-Adobe-3.0 - <>setpagedevice - EOF - if [ "$QUALITY" = wts -o "$QUALITY" = as ]; then - if [ "$QUALITY" = wts ]; then - cat >> $ICCTMP.usecie.ps <<-EOF - << /UseWTS true >> setuserparams - EOF - else - cat >> $ICCTMP.usecie.ps <<-EOF - << /UseWTS false >> setuserparams - EOF - fi - cat >> $ICCTMP.usecie.ps <<-EOF - << - /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 - GAMMAFILE= - fi -} - -if [ $DEBUG -gt 0 ]; then - ICCTMP=/tmp/icc -else - ICCTMP=/tmp/icc$$ -fi - -if [ "" = "$COLOR" ]; then - COLORMODE= - GAMMAFILE= -else - case "$COLORMODE" in - default) COLORMODE=$DEFAULTCOLORMODE;; - esac - case "$GAMMAFILE" in - default) GAMMAFILE=lexRPCA2000.icm;; - esac -fi - -CRDBASE="$PREFIX/share/foo2slx/crd" -case "$RES" in - 600x600) SCREEN=screen1200.ps;; - 1200x600) SCREEN=screen1200.ps;; -esac - -PSTOPS_OPTS="-n" - -case "$COLORMODE" in -0|"") - # 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|photo) - # Photo - GAMMAFILE="$CRDBASE/prolog.ps" - GAMMAFILE="$GAMMAFILE $CRDBASE/2300w-1200@150-l250-kx,ucr125,75-per.crd" - GAMMAFILE="$GAMMAFILE $CRDBASE/$SCREEN" - ;; -2|graphics) - # Photo and Text - GAMMAFILE="$CRDBASE/prolog.ps" - #GAMMAFILE="$GAMMAFILE $CRDBASE/2300w-1200@150-l250-kx,ucr100,75-per.crd" - GAMMAFILE="$GAMMAFILE $CRDBASE/kh.crd" - GAMMAFILE="$GAMMAFILE $CRDBASE/$SCREEN" - ;; -3|text) - # Graphic and Text - GAMMAFILE="$CRDBASE/prolog.ps" - #GAMMAFILE="$GAMMAFILE $CRDBASE/2300w-1200@150-l250-kx,ucr100,50-per.crd" - GAMMAFILE="$GAMMAFILE $CRDBASE/kx.crd" - GAMMAFILE="$GAMMAFILE $CRDBASE/$SCREEN" - ;; -4|tonersave) - # Reduced toner - GAMMAFILE="$CRDBASE/prolog.ps" - GAMMAFILE="$GAMMAFILE $CRDBASE/2300w-1200@150-l250-kx,ucr100,0-per.crd" - GAMMAFILE="$GAMMAFILE $CRDBASE/$SCREEN" - ;; -*.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'" - ;; -esac - -if [ "$COLOR" != "" -a "$QUALITY" = wts ]; then - PSTOPS_OPTS="$PSTOPS_OPTS -w" -elif [ "$COLOR" != "" -a "$QUALITY" = as ]; then - PSTOPS_OPTS="$PSTOPS_OPTS -a" -fi - -if [ "" != "$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 - fi -fi - -# -# 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" - -foo2zjs-pstops $PSTOPS_OPTS | \ -$PREFILTER \ -| ($GS $PAPERSIZE -g$DIM -r$RES $GSDEV $GSOPTS \ - -sOutputFile="|cat 1>&3" $GAMMAFILE -_ >/dev/null) 3>&1 \ -| foo2slx -r$RES -g$DIM -p$PAPER -m$MEDIA -n$COPIES -d$DUPLEX -s$SOURCE \ - -z$MODEL $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 -- \ - "foo2slx -r$RES -g$DIM -p$PAPER -m$MEDIA \ --n$COPIES -d$DUPLEX -s$SOURCE -z$MODEL $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 -fi - -exit 0 diff --git a/foo2slx-wrapper.1 b/foo2slx-wrapper.1 deleted file mode 100644 index 59390af..0000000 --- a/foo2slx-wrapper.1 +++ /dev/null @@ -1,372 +0,0 @@ -'\" t -'\" -'\" DO NOT EDIT! This file is generated from foo2slx-wrapper.1in -'\" -'\" t -.TH foo2slx-wrapper 1 "Sun May 26 18:25:20 2024" "foo2slx-wrapper 0.0" -'\" -'\" -'\"========================================================================== -'\" STRINGS and MACROS -'\"========================================================================== -'\" -'\" Define strings for special characters that nroff doesn't have -'\" -'\" N.B. using .if cua to test for special characters did not work. -'\" -.if !'\*[.T]'ps' .ds ua up -.if '\*[.T]'ps' .ds ua \(ua -.if !'\*[.T]'ps' .ds da down -.if '\*[.T]'ps' .ds da \(da -.if !'\*[.T]'ps' .ds <- left -.if '\*[.T]'ps' .ds <- \(<- -.if !'\*[.T]'ps' .ds -> right -.if '\*[.T]'ps' .ds -> \(-> -'\" -'\" bx - box a Courier string for making keycaps -'\" -'\" N.B. this mess is to make the line drawing come out only -'\" if we are really generating postscript -'\" -.de bx -.ie !'\*[.T]'ps' \{\ -. RB [ \\$1 ]\\$2 -.\} -.el \{\ -. ie !r ps4html \{\ -'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul' -. ft CW -. nr par*bxw \w'\\$1'+.4m -\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\ -\Z'\h'.2m'\s-1\\$1\s+1'\ -\h'\\n[par*bxw]u'\\$2 -. ft P -. \} -. el \{\ -. RB [ \\$1 ]\\$2 -. \} -.\} -.. -'\" -'\" strings to set current color (null with old groff) -'\" -.if mred .ds red \m[red] -.if mgreen .ds green \m[green] -.if mblue .ds blue \m[blue] -.if mblack .ds black \m[black] -.if mblack .ds mP \mP -'\" -'\" fix for grotty + xterm. We call for orange, grotty outputs yellow, -'\" but xterm displays yellow as orange. The cycle is complete. -'\" -.if n .defcolor orange rgb #ffff00 -'\" -'\" color - set the current color (ignores request with old groff) -'\" -.de color -.if mred \m[\\$1]\c -.. -'\" -'\" colorword - colorize a word (ignored by old groff) -'\" -.de colorword -.ie m\\$1 \m[\\$1]\\$2\mP\c -.el \\$2\c -.. -'\" -'\" colbox - colorize a word in a filled box -'\" -.de colbox -.ie mred \M[\\$2]\ -\v'+.167v'\ -\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\ -\v'-.167v'\ -\m[\\$1]\\$3\mP\MP -.el \\$3\c -.. -'\" -'\" Macros for doing pdfmarks -'\" -.de specialps -.if '\*[.T]'ps' \\k_\X'ps: \\$*'\h'|\\n_u'\c -.. -'\" -'\" pdfmark PDFMARKCODE -'\" -.ds pdfmarks -.if d pdfmarks \{\ -.de pdfmark -. specialps exec [\\$1 pdfmark -.. -'\" -'\" pdfdest LINKNAME -'\" -.de pdfdest -.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST" -.. -'\" -'\" pdfbookmark COUNT LINKNAME STRING -'\" -.de pdfbookmark -. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT" -.. -'\" -'\" Define the SH and SS macros to save pdfmark information -'\" in "arrays" of numbers and strings. -'\" -.if !r rr_n \{\ -.nr rr_n 0 1 -.am SH -. nr rr_levels!\\n+[rr_n] 2 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.am SS -. nr rr_levels!\\n+[rr_n] 3 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.\} -'\" -'\" Called at the end of the document to generate the pdfmark outline -'\" -.de pdf_outline -.nr rr_levels!\\n+[rr_n] 1 -.nr rr_i 0 1 -.while \\n+[rr_i]<\\n[rr_n] \{\ -. nr rr_ip1 \\n[rr_i]+1 -. nr rr_count 0 -. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\ -. nr rr_j \\n[rr_i] 1 -. while \\n+[rr_j]<\\n[rr_n] \{\ -. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\ -. break -. \} -. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\ -. nr rr_count \\n[rr_count]+1 -. \} -. \} -. \} -. ds hhh \\*[rr_labels!\\n[rr_i]] -. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]" -.\} -.. -'\" -'\" Some postscript to make pdfmarks harmless on old interpreters... -'\" -.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse" -'\" -'\" Force display of Bookmarks in Acrobat when document is viewed. -'\" -.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW" -'\" -'\" Output the document info in pdfmarks -'\" -.pdfmark "\ - /Title (\*[an-title](\*[an-section])) \ - /Subject (\*[an-title] Manual Page) \ - /Author (Rick Richardson) \ - /Keywords (printing) \ - /Creator (groff \n(.x.\n(.y.\n(.Y -man) \ - /CreationDate (\*[an-extra1]) \ - /ModDate (\*[an-extra1]) \ - /DOCINFO" -\} -'\" -'\" The manual page name is only 1st level mark -'\" -.nr rr_levels!\n+[rr_n] 1 -.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section]) -.pdfdest Link\n[rr_n] -'\" -'\"========================================================================== -'\" MANUAL PAGE SOURCE -'\"========================================================================== -.SH NAME -foo2slx-wrapper \- Convert Postscript into a SLX printer stream -.SH SYNOPSIS -.B foo2slx-wrapper -.RI [ options "] [" ps-file ] -.SH DESCRIPTION -.B foo2slx-wrapper -is a Foomatic compatible printer wrapper for the \fBfoo2slx\fP printer driver. -This script reads a Postscript \fIps-file\fP or standard input -and converts it to Software Imaging K.K. SLX printer format -for driving the Lexmark C500 network color laser printer -and other SLX-based printers. -.P -This script can be used in a standalone fashion, but is intended to -be called from a printer spooler system which uses the Foomatic -printer database. - -.SH COMMAND LINE OPTIONS -.SS Normal Options -These are the options used to select the parameters of a -print job that are usually controlled on a per job basis. -.TP -.BI \-c -Print in color (else monochrome). -.TP -.BI \-m\0 media -Media code to send to printer [0]. -.TS -l l l -l n n. -_ -Media SLX -_ -plain 0 -transparency 1 -labels 2 -thick1 3 -envelope1 4 -thin 5 -thick2 6 -envelope2 7 -middle 8 -special 9 -.TE -.TP -.BI \-p\0 paper -Paper size code to send to printer [6]. -.TS -box; -| n l | n l. -6 letter 2 A4 -9 legal 4 B5 -8 executive 5 B5iso -10 env #10 11 env DL -.TE -.TP -.BI \-n\0 copies -Number of copies [1]. -.TP -.BI \-r\0 xres x yres -Set device resolution in pixels/inch [1200x600]. -.TP -.BI \-s\0 source -Source (Input Slot) code to send to printer [0]. -.TS -box; -| n l | n l. -0 auto 1 cassette1 -.TE -.TP -.BI "\-2 \-3 \-4 \-5 \-6 \-8 \-9 \-10 \-12 \-14 \-15 \-16 \-18" -Print in N-up. Requires the \fBpsutils\fP package. -.TP -.BI \-o\0 orient -Orientation used for N-up. -.TS -l l l. -Portrait -op (normal) -Landscape -ol (rotated 90 degrees anticlockwise) -Seascape -os (rotated 90 degrees clockwise) -.TE -.SS Printer Tweaking Options -These are the options used to customize the operation of \fBfoo2slx\fP -for a particular printer. -.TP -.BI \-u\0 xoff x yoff -Set the offset of the start of the printable region from the -upper left corner, in pixels [varies with paper size]. -The defaults should work on the 2200DL and 2300DL, and have not -been tested on any other printers. -.TP -.BI \-l\0 xoff x yoff -Set the offset of the end of the printable region from the -lower right corner, in pixels [varies with paper size]. -The defaults should work on the 2200DL and 2300DL, and have not -been tested on any other printers. -.TP -.BI \-L\0 mask -Send the logical clipping values from -u/-l in the ZjStream. -\fBfoo2slx-wrapper\fP always runs Ghostscript with the ideal page dimensions, -so that the scale of the image is correct, -regardless whether or not the printer has unprintable regions. -This option is used to move the position of the clipped image -back to where it belongs on the page. The default is to send -the amount which was clipped by -u and -l, and should be -good in most cases. -.TS -l l. -0 don't send any logical clipping amounts -1 only send Y clipping amount -2 only send X clipping amount -3 send both X and Y clipping amounts -.TE -.SS Color Tweaking Options -These are the options used to control the quality of color output. -Color correction is currently a WORK IN PROGRESS. -.TP -.BI \-g\0 gsopts -Additional options to pass to Ghostscript, such as -g\(lq-dDITHERPPI=nnn\(rq, -etc. This option may appear more than once. -.TP -.BI \-G\0 profile.icm -Convert \fIprofile.icm\fP to a Postscript color rendering -dictionary (CRD) using \fBfoo2zjs-icc2ps\fP and -adjust the printer colors by using the Postscript \fBsetcolorrendering\fP -operator. (WORK IN PROGRESS). -.TP -.BI \-G\0 gamma-file.ps -Prepend \fIgamma-file.ps\fP to the Postscript input to perform -color correction using the \fBsetcolortransfer\fP Postscript operator. -For example, the file might contain: -.br -{0.333 exp} {0.333 exp} {0.333 exp} {0.333 exp} setcolortransfer -.TP -.BI \-I\0 intent -Select profile intent from the ICM file. -0=Perceptual, 1=Colorimetric, 2=Saturation, 3=Absolute. -Default is 0 (perceptual). -.SS Debugging Options -These options are used for debugging \fBfoo2slx\fP and its wrapper. -.TP -.BI \-S\0 plane -Output just a single color plane from a color print and print it -on the black plane. The default is to output all color planes. -.TS -l l. -1 Cyan -2 Magenta -3 Yellow -4 Black -.TE -.TP -.BI \-D\0 level -Set Debug level [0]. - -.SH EXAMPLES -Create a monochrome ZjStream from a Postscript document, -examine it, and then print it using a RAW print queue: - -.RS -.nf -foo2slx-wrapper testpage.ps > testpage.zm -slxdecode < testpage.zm -lpr -P raw testpage.zm -.fi -.RE -.P -Create a color ZjStream stream from a Postscript document: - -.RS -.nf -foo2slx-wrapper -c testpage.ps > testpage.zc -.fi -.RE - -.SH FILES -.BR /usr/bin/foo2slx-wrapper -.SH SEE ALSO -.BR foo2slx (1), -.BR slxdecode (1) -.SH "AUTHOR" -Rick Richardson -.br -http://foo2slx.rkkda.com/ -'\" -'\" -'\" -.em pdf_outline diff --git a/foo2slx-wrapper.1in b/foo2slx-wrapper.1in index 966ec6f..81326a1 100644 --- a/foo2slx-wrapper.1in +++ b/foo2slx-wrapper.1in @@ -83,9 +83,9 @@ Print in N-up. Requires the \fBpsutils\fP package. Orientation used for N-up. .TS l l l. -Portrait -op (normal) -Landscape -ol (rotated 90 degrees anticlockwise) -Seascape -os (rotated 90 degrees clockwise) +Portrait \-op (normal) +Landscape \-ol (rotated 90 degrees anticlockwise) +Seascape \-os (rotated 90 degrees clockwise) .TE .SS Printer Tweaking Options These are the options used to customize the operation of \fBfoo2slx\fP @@ -104,13 +104,13 @@ The defaults should work on the 2200DL and 2300DL, and have not been tested on any other printers. .TP .BI \-L\0 mask -Send the logical clipping values from -u/-l in the ZjStream. +Send the logical clipping values from \-u/-l in the ZjStream. \fBfoo2slx-wrapper\fP always runs Ghostscript with the ideal page dimensions, so that the scale of the image is correct, regardless whether or not the printer has unprintable regions. This option is used to move the position of the clipped image back to where it belongs on the page. The default is to send -the amount which was clipped by -u and -l, and should be +the amount which was clipped by \-u and \-l, and should be good in most cases. .TS l l. @@ -124,7 +124,7 @@ These are the options used to control the quality of color output. Color correction is currently a WORK IN PROGRESS. .TP .BI \-g\0 gsopts -Additional options to pass to Ghostscript, such as -g\(lq-dDITHERPPI=nnn\(rq, +Additional options to pass to Ghostscript, such as \-g\(lq-dDITHERPPI=nnn\(rq, etc. This option may appear more than once. .TP .BI \-G\0 profile.icm @@ -169,7 +169,7 @@ examine it, and then print it using a RAW print queue: .nf foo2slx-wrapper testpage.ps > testpage.zm slxdecode < testpage.zm -lpr -P raw testpage.zm +lpr \-P raw testpage.zm .fi .RE .P @@ -177,7 +177,7 @@ Create a color ZjStream stream from a Postscript document: .RS .nf -foo2slx-wrapper -c testpage.ps > testpage.zc +foo2slx-wrapper \-c testpage.ps > testpage.zc .fi .RE diff --git a/foo2slx-wrapper.in b/foo2slx-wrapper.in index 0a3f143..ede8ceb 100755 --- a/foo2slx-wrapper.in +++ b/foo2slx-wrapper.in @@ -13,8 +13,8 @@ #* GNU General Public License for more details. #* #* You should have received a copy of the GNU General Public License -#* along with this program; if not, write to the Free Software -#* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +#* along with this program; if not, see +#* . #* #* Authors: Rick Richardson diff --git a/foo2slx.1 b/foo2slx.1 deleted file mode 100644 index 8963aed..0000000 --- a/foo2slx.1 +++ /dev/null @@ -1,339 +0,0 @@ -'\" t -'\" -'\" DO NOT EDIT! This file is generated from foo2slx.1in -'\" -'\" t -.TH foo2slx 1 "Sun May 26 18:25:20 2024" "foo2slx 0.0" -'\" -'\" -'\"========================================================================== -'\" STRINGS and MACROS -'\"========================================================================== -'\" -'\" Define strings for special characters that nroff doesn't have -'\" -'\" N.B. using .if cua to test for special characters did not work. -'\" -.if !'\*[.T]'ps' .ds ua up -.if '\*[.T]'ps' .ds ua \(ua -.if !'\*[.T]'ps' .ds da down -.if '\*[.T]'ps' .ds da \(da -.if !'\*[.T]'ps' .ds <- left -.if '\*[.T]'ps' .ds <- \(<- -.if !'\*[.T]'ps' .ds -> right -.if '\*[.T]'ps' .ds -> \(-> -'\" -'\" bx - box a Courier string for making keycaps -'\" -'\" N.B. this mess is to make the line drawing come out only -'\" if we are really generating postscript -'\" -.de bx -.ie !'\*[.T]'ps' \{\ -. RB [ \\$1 ]\\$2 -.\} -.el \{\ -. ie !r ps4html \{\ -'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul' -. ft CW -. nr par*bxw \w'\\$1'+.4m -\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\ -\Z'\h'.2m'\s-1\\$1\s+1'\ -\h'\\n[par*bxw]u'\\$2 -. ft P -. \} -. el \{\ -. RB [ \\$1 ]\\$2 -. \} -.\} -.. -'\" -'\" strings to set current color (null with old groff) -'\" -.if mred .ds red \m[red] -.if mgreen .ds green \m[green] -.if mblue .ds blue \m[blue] -.if mblack .ds black \m[black] -.if mblack .ds mP \mP -'\" -'\" fix for grotty + xterm. We call for orange, grotty outputs yellow, -'\" but xterm displays yellow as orange. The cycle is complete. -'\" -.if n .defcolor orange rgb #ffff00 -'\" -'\" color - set the current color (ignores request with old groff) -'\" -.de color -.if mred \m[\\$1]\c -.. -'\" -'\" colorword - colorize a word (ignored by old groff) -'\" -.de colorword -.ie m\\$1 \m[\\$1]\\$2\mP\c -.el \\$2\c -.. -'\" -'\" colbox - colorize a word in a filled box -'\" -.de colbox -.ie mred \M[\\$2]\ -\v'+.167v'\ -\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\ -\v'-.167v'\ -\m[\\$1]\\$3\mP\MP -.el \\$3\c -.. -'\" -'\" Macros for doing pdfmarks -'\" -.de specialps -.if '\*[.T]'ps' \\k_\X'ps: \\$*'\h'|\\n_u'\c -.. -'\" -'\" pdfmark PDFMARKCODE -'\" -.ds pdfmarks -.if d pdfmarks \{\ -.de pdfmark -. specialps exec [\\$1 pdfmark -.. -'\" -'\" pdfdest LINKNAME -'\" -.de pdfdest -.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST" -.. -'\" -'\" pdfbookmark COUNT LINKNAME STRING -'\" -.de pdfbookmark -. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT" -.. -'\" -'\" Define the SH and SS macros to save pdfmark information -'\" in "arrays" of numbers and strings. -'\" -.if !r rr_n \{\ -.nr rr_n 0 1 -.am SH -. nr rr_levels!\\n+[rr_n] 2 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.am SS -. nr rr_levels!\\n+[rr_n] 3 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.\} -'\" -'\" Called at the end of the document to generate the pdfmark outline -'\" -.de pdf_outline -.nr rr_levels!\\n+[rr_n] 1 -.nr rr_i 0 1 -.while \\n+[rr_i]<\\n[rr_n] \{\ -. nr rr_ip1 \\n[rr_i]+1 -. nr rr_count 0 -. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\ -. nr rr_j \\n[rr_i] 1 -. while \\n+[rr_j]<\\n[rr_n] \{\ -. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\ -. break -. \} -. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\ -. nr rr_count \\n[rr_count]+1 -. \} -. \} -. \} -. ds hhh \\*[rr_labels!\\n[rr_i]] -. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]" -.\} -.. -'\" -'\" Some postscript to make pdfmarks harmless on old interpreters... -'\" -.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse" -'\" -'\" Force display of Bookmarks in Acrobat when document is viewed. -'\" -.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW" -'\" -'\" Output the document info in pdfmarks -'\" -.pdfmark "\ - /Title (\*[an-title](\*[an-section])) \ - /Subject (\*[an-title] Manual Page) \ - /Author (Rick Richardson) \ - /Keywords (printing) \ - /Creator (groff \n(.x.\n(.y.\n(.Y -man) \ - /CreationDate (\*[an-extra1]) \ - /ModDate (\*[an-extra1]) \ - /DOCINFO" -\} -'\" -'\" The manual page name is only 1st level mark -'\" -.nr rr_levels!\n+[rr_n] 1 -.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section]) -.pdfdest Link\n[rr_n] -'\" -'\"========================================================================== -'\" MANUAL PAGE SOURCE -'\"========================================================================== -.SH NAME -foo2slx \- Convert Ghostscript pbmraw or bitcmyk format into a -SLX printer stream -.SH SYNOPSIS -.B foo2slx -.RI [ options "] <" pbmraw-file " >" slx-file -.sp 1 -.B foo2slx -.RI [ options "] <" bitcmyk-file " >" slx-file -.sp 1 -.B foo2slx -.RI [ options "] <" pksmraw-file " >" slx-file -.SH DESCRIPTION -.B foo2slx -converts Ghostscript pbmraw, bitcmyk, or pksmraw output formats to monochrome -or color SLX streams, -for driving the Lexmark C500 network color laser printer -and other SLZ-based printers. The SLX stream is a variant of ZjStream -produced by Software Imaging K.K. - -.SH COMMAND LINE OPTIONS -.SS Normal Options -These are the options used to select the parameters of a -print job that are usually controlled on a per job basis. -.TP -.BI \-c -Force color mode if autodetect doesn't work. -.TP -.BI \-g\0 xpix x ypix -Set page dimensions in pixels [10200x6600]. -.TP -.BI \-m\0 media -Media code to send to printer [0]. -.TS -l l l -l n n. -_ -Media SLX -_ -plain 0 -transparency 1 -labels 2 -thick1 3 -envelope1 4 -thin 5 -thick2 6 -envelope2 7 -middle 8 -special 9 -.TE -.TP -.BI \-p\0 paper -Paper code to send to printer [6]. -.TS -box; -| n l | n l. -6 letter 2 A4 -9 legal 4 B5 -8 executive 5 B5iso -10 env #10 11 env DL -.TE -.TP -.BI \-n\0 copies -Number of copies [1]. -.TP -.BI \-r\0 xres x yres -Set device resolution in pixels/inch [1200x600]. -.TP -.BI \-s\0 source -Source (InputSlot) code to send to printer [0]. -.TS -| n l | n l. -0 auto 1 cassette1 -.TE -.SS Printer Tweaking Options -These are the options used to customize the operation of \fBfoo2slx\fP -for a particular printer. -.TP -.BI \-u\0 xoff x yoff -Set the offset of the start of the printable region from the -upper left corner, in pixels [0x0]. -.TP -.BI \-l\0 xoff x yoff -Set the offset of the end of the printable region from the -lower right corner, in pixels [0x0]. -.TP -.BI \-L\0 mask -Send logical clipping amounts implied by -u/-l in the ZjStream [3]. -.TS -l l. -0 don't send any logical clipping amounts -1 only send Y clipping amount -2 only send X clipping amount -3 send both X and Y clipping amounts -.TE -.TP -.BI \-A -AllIsBlack: convert C=1,M=1,Y=1 to just K=1. Works with bitcmyk input only. -.TP -.BI \-B -BlackClears: K=1 forces C,M,Y to 0. Works with bitcmyk input only. -.TP -.SS Debugging Options -These options are used for debugging \fBfoo2slx\fP. -.TP -.BI \-S\0 plane -Output just a single color plane from a color print and print it -on the black plane. The default is to output all color planes. -.TS -l l. -1 Cyan -2 Magenta -3 Yellow -4 Black -.TE -.TP -.BI \-D\0 level -Set Debug level [0]. - -.SH EXAMPLES -Create a black and white SLX stream: - -.RS -.nf -gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE \ - -sPAPERSIZE=letter -r1200x600 -sDEVICE=pbmraw \ - -sOutputFile=- - < testpage.ps \ -| foo2slx -r1200x600 -g10200x6600 -p1 >testpage.zm -.fi -.RE -.P -Create a color SLX stream: - -.RS -.nf -gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE \ - -sPAPERSIZE=letter -g10200x6600 -r1200x600 -sDEVICE=bitcmyk \ - -sOutputFile=- - < testpage.ps \ -| foo2slx -r1200x600 -g10200x6600 -p1 >testpage.zc -.fi -.RE - -.SH FILES -.BR /usr/bin/foo2slx -.SH SEE ALSO -.BR foo2slx-wrapper (1), -.BR slxdecode (1) -.SH "AUTHOR" -Rick Richardson -.br -http://foo2slx.rkkda.com/ -'\" -'\" -'\" -.em pdf_outline diff --git a/foo2slx.1in b/foo2slx.1in index 5a431e0..8eab873 100644 --- a/foo2slx.1in +++ b/foo2slx.1in @@ -93,7 +93,7 @@ Set the offset of the end of the printable region from the lower right corner, in pixels [0x0]. .TP .BI \-L\0 mask -Send logical clipping amounts implied by -u/-l in the ZjStream [3]. +Send logical clipping amounts implied by \-u/-l in the ZjStream [3]. .TS l l. 0 don't send any logical clipping amounts @@ -130,10 +130,10 @@ Create a black and white SLX stream: .RS .nf -gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE \ - -sPAPERSIZE=letter -r1200x600 -sDEVICE=pbmraw \ - -sOutputFile=- - < testpage.ps \ -| foo2slx -r1200x600 -g10200x6600 -p1 >testpage.zm +gs \-q \-dBATCH \-dSAFER \-dQUIET \-dNOPAUSE \ + \-sPAPERSIZE=letter \-r1200x600 \-sDEVICE=pbmraw \ + \-sOutputFile=- \- < testpage.ps \ +| foo2slx \-r1200x600 \-g10200x6600 \-p1 >testpage.zm .fi .RE .P @@ -141,10 +141,10 @@ Create a color SLX stream: .RS .nf -gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE \ - -sPAPERSIZE=letter -g10200x6600 -r1200x600 -sDEVICE=bitcmyk \ - -sOutputFile=- - < testpage.ps \ -| foo2slx -r1200x600 -g10200x6600 -p1 >testpage.zc +gs \-q \-dBATCH \-dSAFER \-dQUIET \-dNOPAUSE \ + \-sPAPERSIZE=letter \-g10200x6600 \-r1200x600 \-sDEVICE=bitcmyk \ + \-sOutputFile=- \- < testpage.ps \ +| foo2slx \-r1200x600 \-g10200x6600 \-p1 >testpage.zc .fi .RE diff --git a/foo2slx.c b/foo2slx.c index 60952b1..7e2ffdd 100644 --- a/foo2slx.c +++ b/foo2slx.c @@ -25,8 +25,8 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +along with this program; if not, see +. If you want to use this program under different license conditions, then contact the author for an arrangement. diff --git a/foo2xqx b/foo2xqx deleted file mode 100755 index 348c5df..0000000 Binary files a/foo2xqx and /dev/null differ diff --git a/foo2xqx-wrapper b/foo2xqx-wrapper deleted file mode 100755 index d79471d..0000000 --- a/foo2xqx-wrapper +++ /dev/null @@ -1,693 +0,0 @@ -#!/bin/sh - -#* Copyright (C) 2003-2006 Rick Richardson -#* -#* This program is free software; you can redistribute it and/or modify -#* it under the terms of the GNU General Public License as published by -#* the Free Software Foundation; either version 2 of the License, or -#* (at your option) any later version. -#* -#* This program is distributed in the hope that it will be useful, -#* but WITHOUT ANY WARRANTY; without even the implied warranty of -#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -#* GNU General Public License for more details. -#* -#* You should have received a copy of the GNU General Public License -#* along with this program; if not, write to the Free Software -#* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#* -#* Authors: Rick Richardson - -VERSION='$Id: foo2xqx-wrapper.in,v 1.41 2013/12/25 21:00:11 rick Exp $' - -# -# Printer Notes: -# -# HP LaserJet P1005 - -# HP LaserJet P1006 - -# HP LaserJet P1007 - -# HP LaserJet P1008 - -# HP LaserJet P1505 - -# HP LaserJet P1505n - -# HP LaserJet P2014 - -# HP LaserJet P2014n - -# HP LaserJet M1005 MFP - -# HP LaserJet M1120 MFP - -# HP LaserJet Pro M1212nf MFP - -# - -PROGNAME="$0" -BASENAME=`basename $PROGNAME` -PREFIX=/usr -SHARE=$PREFIX/share/foo2xqx -PATH=$PATH:/sw/bin:/opt/local/bin - -# -# Log the command line, for debugging and problem reports -# -if [ -x /usr/bin/logger -o -x /bin/logger ]; then - logger -t "$BASENAME" -p lpr.info -- "$BASENAME $@" x Set device resolution in pixels/inch [$RES] --s source Source code to send to printer [$SOURCE] - 1=upper, 2=lower, 4=manual, 7=auto - Code numbers may vary with printer model. --t Draft mode. Every other pixel is white. --T density Print density (1-5) [$DENSITY] --2/-3/-4/-6/-8/-10/-12/-14/-15/-16/-18 - Print with N-up (requires psutils) --o orient For N-up: -op is portrait, -ol is landscape, -os is seascape. - -Printer Tweaking Options: --u x Set offset of upper left printable in pixels [varies] --l x Set offset of lower right printable in pixels [varies] --L mask Send logical clipping values from -u/-l in ZjStream [3] - 0=no, 1=Y, 2=X, 3=XY --P Do not output START_PLANE codes. May be needed by some - monochrome-only printers. --X padlen Add extra zero padding to the end of BID segments [16] - -Color Tweaking Options: --g gsopts Additional options to pass to Ghostscript, such as - -dDITHERPPI=nnn, etc. May appear more than once. [] --G profile.icm Convert profile.icm to a Postscript CRD using icc2ps and - adjust colors using the setcolorrendering PS operator. - $SHARE/icm/ will be searched for profile.icm. --I intent Select profile intent from ICM file [$INTENT] - 0=Perceptual, 1=Colorimetric, 2=Saturation, 3=Absolute --G gamma-file.ps Prepend gamma-file to the Postscript input to perform - color correction using the setcolortransfer PS operator. - -Debugging Options: --S plane Output just a single color plane from a color print [all] - 1=Cyan, 2=Magenta, 3=Yellow, 4=Black --D lvl Set Debug level [$DEBUG] --V $VERSION -EOF - - exit 1 -} - -# -# Report an error and exit -# -error() { - echo "$BASENAME: $1" >&2 - exit 1 -} - -dbgcmd() { - if [ $DEBUG -ge 1 ]; then - echo "$@" >&2 - fi - "$@" -} - -# -# N-up-ify the job. Requires psnup from psutils package -# -nup() { - case "$NUP" in - [2368]|1[0458]) - tr '\r' '\n' | psnup $NUP_ORIENT -d2 -$NUP -m.3in -p$paper -q - ;; - [49]|1[26]) - tr '\r' '\n' | psnup $NUP_ORIENT -d2 -$NUP -m.5in -p$paper -q - ;; - *) - error "Illegal call to nup()." - ;; - esac -} - -# -# Process the options -# - -# Try to use a local copy of GhostScript 8.54, if available. Otherwise, -# fallback to whatever the Linux distro has installed (usually 7.07) -# -# N.B. := operator used here, when :- would be better, because "ash" -# doesn't have :- -if eval gs.foo -v >/dev/null 2>&1; then - GSBIN=${GSBIN:-gs.foo} -else - GSBIN=${GSBIN:-gs} -fi - -CMDLINE="$*" -DEBUG=0 -DUPLEX=1 -COLOR= -COLORMODE=0 -# What mode to use if the user wants us to pick the "best" mode -case `$GSBIN --version` in -7*) DEFAULTCOLORMODE=10 - DEFAULTCOLORMODE=2 - ;; -*) DEFAULTCOLORMODE=2 - ;; -esac -QUALITY=1 -QUALITY=wts -MEDIA=1 -COPIES=1 -PAPER=1 -RES=1200x600 -SOURCE=7 -NUP= -CLIP_UL= -CLIP_LR= -CLIP_LOG= -BC= -AIB= -NOPLANES= -COLOR2MONO= -GAMMAFILE= -INTENT=0 -GSOPTS= -EXTRAPAD= -SAVETONER= -DENSITY=3 #Medium -NUP_ORIENT= -GSDEV=-sDEVICE=pbmraw -# What mode to use if the user wants us to pick the "best" mode -case `$GSBIN --version` in -8.1*) - QUALITY=1 - ;; -esac -while getopts "1:23456789o:b:cC:d:g:l:u:L:m:n:p:q:r:s:tT:ABS:D:G:I:PX:Vh?" opt -do - case $opt in - b) GSBIN="$OPTARG";; - c) COLOR=-c;; - d) DUPLEX="$OPTARG";; - g) GSOPTS="$GSOPTS $OPTARG";; - m) MEDIA="$OPTARG";; - n) COPIES="$OPTARG";; - p) PAPER="$OPTARG";; - q) QUALITY="$OPTARG";; - r) RES="$OPTARG";; - s) SOURCE="$OPTARG";; - t) SAVETONER="-t";; - T) DENSITY="$OPTARG";; - l) CLIP_LR="-l $OPTARG";; - u) CLIP_UL="-u $OPTARG";; - L) CLIP_LOG="-L $OPTARG";; - A) AIB=-A;; - B) BC=-B;; - C) COLORMODE="$OPTARG";; - S) COLOR2MONO="-S$OPTARG";; - D) DEBUG="$OPTARG";; - G) GAMMAFILE="$OPTARG";; - I) INTENT="$OPTARG";; - P) NOPLANES=-P;; - X) EXTRAPAD="-X $OPTARG";; - [234689]) NUP="$opt";; - [57]) error "Can't find acceptable layout for $opt-up";; - 1) case "$OPTARG" in - [024568]) NUP="1$OPTARG";; - *) error "Can't find acceptable layout for 1$OPTARG-up";; - esac - ;; - o) case "$OPTARG" in - l*) NUP_ORIENT=-l;; - s*) NUP_ORIENT=-r;; - p*|*) NUP_ORIENT=;; - esac;; - V) echo "$VERSION"; foo2xqx -V; foo2zjs-pstops -V; exit 0;; - h|\?) - if [ "$CMDLINE" != "-?" -a "$CMDLINE" != -h ]; then - echo "Illegal command:" - echo " $0 $CMDLINE" - echo - fi - usage;; - esac -done -shift `expr $OPTIND - 1` - -# -# If there is an argument left, take it as the file to print. -# Else, the input comes from stdin. -# -if [ $# -ge 1 ]; then - if [ "$LPJOB" = "" ]; then - : # LPJOB="$1" - fi - exec < $1 -fi - -# -case "$QUALITY" in -0) - GSOPTS="-dCOLORSCREEN $GSOPTS" - ;; -1) - GSOPTS="-dCOLORSCREEN $GSOPTS" - ;; -2) - GSOPTS="-dMaxBitmap=500000000 $GSOPTS" - ;; -as) - GSOPTS="-dCOLORSCREEN -dMaxBitmap=500000000 $GSOPTS" - ;; -wts) - GSOPTS="-dCOLORSCREEN -dMaxBitmap=500000000 $GSOPTS" - ;; -esac - -# -# Validate media code -# -case "$MEDIA" in -1|standard) MEDIA=1;; -2|transparency) MEDIA=2;; -3|glossy) MEDIA=3;; -257|envelope) MEDIA=257;; -259|letterhead) MEDIA=259;; -261|thickstock) MEDIA=261;; -262|postcard) MEDIA=262;; -263|labels) MEDIA=263;; -[0-9]*) ;; -*) error "Unknown media code $MEDIA";; -esac - -# -# Validate source (InputSlot) code -# -case "$SOURCE" in -1|upper) SOURCE=1;; -4|manual) SOURCE=4;; -7|auto) SOURCE=7;; -[0-9]*) ;; -*) error "Unknown source code $SOURCE";; -esac - -# -# Validate Duplex code -# -case "$DUPLEX" in -1|off|none) DUPLEX=1;; -2|long*) DUPLEX=2;; -3|short*) DUPLEX=3;; -[0-9]*) ;; -*) error "Unknown duplex code $DUPLEX";; -esac - -# -# Validate Resolution -# -case "$RES" in -600x600) ;; -1200x600) ;; -*) error "Illegal resolution $RES";; -esac - -# -# Validate Print Density -# -case "$DENSITY" in -1|2|3|4|5) ;; -*) error "Illegal print density (-T) $DENSITY";; -esac - -# -# 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. -# -# The Minolta 2200 DL is sensitive to its unprintable regions, -# and will pixel skew if you try to print there. -# -# The HP1000 will print blank pages when asked to print into its -# unprintable region. -# -# The Minolta 2300 DL doesn't care if print into the unprintable -# region. It will do the clipping itself. This is as it should be. -# But it won't hurt it if we do the clipping here. -# -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" in -Custom*x*) - # Command line only - XDIM=`echo "$PAPER" | sed -e "s/Custom.//" -e "s/x.*//" ` - YDIM=`echo "$PAPER" | sed -e "s/.*x//" ` - if [ "$XDIM" = "" -o "$YDIM" = "" ]; then - error "Custom page size '$PAPER' != 1-99999" - fi - if [ "$XDIM" -eq 0 -o "$YDIM" -eq 0 ]; then - error "Custom page size '$PAPER' != 1-99999" - fi - XDIM=`dc -e "$XDIM 1200* 72/p"` - YDIM=`dc -e "$YDIM 600* 72/p"` - PAPER=359; paper=letter; - set_clipping 2 84 2 84 - ;; -Custom*) - # PS job - #%%BeginFeature: *CustomPageSize True - #216 - #360 - #0 - #0 - #0 - #pop pop pop pop pop - - #%%BeginFeature: *CustomPageSize True - #792.000000 612.000000 1 0.000000 0.000000 - #pop pop pop pop pop - - if [ $DEBUG = 0 ]; then - TMPFILE=/tmp/cus$$ - else - TMPFILE=/tmp/custom.ps - fi - cat >$TMPFILE - exec <$TMPFILE - - tmp=`head -n 10000 $TMPFILE \ - | sed -n '/CustomPageSize/{n;p;n;p;}' \ - | tr '\n' ' '` - case "$tmp" in - [0-9]*\ [0-9]*) - XDIM=`echo "$tmp" | sed 's/ .*//'` - YDIM=`echo "$tmp" | sed -e 's/^[^ ]* //' -e 's/ .*//'` - ;; - *) - if [ $DEBUG = 0 ]; then rm -f $TMPFILE; fi - error "Custom page size [XY]DIM != 1-99999" - ;; - esac - XDIM=`dc -e "$XDIM 1200* 72/p"` - YDIM=`dc -e "$YDIM 600* 72/p"` - PAPER=359; paper=letter; - set_clipping 2 84 2 84 - ;; -1|letter) PAPER=1; paper=letter; XDIM="10200"; YDIM="6600" - set_clipping 177 84 177 84 - ;; -5|legal) PAPER=5; paper=legal; XDIM="10200"; YDIM="8400" - set_clipping 177 96 177 96 - ;; -7|executive) PAPER=7; paper=executive; XDIM="8700"; YDIM="6300" - set_clipping 192 96 192 96 - ;; -9|a4|A4) PAPER=9; paper=a4; XDIM="9920"; YDIM="7016" - set_clipping 176 84 176 84 - ;; -11|a5|A5) PAPER=11; paper=a5; XDIM="6992"; YDIM="4960" - set_clipping 192 96 192 96 - ;; -13|b5|B5) PAPER=13; paper=b5; XDIM="8598"; YDIM="6070" - set_clipping 192 96 192 96 - ;; -20|"env#10") PAPER=20; paper=env10; XDIM="4950"; YDIM="5700" - set_clipping 171 78 171 78 - ;; -27|envDL) PAPER=27; paper=envDL; XDIM="5200"; YDIM="5200" - set_clipping 176 84 176 84 - ;; -28|envC5) PAPER=28; paper=envC5; XDIM="7650"; YDIM="5408" - set_clipping 170 80 169 80 - ;; -34|envB5) PAPER=34; paper=envB5; XDIM="8316"; YDIM="5892" - set_clipping 174 74 174 74 - ;; -37|envMonarch) PAPER=37; paper=envMonarch;XDIM="4650"; YDIM="4500" - set_clipping 174 78 173 78 - ;; -257|16k197x273) PAPER=257; paper=executive;XDIM="9306"; YDIM="6448" - set_clipping 173 84 173 84 - ;; -263|16k184x260) PAPER=263; paper=executive;XDIM="8692"; YDIM="6142" - set_clipping 122 87 122 87 - ;; -264|16k195x270) PAPER=264; paper=executive;XDIM="9212"; YDIM="6378" - set_clipping 126 87 126 87 - ;; -*) error "Unimplemented paper code $PAPER";; -esac -PAPERSIZE="-sPAPERSIZE=$paper"; - -case "$RES" in -600x600) XDIM=`expr $XDIM / 2`;; -1200x600) ;; -2400x600) XDIM=`expr $XDIM \* 2`;; -esac -DIM="${XDIM}x${YDIM}" - -# -# Filter thru psnup if N-up printing has been requested -# -case $NUP in -[234689]|1[024568]) PREFILTER="nup";; -*) PREFILTER=cat;; -esac -if [ "$DEBUG" -ge 9 ]; then - PREFILTER="tee /tmp/$BASENAME.ps" -fi - -# -# 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 - if [ -x /usr/bin/logger ]; then - logger -t "$BASENAME" -p lpr.info -- \ - "`basename $ICC2PS` -o $GAMMAFILE -t$INTENT > $ICCTMP.crd.ps" - fi - $ICC2PS -o $GAMMAFILE -t$INTENT > $ICCTMP.crd.ps 2>$ICCTMP.log \ - || error "Problem converting .ICM file to Postscript" - - PSTOPS_OPTS="$PSTOPS_OPTS -c" - cat > $ICCTMP.usecie.ps <<-EOF - %!PS-Adobe-3.0 - <>setpagedevice - EOF - cat > $ICCTMP.selcrd.ps <<-EOF - /Current /ColorRendering findresource setcolorrendering - EOF - GAMMAFILE="$ICCTMP.usecie.ps $ICCTMP.crd.ps $ICCTMP.selcrd.ps" - else - GAMMAFILE= - fi -} - -if [ $DEBUG -gt 0 ]; then - ICCTMP=/tmp/icc -else - ICCTMP=/tmp/icc$$ -fi - -if [ "" = "$COLOR" ]; then - COLORMODE= - GAMMAFILE= -else - case "$COLORMODE" in - 0) COLORMODE=$DEFAULTCOLORMODE;; - esac -fi - -CRDBASE="$PREFIX/share/foo2zjs/crd" -case "$RES" in - 600x600) SCREEN=screen1200.ps;; - 1200x600) SCREEN=screen1200.ps;; - 2400x600) SCREEN=screen2400.ps;; -esac - -PSTOPS_OPTS="-n" - -case "$COLORMODE" in -"") - # Monochrome - ;; -10|icm) - # Use old ICM method - AIB=-A - BC=-B - case "$GAMMAFILE" in - *.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 - ;; - none) - GAMMAFILE= - ;; - esac - ;; -1|photo) - # Photo - GAMMAFILE="$CRDBASE/prolog.ps" - GAMMAFILE="$GAMMAFILE $CRDBASE/2300w-1200@150-l250-kx,ucr125,75-per.crd" - GAMMAFILE="$GAMMAFILE $CRDBASE/$SCREEN" - ;; -2|graphics) - # Photo and Text - GAMMAFILE="$CRDBASE/prolog.ps" - #GAMMAFILE="$GAMMAFILE $CRDBASE/2300w-1200@150-l250-kx,ucr100,75-per.crd" - GAMMAFILE="$GAMMAFILE $CRDBASE/kh.crd" - GAMMAFILE="$GAMMAFILE $CRDBASE/$SCREEN" - ;; -3|text) - # Graphic and Text - GAMMAFILE="$CRDBASE/prolog.ps" - #GAMMAFILE="$GAMMAFILE $CRDBASE/2300w-1200@150-l250-kx,ucr100,50-per.crd" - GAMMAFILE="$GAMMAFILE $CRDBASE/kx.crd" - GAMMAFILE="$GAMMAFILE $CRDBASE/$SCREEN" - ;; -4|tonersave) - # Reduced toner - GAMMAFILE="$CRDBASE/prolog.ps" - GAMMAFILE="$GAMMAFILE $CRDBASE/2300w-1200@150-l250-kx,ucr100,0-per.crd" - GAMMAFILE="$GAMMAFILE $CRDBASE/$SCREEN" - ;; -*.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'" - ;; -esac - -if [ "$COLOR" != "" -a "$QUALITY" = wts ]; then - PSTOPS_OPTS="$PSTOPS_OPTS -w" -elif [ "$COLOR" != "" -a "$QUALITY" = as ]; then - PSTOPS_OPTS="$PSTOPS_OPTS -a" -fi - -if [ "" != "$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 - fi -fi - -# -# 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" - -foo2zjs-pstops $PSTOPS_OPTS | \ -$PREFILTER \ -| ($GS $PAPERSIZE -g$DIM -r$RES $GSDEV $GSOPTS \ - -sOutputFile="|cat 1>&3" $GAMMAFILE -_ >/dev/null) 3>&1 \ -| foo2xqx -r$RES -g$DIM -p$PAPER -m$MEDIA -n$COPIES -d$DUPLEX -s$SOURCE \ - $COLOR $CLIP_UL $CLIP_LR $CLIP_LOG $SAVETONER -T$DENSITY \ - -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 -- \ - "foo2xqx -r$RES -g$DIM -p$PAPER -m$MEDIA \ --n$COPIES -d$DUPLEX -s$SOURCE $COLOR $CLIP_UL $CLIP_LR $CLIP_LOG \ -$SAVETONER -T$DENSITY $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 -fi - -exit 0 diff --git a/foo2xqx-wrapper.1 b/foo2xqx-wrapper.1 deleted file mode 100644 index dab6ee3..0000000 --- a/foo2xqx-wrapper.1 +++ /dev/null @@ -1,345 +0,0 @@ -'\" t -'\" -'\" DO NOT EDIT! This file is generated from foo2xqx-wrapper.1in -'\" -'\" t -.TH foo2xqx-wrapper 1 "Sun May 26 18:25:20 2024" "foo2xqx-wrapper 0.0" -'\" -'\" -'\"========================================================================== -'\" STRINGS and MACROS -'\"========================================================================== -'\" -'\" Define strings for special characters that nroff doesn't have -'\" -'\" N.B. using .if cua to test for special characters did not work. -'\" -.if !'\*[.T]'ps' .ds ua up -.if '\*[.T]'ps' .ds ua \(ua -.if !'\*[.T]'ps' .ds da down -.if '\*[.T]'ps' .ds da \(da -.if !'\*[.T]'ps' .ds <- left -.if '\*[.T]'ps' .ds <- \(<- -.if !'\*[.T]'ps' .ds -> right -.if '\*[.T]'ps' .ds -> \(-> -'\" -'\" bx - box a Courier string for making keycaps -'\" -'\" N.B. this mess is to make the line drawing come out only -'\" if we are really generating postscript -'\" -.de bx -.ie !'\*[.T]'ps' \{\ -. RB [ \\$1 ]\\$2 -.\} -.el \{\ -. ie !r ps4html \{\ -'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul' -. ft CW -. nr par*bxw \w'\\$1'+.4m -\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\ -\Z'\h'.2m'\s-1\\$1\s+1'\ -\h'\\n[par*bxw]u'\\$2 -. ft P -. \} -. el \{\ -. RB [ \\$1 ]\\$2 -. \} -.\} -.. -'\" -'\" strings to set current color (null with old groff) -'\" -.if mred .ds red \m[red] -.if mgreen .ds green \m[green] -.if mblue .ds blue \m[blue] -.if mblack .ds black \m[black] -.if mblack .ds mP \mP -'\" -'\" fix for grotty + xterm. We call for orange, grotty outputs yellow, -'\" but xterm displays yellow as orange. The cycle is complete. -'\" -.if n .defcolor orange rgb #ffff00 -'\" -'\" color - set the current color (ignores request with old groff) -'\" -.de color -.if mred \m[\\$1]\c -.. -'\" -'\" colorword - colorize a word (ignored by old groff) -'\" -.de colorword -.ie m\\$1 \m[\\$1]\\$2\mP\c -.el \\$2\c -.. -'\" -'\" colbox - colorize a word in a filled box -'\" -.de colbox -.ie mred \M[\\$2]\ -\v'+.167v'\ -\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\ -\v'-.167v'\ -\m[\\$1]\\$3\mP\MP -.el \\$3\c -.. -'\" -'\" Macros for doing pdfmarks -'\" -.de specialps -.if '\*[.T]'ps' \\k_\X'ps: \\$*'\h'|\\n_u'\c -.. -'\" -'\" pdfmark PDFMARKCODE -'\" -.ds pdfmarks -.if d pdfmarks \{\ -.de pdfmark -. specialps exec [\\$1 pdfmark -.. -'\" -'\" pdfdest LINKNAME -'\" -.de pdfdest -.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST" -.. -'\" -'\" pdfbookmark COUNT LINKNAME STRING -'\" -.de pdfbookmark -. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT" -.. -'\" -'\" Define the SH and SS macros to save pdfmark information -'\" in "arrays" of numbers and strings. -'\" -.if !r rr_n \{\ -.nr rr_n 0 1 -.am SH -. nr rr_levels!\\n+[rr_n] 2 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.am SS -. nr rr_levels!\\n+[rr_n] 3 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.\} -'\" -'\" Called at the end of the document to generate the pdfmark outline -'\" -.de pdf_outline -.nr rr_levels!\\n+[rr_n] 1 -.nr rr_i 0 1 -.while \\n+[rr_i]<\\n[rr_n] \{\ -. nr rr_ip1 \\n[rr_i]+1 -. nr rr_count 0 -. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\ -. nr rr_j \\n[rr_i] 1 -. while \\n+[rr_j]<\\n[rr_n] \{\ -. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\ -. break -. \} -. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\ -. nr rr_count \\n[rr_count]+1 -. \} -. \} -. \} -. ds hhh \\*[rr_labels!\\n[rr_i]] -. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]" -.\} -.. -'\" -'\" Some postscript to make pdfmarks harmless on old interpreters... -'\" -.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse" -'\" -'\" Force display of Bookmarks in Acrobat when document is viewed. -'\" -.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW" -'\" -'\" Output the document info in pdfmarks -'\" -.pdfmark "\ - /Title (\*[an-title](\*[an-section])) \ - /Subject (\*[an-title] Manual Page) \ - /Author (Rick Richardson) \ - /Keywords (printing) \ - /Creator (groff \n(.x.\n(.y.\n(.Y -man) \ - /CreationDate (\*[an-extra1]) \ - /ModDate (\*[an-extra1]) \ - /DOCINFO" -\} -'\" -'\" The manual page name is only 1st level mark -'\" -.nr rr_levels!\n+[rr_n] 1 -.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section]) -.pdfdest Link\n[rr_n] -'\" -'\"========================================================================== -'\" MANUAL PAGE SOURCE -'\"========================================================================== -.SH NAME -foo2xqx-wrapper \- Convert Postscript into a XQX printer stream -.SH SYNOPSIS -.B foo2xqx-wrapper -.RI [ options "] [" ps-file ] -.SH DESCRIPTION -.B foo2xqx-wrapper -is a Foomatic compatible printer wrapper for the \fBfoo2xqx\fP printer driver. -This script reads a Postscript \fIps-file\fP or standard input -and converts it to XQX printer format -for driving -the HP LaserJet P1005/P1006/P1007/P1008, -the HP LaserJet P1505, -the HP LaserJet P2014, -the HP LaserJet M1005 MFP, -the HP LaserJet M1120 MFP, -the HP LaserJet Pro M1212nf MFP, -and other XQX-based printers. -.P -This script can be used in a standalone fashion, but is intended to -be called from a printer spooler system which uses the Foomatic -printer database. - -.SH COMMAND LINE OPTIONS -.SS Normal Options -These are the options used to select the parameters of a -print job that are usually controlled on a per job basis. -.TP -.BI \-d\0 duplex -Duplex code to send to printer [1]. -.TS -| n l | n l | n l . -1 off 2 long edge 3 short edge -.TE -.TP -.BI \-m\0 media -Media code to send to printer [1]. -.TS -l l l -l n n. -_ -Media M1005 -_ -standard 1 -transparency 2 -envelope 257 -letterhead 259 -thick 261 -postcard 262 -labels 263 -.TE -.TP -.BI \-p\0 paper -Paper size code to send to printer [1]. -.TS -box; -| n l | n l. -1 letter 9 A4 -5 legal 11 A5 -7 executive 13 B5 -20 env #10 27 env DL -28 env C5 34 env B5 -37 env Monarch 257 16k 197x273 -263 16k 184x260 263 16k 195x270 -.TE -.TP -.BI \-n\0 copies -Number of copies [1]. -.TP -.BI \-r\0 xres x yres -Set device resolution in pixels/inch [1200x600]. -.TP -.BI \-s\0 source -Source (Input Slot) code to send to printer [7]. -.TS -box; -| n l | n l. -1 upper 4 manual -2 lower 7 auto -.TE -.TP -.BI \-t -Draft mode. Every other pixel is white. -.TP -.BI \-T\0 density -Print density (1-5). The default is 3 (medium). -.TP -.BI "\-2 \-3 \-4 \-5 \-6 \-8 \-9 \-10 \-12 \-14 \-15 \-16 \-18" -Print in N-up. Requires the \fBpsutils\fP package. -.TP -.BI \-o\0 orient -Orientation used for N-up. -.TS -l l l. -Portrait -op (normal) -Landscape -ol (rotated 90 degrees anticlockwise) -Seascape -os (rotated 90 degrees clockwise) -.TE -.SS Printer Tweaking Options -These are the options used to customize the operation of \fBfoo2xqx\fP -for a particular printer. -.TP -.BI \-u\0 xoff x yoff -Set the offset of the start of the printable region from the -upper left corner, in pixels [varies with paper size]. -The defaults should work on the 2200DL and 2300DL, and have not -been tested on any other printers. -.TP -.BI \-l\0 xoff x yoff -Set the offset of the end of the printable region from the -lower right corner, in pixels [varies with paper size]. -The defaults should work on the 2200DL and 2300DL, and have not -been tested on any other printers. -.TP -.BI \-L\0 mask -Send the logical clipping values from -u/-l in the ZjStream. -\fBfoo2xqx-wrapper\fP always runs Ghostscript with the ideal page dimensions, -so that the scale of the image is correct, -regardless whether or not the printer has unprintable regions. -This option is used to move the position of the clipped image -back to where it belongs on the page. The default is to send -the amount which was clipped by -u and -l, and should be -good in most cases. -.TS -l l. -0 don't send any logical clipping amounts -1 only send Y clipping amount -2 only send X clipping amount -3 send both X and Y clipping amounts -.TE -.SS Debugging Options -These options are used for debugging \fBfoo2xqx\fP and its wrapper. -.TP -.BI \-D\0 level -Set Debug level [0]. - -.SH EXAMPLES -Create a monochrome ZjStream from a Postscript document, -examine it, and then print it using a RAW print queue: - -.RS -.nf -foo2xqx-wrapper testpage.ps > testpage.xqx -xqxdecode < testpage.xqx -lpr -P raw testpage.xqx -.fi -.RE - -.SH FILES -.BR /usr/bin/foo2xqx-wrapper -.SH SEE ALSO -.BR foo2xqx (1), -.BR xqxdecode (1) -.SH "AUTHOR" -Rick Richardson -.br -http://foo2xqx.rkkda.com/ -'\" -'\" -'\" -.em pdf_outline diff --git a/foo2xqx.1 b/foo2xqx.1 deleted file mode 100644 index d69b58b..0000000 --- a/foo2xqx.1 +++ /dev/null @@ -1,344 +0,0 @@ -'\" t -'\" -'\" DO NOT EDIT! This file is generated from foo2xqx.1in -'\" -'\" t -.TH foo2xqx 1 "Sun May 26 18:25:20 2024" "foo2xqx 0.0" -'\" -'\" -'\"========================================================================== -'\" STRINGS and MACROS -'\"========================================================================== -'\" -'\" Define strings for special characters that nroff doesn't have -'\" -'\" N.B. using .if cua to test for special characters did not work. -'\" -.if !'\*[.T]'ps' .ds ua up -.if '\*[.T]'ps' .ds ua \(ua -.if !'\*[.T]'ps' .ds da down -.if '\*[.T]'ps' .ds da \(da -.if !'\*[.T]'ps' .ds <- left -.if '\*[.T]'ps' .ds <- \(<- -.if !'\*[.T]'ps' .ds -> right -.if '\*[.T]'ps' .ds -> \(-> -'\" -'\" bx - box a Courier string for making keycaps -'\" -'\" N.B. this mess is to make the line drawing come out only -'\" if we are really generating postscript -'\" -.de bx -.ie !'\*[.T]'ps' \{\ -. RB [ \\$1 ]\\$2 -.\} -.el \{\ -. ie !r ps4html \{\ -'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul' -. ft CW -. nr par*bxw \w'\\$1'+.4m -\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\ -\Z'\h'.2m'\s-1\\$1\s+1'\ -\h'\\n[par*bxw]u'\\$2 -. ft P -. \} -. el \{\ -. RB [ \\$1 ]\\$2 -. \} -.\} -.. -'\" -'\" strings to set current color (null with old groff) -'\" -.if mred .ds red \m[red] -.if mgreen .ds green \m[green] -.if mblue .ds blue \m[blue] -.if mblack .ds black \m[black] -.if mblack .ds mP \mP -'\" -'\" fix for grotty + xterm. We call for orange, grotty outputs yellow, -'\" but xterm displays yellow as orange. The cycle is complete. -'\" -.if n .defcolor orange rgb #ffff00 -'\" -'\" color - set the current color (ignores request with old groff) -'\" -.de color -.if mred \m[\\$1]\c -.. -'\" -'\" colorword - colorize a word (ignored by old groff) -'\" -.de colorword -.ie m\\$1 \m[\\$1]\\$2\mP\c -.el \\$2\c -.. -'\" -'\" colbox - colorize a word in a filled box -'\" -.de colbox -.ie mred \M[\\$2]\ -\v'+.167v'\ -\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\ -\v'-.167v'\ -\m[\\$1]\\$3\mP\MP -.el \\$3\c -.. -'\" -'\" Macros for doing pdfmarks -'\" -.de specialps -.if '\*[.T]'ps' \\k_\X'ps: \\$*'\h'|\\n_u'\c -.. -'\" -'\" pdfmark PDFMARKCODE -'\" -.ds pdfmarks -.if d pdfmarks \{\ -.de pdfmark -. specialps exec [\\$1 pdfmark -.. -'\" -'\" pdfdest LINKNAME -'\" -.de pdfdest -.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST" -.. -'\" -'\" pdfbookmark COUNT LINKNAME STRING -'\" -.de pdfbookmark -. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT" -.. -'\" -'\" Define the SH and SS macros to save pdfmark information -'\" in "arrays" of numbers and strings. -'\" -.if !r rr_n \{\ -.nr rr_n 0 1 -.am SH -. nr rr_levels!\\n+[rr_n] 2 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.am SS -. nr rr_levels!\\n+[rr_n] 3 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.\} -'\" -'\" Called at the end of the document to generate the pdfmark outline -'\" -.de pdf_outline -.nr rr_levels!\\n+[rr_n] 1 -.nr rr_i 0 1 -.while \\n+[rr_i]<\\n[rr_n] \{\ -. nr rr_ip1 \\n[rr_i]+1 -. nr rr_count 0 -. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\ -. nr rr_j \\n[rr_i] 1 -. while \\n+[rr_j]<\\n[rr_n] \{\ -. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\ -. break -. \} -. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\ -. nr rr_count \\n[rr_count]+1 -. \} -. \} -. \} -. ds hhh \\*[rr_labels!\\n[rr_i]] -. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]" -.\} -.. -'\" -'\" Some postscript to make pdfmarks harmless on old interpreters... -'\" -.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse" -'\" -'\" Force display of Bookmarks in Acrobat when document is viewed. -'\" -.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW" -'\" -'\" Output the document info in pdfmarks -'\" -.pdfmark "\ - /Title (\*[an-title](\*[an-section])) \ - /Subject (\*[an-title] Manual Page) \ - /Author (Rick Richardson) \ - /Keywords (printing) \ - /Creator (groff \n(.x.\n(.y.\n(.Y -man) \ - /CreationDate (\*[an-extra1]) \ - /ModDate (\*[an-extra1]) \ - /DOCINFO" -\} -'\" -'\" The manual page name is only 1st level mark -'\" -.nr rr_levels!\n+[rr_n] 1 -.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section]) -.pdfdest Link\n[rr_n] -'\" -'\"========================================================================== -'\" MANUAL PAGE SOURCE -'\"========================================================================== -.SH NAME -foo2xqx \- Convert Ghostscript pbmraw into a -XQX printer stream -.SH SYNOPSIS -.B foo2xqx -.RI [ options "] <" pbmraw-file " >" xqx-file -.SH DESCRIPTION -.B foo2xqx -converts Ghostscript pbmraw to monochrome -XQX streams, -for driving -the HP LaserJet P1005/P1006/P1007/P1008, -the HP LaserJet P1505, -the HP LaserJet P2014, -the HP LaserJet M1005 MFP, -the HP LaserJet M1120 MFP, -the HP LaserJet Pro M1212nf MFP, -and other XQX-based printers. - -.SH COMMAND LINE OPTIONS -.SS Normal Options -These are the options used to select the parameters of a -print job that are usually controlled on a per job basis. -.TP -.BI \-d\0 duplex -Duplex code to send to printer [1]. -.TS -| n l | n l | n l . -1 off 2 long edge 3 short edge -.TE -.TP -.BI \-g\0 xpix x ypix -Set page dimensions in pixels [10200x6600]. -.TP -.BI \-m\0 media -Media code to send to printer [1]. -.TS -l l l -l n n. -_ -Media M1005 -_ -standard 1 -transparency 2 -envelope 257 -letterhead 259 -thick 261 -postcard 262 -labels 263 -.TE -.TP -.BI \-p\0 paper -Paper code to send to printer [1]. -.TS -box; -| n l | n l. -1 letter 9 A4 -5 legal 11 A5 -7 executive 13 B5 -20 env #10 27 env DL -28 env C5 34 env B5 -37 env Monarch 257 16k 197x273 -263 16k 184x260 264 16k 195x270 -.TE -.TP -.BI \-n\0 copies -Number of copies [1]. -.TP -.BI \-r\0 xres x yres -Set device resolution in pixels/inch [1200x600]. -.TP -.BI \-s\0 source -Source (InputSlot) code to send to printer [7]. -.TS -box; -| n l | n l. -1 upper 4 manual -2 lower 7 auto -.TE -.TP -.BI \-t -Draft mode. Every other pixel is white. -.TP -.BI \-T\0 density -Print density (1-5). The default is 3 (medium). -.TP -.BI \-J\0 filename -Filename string to send to printer. -.TP -.BI \-U\0 username -Username string to send to printer. -.SS Printer Tweaking Options -These are the options used to customize the operation of \fBfoo2xqx\fP -for a particular printer. -.TP -.BI \-u\0 xoff x yoff -Set the offset of the start of the printable region from the -upper left corner, in pixels [0x0]. -.TP -.BI \-l\0 xoff x yoff -Set the offset of the end of the printable region from the -lower right corner, in pixels [0x0]. -.TP -.BI \-L\0 mask -Send logical clipping amounts implied by -u/-l in the ZjStream [3]. -.TS -l l. -0 don't send any logical clipping amounts -1 only send Y clipping amount -2 only send X clipping amount -3 send both X and Y clipping amounts -.TE -.TP -.BI \-A -AllIsBlack: convert C=1,M=1,Y=1 to just K=1. Works with bitcmyk input only. -.TP -.BI \-B -BlackClears: K=1 forces C,M,Y to 0. Works with bitcmyk input only. -.SS Debugging Options -These options are used for debugging \fBfoo2xqx\fP. -.TP -.BI \-S\0 plane -Output just a single color plane from a color print and print it -on the black plane. The default is to output all color planes. -.TS -l l. -1 Cyan -2 Magenta -3 Yellow -4 Black -.TE -.TP -.BI \-D\0 level -Set Debug level [0]. - -.SH EXAMPLES -Create a black and white XQX stream: - -.RS -.nf -gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE \ - -sPAPERSIZE=letter -r1200x600 -sDEVICE=pbmraw \ - -sOutputFile=- - < testpage.ps \ -| foo2xqx -r1200x600 -g10200x6600 -p1 >testpage.zm -.fi -.RE - -.SH FILES -.BR /usr/bin/foo2xqx -.SH SEE ALSO -.BR foo2xqx-wrapper (1), -.BR xqxdecode (1) -.SH "AUTHOR" -Rick Richardson -.br -http://foo2xqx.rkkda.com/ -'\" -'\" -'\" -.em pdf_outline diff --git a/foo2zjs b/foo2zjs deleted file mode 100755 index 4eda928..0000000 Binary files a/foo2zjs and /dev/null differ diff --git a/foo2zjs-pstops b/foo2zjs-pstops deleted file mode 100755 index d35a34f..0000000 --- a/foo2zjs-pstops +++ /dev/null @@ -1,177 +0,0 @@ -#!/bin/sh - -VERSION='$Id: foo2zjs-pstops.sh,v 1.21 2013/07/31 17:41:47 rick Exp $' - -PROGNAME="$0" - -usage() { - cat <= 9.00) - -h ydimpts For rotate -r, y dimension points - -r Rotate 90 clockwise - -a Accurate Screens code - -c CIEColor - -n Neuter CUPS cupsPSLevel2 - -w Well Tempered Screens code - -D lvl Debug level -EOF - - exit 1 -} - -# -# Report an error and exit -# -error() { - echo "`basename $PROGNAME`: $1" >&2 - exit 1 -} - -debug() { - if [ $DEBUG -ge $1 ]; then - echo "`basename $PROGNAME`: $2" >&2 - fi -} - -# -# Use gsed instead of sed on Mac OSX -# -case `uname -s` in -Darwin) sed=gsed;; -FreeBSD) sed=gsed;; -*) sed=sed;; -esac - -# -# Process the options -# -DEBUG=0 -ROTATE90=0 -ACCURATE=0 -CIECOLOR=0 -NIXCUPS=0 -WTS=0 -GSVER=old -while getopts "9ach:nwrD:Vh?" opt -do - case $opt in - 9) GSVER=gs9;; - a) ACCURATE=1;; - c) CIECOLOR=1;; - h) YDIMpoints="$OPTARG";; - n) NIXCUPS=1;; - r) ROTATE90=1;; - w) WTS=1;; - D) DEBUG="$OPTARG";; - V) echo "$VERSION"; exit 0;; - h|\?) usage;; - esac -done -shift `expr $OPTIND - 1` - -if [ $NIXCUPS = 1 ]; then - n='s#^[^/]*cupsPSLevel2#false#' -else - n= -fi - -if [ $ROTATE90 = 1 ]; then - # %%currentpagedevice /PageSize get\ - # %%aload pop translate\ - r="1i\ - << /Install {\ - 0 $YDIMpoints translate\ - -90 rotate\ - } >> setpagedevice - " -else - r= -fi - -if [ "$GSVER" = "old" ]; then - ht='\ - <<\ - /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 - ' -else - ht='\ - /SpotDot { 180 mul cos exch 180 mul cos add 2 div } def\ - <<\ - /HalftoneType 5\ - /Cyan <<\ - /HalftoneType 1\ - /AccurateScreens true\ - /Frequency 150\ - /Angle 105\ - /SpotFunction /SpotDot load\ - >>\ - /Magenta <<\ - /HalftoneType 1\ - /AccurateScreens true\ - /Frequency 150\ - /Angle 165\ - /SpotFunction /SpotDot load\ - >>\ - /Yellow <<\ - /HalftoneType 1\ - /AccurateScreens true\ - /Frequency 150\ - /Angle 30\ - /SpotFunction /SpotDot load\ - >>\ - /Black <<\ - /HalftoneType 1\ - /AccurateScreens true\ - /Frequency 150\ - /Angle 45\ - /SpotFunction /SpotDot load\ - >>\ - /Default <<\ - /HalftoneType 1\ - /AccurateScreens true\ - /Frequency 150\ - /Angle 37\ - /SpotFunction /SpotDot load\ - >>\ - >> /Default exch /Halftone defineresource sethalftone - ' -fi - -if [ $WTS = 1 ]; then - w="/%%Page:[ ]*[ (]1[ )].*\$/ i\ - << /UseWTS true >> setuserparams \ - $ht - " -elif [ $ACCURATE = 1 ]; then - w="/%%Page:[ ]*[ (]1[ )].*\$/ i\ - << /UseWTS false >> setuserparams \ - $ht - " -else - w= -fi - -# -# Main Program -# -$sed \ - -e "$w" \ - -e "$n" \ - -e "$r" \ - $@ diff --git a/foo2zjs-pstops.1 b/foo2zjs-pstops.1 deleted file mode 100644 index ac1ded4..0000000 --- a/foo2zjs-pstops.1 +++ /dev/null @@ -1,230 +0,0 @@ -'\" t -'\" -'\" DO NOT EDIT! This file is generated from foo2zjs-pstops.1in -'\" -.TH foo2zjs-pstops 1 "Sun May 26 18:25:20 2024" "foo2zjs-pstops 0.0" -'\" -'\" -'\"========================================================================== -'\" STRINGS and MACROS -'\"========================================================================== -'\" -'\" Define strings for special characters that nroff doesn't have -'\" -'\" N.B. using .if cua to test for special characters did not work. -'\" -.if !'\*[.T]'ps' .ds ua up -.if '\*[.T]'ps' .ds ua \(ua -.if !'\*[.T]'ps' .ds da down -.if '\*[.T]'ps' .ds da \(da -.if !'\*[.T]'ps' .ds <- left -.if '\*[.T]'ps' .ds <- \(<- -.if !'\*[.T]'ps' .ds -> right -.if '\*[.T]'ps' .ds -> \(-> -'\" -'\" bx - box a Courier string for making keycaps -'\" -'\" N.B. this mess is to make the line drawing come out only -'\" if we are really generating postscript -'\" -.de bx -.ie !'\*[.T]'ps' \{\ -. RB [ \\$1 ]\\$2 -.\} -.el \{\ -. ie !r ps4html \{\ -'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul' -. ft CW -. nr par*bxw \w'\\$1'+.4m -\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\ -\Z'\h'.2m'\s-1\\$1\s+1'\ -\h'\\n[par*bxw]u'\\$2 -. ft P -. \} -. el \{\ -. RB [ \\$1 ]\\$2 -. \} -.\} -.. -'\" -'\" strings to set current color (null with old groff) -'\" -.if mred .ds red \m[red] -.if mgreen .ds green \m[green] -.if mblue .ds blue \m[blue] -.if mblack .ds black \m[black] -.if mblack .ds mP \mP -'\" -'\" fix for grotty + xterm. We call for orange, grotty outputs yellow, -'\" but xterm displays yellow as orange. The cycle is complete. -'\" -.if n .defcolor orange rgb #ffff00 -'\" -'\" color - set the current color (ignores request with old groff) -'\" -.de color -.if mred \m[\\$1]\c -.. -'\" -'\" colorword - colorize a word (ignored by old groff) -'\" -.de colorword -.ie m\\$1 \m[\\$1]\\$2\mP\c -.el \\$2\c -.. -'\" -'\" colbox - colorize a word in a filled box -'\" -.de colbox -.ie mred \M[\\$2]\ -\v'+.167v'\ -\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\ -\v'-.167v'\ -\m[\\$1]\\$3\mP\MP -.el \\$3\c -.. -'\" -'\" Macros for doing pdfmarks -'\" -.de specialps -.if '\*[.T]'ps' \\k_\X'ps: \\$*'\h'|\\n_u'\c -.. -'\" -'\" pdfmark PDFMARKCODE -'\" -.ds pdfmarks -.if d pdfmarks \{\ -.de pdfmark -. specialps exec [\\$1 pdfmark -.. -'\" -'\" pdfdest LINKNAME -'\" -.de pdfdest -.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST" -.. -'\" -'\" pdfbookmark COUNT LINKNAME STRING -'\" -.de pdfbookmark -. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT" -.. -'\" -'\" Define the SH and SS macros to save pdfmark information -'\" in "arrays" of numbers and strings. -'\" -.if !r rr_n \{\ -.nr rr_n 0 1 -.am SH -. nr rr_levels!\\n+[rr_n] 2 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.am SS -. nr rr_levels!\\n+[rr_n] 3 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.\} -'\" -'\" Called at the end of the document to generate the pdfmark outline -'\" -.de pdf_outline -.nr rr_levels!\\n+[rr_n] 1 -.nr rr_i 0 1 -.while \\n+[rr_i]<\\n[rr_n] \{\ -. nr rr_ip1 \\n[rr_i]+1 -. nr rr_count 0 -. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\ -. nr rr_j \\n[rr_i] 1 -. while \\n+[rr_j]<\\n[rr_n] \{\ -. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\ -. break -. \} -. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\ -. nr rr_count \\n[rr_count]+1 -. \} -. \} -. \} -. ds hhh \\*[rr_labels!\\n[rr_i]] -. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]" -.\} -.. -'\" -'\" Some postscript to make pdfmarks harmless on old interpreters... -'\" -.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse" -'\" -'\" Force display of Bookmarks in Acrobat when document is viewed. -'\" -.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW" -'\" -'\" Output the document info in pdfmarks -'\" -.pdfmark "\ - /Title (\*[an-title](\*[an-section])) \ - /Subject (\*[an-title] Manual Page) \ - /Author (Rick Richardson) \ - /Keywords (printing) \ - /Creator (groff \n(.x.\n(.y.\n(.Y -man) \ - /CreationDate (\*[an-extra1]) \ - /ModDate (\*[an-extra1]) \ - /DOCINFO" -\} -'\" -'\" The manual page name is only 1st level mark -'\" -.nr rr_levels!\n+[rr_n] 1 -.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section]) -.pdfdest Link\n[rr_n] -'\" -'\"========================================================================== -'\" MANUAL PAGE SOURCE -'\"========================================================================== -.SH NAME -foo2zjs-pstops \- Add PS code for foo2*-wrapper -.SH SYNOPSIS -.B foo2zjs-pstops -.RI [ options "] [" file ] -.SH DESCRIPTION -Add PS code for foo2zjs-wrapper. - -.SH COMMAND LINE OPTIONS -These are the options that can appear on the command line. -.TP -.BI \-a -Accurate screens code. -.TP -.BI \-c -CIE Color. -.TP -.BI \-n -Neuter CUPS cupsPSLevel2 -.TP -.BI \-r -Rotate 90 degrees clockwise. -.TP -.BI \-w -Well Tempered Screens code. -.TP -.BI \-D\0 level -Set Debug level [0]. - -.SH FILES -.BR /usr/bin/foo2zjs-pstops -.SH SEE ALSO -.BR foo2hp2600-wrapper (1), -.BR foo2lava-wrapper (1), -.BR foo2oak-wrapper (1), -.BR foo2qpdl-wrapper (1), -.BR foo2slx-wrapper (1), -.BR foo2xqx-wrapper (1), -.BR foo2zjs-wrapper (1) -.SH "AUTHOR" -Rick Richardson -.br -http://foo2zjs.rkkda.com/ -'\" -'\" -'\" -.em pdf_outline diff --git a/foo2zjs-wrapper b/foo2zjs-wrapper deleted file mode 100755 index f575d8d..0000000 --- a/foo2zjs-wrapper +++ /dev/null @@ -1,971 +0,0 @@ -#!/bin/sh - -#* Copyright (C) 2003-2006 Rick Richardson -#* -#* This program is free software; you can redistribute it and/or modify -#* it under the terms of the GNU General Public License as published by -#* the Free Software Foundation; either version 2 of the License, or -#* (at your option) any later version. -#* -#* This program is distributed in the hope that it will be useful, -#* but WITHOUT ANY WARRANTY; without even the implied warranty of -#* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -#* GNU General Public License for more details. -#* -#* You should have received a copy of the GNU General Public License -#* along with this program; if not, write to the Free Software -#* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -#* -#* Authors: Rick Richardson - -VERSION='$Id: foo2zjs-wrapper.in,v 1.154 2012/02/24 01:25:15 rick Exp $' - -# -# Printer Notes: -# -# Minolta/QMS 2300 DL - Does not need clipping, -X16, or -P. But it doesn't -# break anything if you use them. -# -# Minolta/QMS 2200 DL - Requires -X16 (which is on by default) -# - Requires clipping -# -# HP LaserJet 1000 - Same as 2200 DL, plus needs -P -# HP LaserJet 1005 - Same as 2200 DL, plus needs -P -# -# HP LaserJet 1018 - Same as 2200 DL, plus needs -P -z1 -L0 -# HP LaserJet 1020 - Same as 2200 DL, plus needs -P -z1 -L0 -# HP LaserJet 1022 - Same as 2200 DL, plus needs -P -z1 -L0 -# HP LaserJet M1319 MFP - Same as 2200 DL, plus needs -P -z1 -L0 -# HP LaserJet P2035 - Same as 2200 DL, plus needs -P -z1 -L0 -# HP LaserJet P2035n - Same as 2200 DL, plus needs -P -z1 -L0 -# -# HP LaserJet Pro P1102 - Same as 2200 DL, plus needs -P -z2 -L0 -# HP LaserJet Pro P1102w- Same as 2200 DL, plus needs -P -z2 -L0 -# HP LaserJet Pro P1566 - Same as 2200 DL, plus needs -P -z2 -L0 -# HP LaserJet Pro P1606dn- Same as 2200 DL, plus needs -P -z2 -L0 -# -# HP LaserJet Pro CP1025nw- Same as 2200 DL, plus needs -P -z3 -L0 -# - -PROGNAME="$0" -BASENAME=`basename $PROGNAME` -PREFIX=/usr -SHARE=$PREFIX/share/foo2zjs -PATH=$PATH:/sw/bin:/opt/local/bin - -# -# Log the command line, for debugging and problem reports -# -if [ -x /usr/bin/logger -o -x /bin/logger ]; then - logger -t "$BASENAME" -p lpr.info -- "$BASENAME $@" x Set device resolution in pixels/inch [$RES] --s source Source code to send to printer [$SOURCE] - 1=upper, 2=lower, 4=manual, 7=auto - Code numbers may vary with printer model. --t Draft mode. Every other pixel is white. --T density Print density (1-5) [$DENSITY] --2/-3/-4/-6/-8/-10/-12/-14/-15/-16/-18 - Print with N-up (requires psutils) --o orient For N-up: -op is portrait, -ol is landscape, -os is seascape. - -Printer Tweaking Options: --u x Set offset of upper left printable in pixels [varies] --l x Set offset of lower right printable in pixels [varies] --L mask Send logical clipping values from -u/-l in ZjStream [3] - 0=no, 1=Y, 2=X, 3=XY --P Do not output START_PLANE codes. May be needed by some - monochrome-only printers. --X padlen Add extra zero padding to the end of BID segments [16] --z model Model: [0] - 0=KM 2300DL / HP 1000 / HP 1005 - 1=HP 1018 / HP 1020 / HP 1022 - 2=HP Pro P1102 / P1566 / P1606dn - 3=HP Pro CP1025nw - -Color Tweaking Options: --g gsopts Additional options to pass to Ghostscript, such as - -dDITHERPPI=nnn, etc. May appear more than once. [] --G profile.icm Convert profile.icm to a Postscript CRD using icc2ps and - adjust colors using the setcolorrendering PS operator. - $SHARE/icm/ will be searched for profile.icm. --I intent Select profile intent from ICM file [$INTENT] - 0=Perceptual, 1=Colorimetric, 2=Saturation, 3=Absolute --G gamma-file.ps Prepend gamma-file to the Postscript input to perform - color correction using the setcolortransfer PS operator. - -Debugging Options: --S plane Output just a single color plane from a color print [all] - 1=Cyan, 2=Magenta, 3=Yellow, 4=Black --D lvl Set Debug level [$DEBUG] --V $VERSION -EOF - - exit 1 -} - -# -# Report an error and exit -# -error() { - echo "$BASENAME: $1" >&2 - exit 1 -} - -dbgcmd() { - if [ $DEBUG -ge 1 ]; then - echo "$@" >&2 - fi - "$@" -} - -# -# N-up-ify the job. Requires psnup from psutils package -# -nup() { - case "$NUP" in - [2368]|1[0458]) - tr '\r' '\n' | psnup $NUP_ORIENT -d2 -$NUP -m.3in -p$paper -q - ;; - [49]|1[26]) - tr '\r' '\n' | psnup $NUP_ORIENT -d2 -$NUP -m.5in -p$paper -q - ;; - *) - error "Illegal call to nup()." - ;; - esac -} - -# -# Process the options -# - -# Try to use a local copy of GhostScript 8.54, if available. Otherwise, -# fallback to whatever the Linux distro has installed (usually 7.07) -# -# N.B. := operator used here, when :- would be better, because "ash" -# doesn't have :- -if eval gs.foo -v >/dev/null 2>&1; then - GSBIN=${GSBIN:-gs.foo} -else - GSBIN=${GSBIN:-gs} -fi -GSVER=`$GSBIN --version` - -CMDLINE="$*" -DEBUG=0 -DUPLEX=1 -COLOR= -COLORMODE=default -MODEL=0 -QUALITY=1 -QUALITY=wts -MEDIA=1 -COPIES=1 -PAPER=1 -RES=1200x600 -SOURCE=7 -NUP= -CLIP_UL= -CLIP_LR= -CLIP_LOG= -BC= -AIB= -NOPLANES= -COLOR2MONO= -GAMMAFILE= -INTENT=0 -GSOPTS= -EXTRAPAD= -SAVETONER= -DENSITY=3 #Medium -NUP_ORIENT= -GSDEV=-sDEVICE=pbmraw -# What mode to use if the user wants us to pick the "best" mode -case "$GSVER" in -7*) DEFAULTCOLORMODE=10 - DEFAULTCOLORMODE=2 - ;; -8.1*) - DEFAULTCOLORMODE=2 - QUALITY=1 - ;; -*) DEFAULTCOLORMODE=2 - ;; -esac -while getopts "1:23456789o:b:cC:d:g:l:u:L:m:n:p:q:r:s:tT:z:ABS:D:G:I:PX:Vh?" opt -do - case $opt in - b) GSBIN="$OPTARG";; - c) COLOR=-c;; - d) DUPLEX="$OPTARG";; - g) GSOPTS="$GSOPTS $OPTARG";; - m) MEDIA="$OPTARG";; - n) COPIES="$OPTARG";; - p) PAPER="$OPTARG";; - q) QUALITY="$OPTARG";; - r) RES="$OPTARG";; - s) SOURCE="$OPTARG";; - t) SAVETONER="-t";; - T) DENSITY="$OPTARG";; - z) MODEL="$OPTARG";; - l) CLIP_LR="-l $OPTARG";; - u) CLIP_UL="-u $OPTARG";; - L) CLIP_LOG="-L $OPTARG";; - A) AIB=-A;; - B) BC=-B;; - C) COLORMODE="$OPTARG";; - S) COLOR2MONO="-S$OPTARG";; - D) DEBUG="$OPTARG";; - G) GAMMAFILE="$OPTARG";; - I) INTENT="$OPTARG";; - P) NOPLANES=-P;; - X) EXTRAPAD="-X $OPTARG";; - [234689]) NUP="$opt";; - [57]) error "Can't find acceptable layout for $opt-up";; - 1) case "$OPTARG" in - [024568]) NUP="1$OPTARG";; - *) error "Can't find acceptable layout for 1$OPTARG-up";; - esac - ;; - o) case "$OPTARG" in - l*) NUP_ORIENT=-l;; - s*) NUP_ORIENT=-r;; - p*|*) NUP_ORIENT=;; - esac;; - V) echo "$VERSION"; foo2zjs -V; foo2zjs-pstops -V; exit 0;; - h|\?) - if [ "$CMDLINE" != "-?" -a "$CMDLINE" != -h ]; then - echo "Illegal command:" - echo " $0 $CMDLINE" - echo - fi - usage;; - esac -done -shift `expr $OPTIND - 1` - -# Testing for gs9... -if [ `uname -n` = dual.rkkda.org -a $MODEL = 3 ]; then - GSBIN=gs904 - GSBIN=gsgit # gs 9.05+ -fi - -# -# If there is an argument left, take it as the file to print. -# Else, the input comes from stdin. -# -if [ $# -ge 1 ]; then - if [ "$LPJOB" = "" ]; then - : # LPJOB="$1" - fi - exec < $1 -fi - -# -case "$QUALITY" in -0) - GSOPTS="-dCOLORSCREEN $GSOPTS" - ;; -1) - GSOPTS="-dCOLORSCREEN $GSOPTS" - ;; -2) - GSOPTS="-dMaxBitmap=500000000 $GSOPTS" - ;; -as) - GSOPTS="-dCOLORSCREEN -dMaxBitmap=500000000 $GSOPTS" - ;; -wts) - GSOPTS="-dCOLORSCREEN -dMaxBitmap=500000000 $GSOPTS" - ;; -esac - -# -# Validate model code -# -case "$MODEL" in -0|1|2|3) ;; -*) error "Unknown model code $MODEL";; -esac - -# -# Validate media code -# -case "$MEDIA" in -1|standard|plain) MEDIA=1;; -2|transparency) MEDIA=2;; -3|glossy) MEDIA=3;; -257|envelope) MEDIA=257;; # -z0 -258|light) MEDIA=258;; # -z1, -z2 -259|letterhead) MEDIA=259;; # -z0 -261|thickstock|cardstock) MEDIA=261;; -262|postcard|heavy) MEDIA=262;; -263|labels|rough) MEDIA=263;; # -z0 labels, -z[12] rough -265|labels) MEDIA=265;; # -z1, -z2 -267|envelope) MEDIA=267;; # -z1, -z2 -273|vellum) MEDIA=267;; # -z1, -z2 -512|color) MEDIA=512;; -513|letterhead) MEDIA=513;; # -z1, -z2 -514|preprinted) MEDIA=514;; # -z1, -z2 -515|prepunched) MEDIA=515;; # -z1, -z2 -516|recycled) MEDIA=516;; # -z1, -z2 -[0-9]*) ;; -*) error "Unknown media code $MEDIA";; -esac - -# -# Validate source (InputSlot) code -# -case "$SOURCE" in -1|upper) SOURCE=1;; -2|lower) SOURCE=2;; -4|manual) SOURCE=4;; -7|auto) SOURCE=7;; -[0-9]*) ;; -*) error "Unknown source code $SOURCE";; -esac - -# -# Validate Duplex code -# -case "$DUPLEX" in -1|off|none) DUPLEX=1;; -2|long*) DUPLEX=2;; -3|short*) DUPLEX=3;; -[0-9]*) ;; -*) error "Unknown duplex code $DUPLEX";; -esac - -# -# Validate Resolution -# -case "$RES" in -600x600) ;; -1200x600) ;; -2400x600) ;; -*) error "Illegal resolution $RES";; -esac - -# -# Validate Print Density -# -case "$DENSITY" in -1|2|3|4|5) ;; -*) error "Illegal print density (-T) $DENSITY";; -esac - -# -# 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. -# -# The Minolta 2200 DL is sensitive to its unprintable regions, -# and will pixel skew if you try to print there. -# -# The HP1000 will print blank pages when asked to print into its -# unprintable region. -# -# The Minolta 2300 DL doesn't care if print into the unprintable -# region. It will do the clipping itself. This is as it should be. -# But it won't hurt it if we do the clipping here. -# -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" in -Custom*x*) - # Command line only - XDIM=`echo "$PAPER" | sed -e "s/Custom.//" -e "s/x.*//" ` - YDIM=`echo "$PAPER" | sed -e "s/.*x//" ` - if [ "$XDIM" = "" -o "$YDIM" = "" ]; then - error "Custom page size '$PAPER' != 1-99999" - fi - if [ "$XDIM" -eq 0 -o "$YDIM" -eq 0 ]; then - error "Custom page size '$PAPER' != 1-99999" - fi - XDIM=`dc -e "$XDIM 1200* 72/p"` - YDIM=`dc -e "$YDIM 600* 72/p"` - PAPER=256; paper=letter; - MEDIA=261 - set_clipping 2 100 2 100 - ;; -Custom*) - #%%BeginFeature: *CustomPageSize True - #216 - #360 - #0 - #0 - #0 - #pop pop pop pop pop - - #%%BeginFeature: *CustomPageSize True - #792.000000 612.000000 1 0.000000 0.000000 - #pop pop pop pop pop - - if [ $DEBUG = 0 ]; then - TMPFILE=/tmp/cus$$ - else - TMPFILE=/tmp/custom.ps - fi - cat >$TMPFILE - exec <$TMPFILE - - tmp=`head -n 10000 $TMPFILE \ - | sed -n '/CustomPageSize/{n;p;n;p;}' \ - | tr '\n' ' '` - case "$tmp" in - [0-9]*\ [0-9]*) - XDIM=`echo "$tmp" | sed 's/ .*//'` - YDIM=`echo "$tmp" | sed -e 's/^[^ ]* //' -e 's/ .*//'` - ;; - *) - if [ $DEBUG = 0 ]; then rm -f $TMPFILE; fi - error "Custom page size [XY]DIM != 1-99999" - ;; - esac - XDIM=`dc -e "$XDIM 1200* 72/p"` - YDIM=`dc -e "$YDIM 600* 72/p"` - PAPER=256; paper=letter; - MEDIA=261 - set_clipping 2 100 2 100 - ;; -1|letter) PAPER=1; paper=letter; XDIM="10200"; YDIM="6600" - case "$MODEL" in - 0) set_clipping 204 102 204 106;; - 1) set_clipping 192 96 192 96;; - 2) set_clipping 192 96 192 96;; - 3) set_clipping 192 96 192 96;; - # 1) set_clipping 96 96 288 96;; - esac - ;; -5|legal) PAPER=5; paper=legal; XDIM="10200"; YDIM="8400" - case "$MODEL" in - 0) set_clipping 204 102 204 106;; - 1) set_clipping 192 96 192 96;; - 2) set_clipping 192 96 192 96;; - 3) set_clipping 192 96 192 96;; - esac - ;; -7|executive) PAPER=7; paper=executive; XDIM="8700"; YDIM="6300" - case "$MODEL" in - 0) set_clipping 206 102 206 102;; - 1) set_clipping 192 96 192 96;; - 2) set_clipping 192 96 192 96;; - 3) set_clipping 192 96 192 96;; - esac - ;; -9|a4|A4) PAPER=9; paper=a4; XDIM="9920"; YDIM="7016" - case "$MODEL" in - 0) - if [ "$NOPLANES" != "" -a "$RES" = 600x600 ]; then - # Hack fix for LJ1000 - set_clipping 224 100 224 100 - else - # 2200DL - set_clipping 200 100 200 100 - fi - ;; - 1) set_clipping 192 96 192 96;; - 2) set_clipping 192 96 192 96;; - 3) set_clipping 192 96 192 96;; - esac - ;; -11|a5|A5) PAPER=11; paper=a5; XDIM="6992"; YDIM="4960" - case "$MODEL" in - 0) set_clipping 200 100 200 100;; - 1) set_clipping 192 96 192 96;; - 2) set_clipping 192 96 192 96;; - 3) set_clipping 192 96 192 96;; - esac - ;; -13|b5|B5) PAPER=13; paper=b5; XDIM="8598"; YDIM="6070" - case "$MODEL" in - 0) set_clipping 207 107 207 107;; - 1) set_clipping 192 96 192 96;; - 2) set_clipping 192 96 192 96;; - 3) set_clipping 192 96 192 96;; - esac - ;; -259|b5iso|B5ISO) PAPER=259; paper=b5; XDIM="8316"; YDIM="5904" - case "$MODEL" in - 1) set_clipping 192 96 192 96;; - *) error "Unimplemented paper code $PAPER";; - esac - ;; -20|"env#10") PAPER=20; paper=env10; XDIM="4950"; YDIM="5700" - case "$MODEL" in - 0) set_clipping 171 78 171 78;; - 1) set_clipping 171 78 171 78;; - 2) set_clipping 171 78 171 78;; - 3) set_clipping 171 78 171 78;; - esac - ;; -27|envDL) PAPER=27; paper=envDL; XDIM="5200"; YDIM="5200" - case "$MODEL" in - 0) set_clipping 176 84 176 84;; - 1) set_clipping 176 84 176 84;; - 2) set_clipping 176 84 176 84;; - 3) set_clipping 176 84 176 84;; - esac - ;; -28|envC5) PAPER=28; paper=envC5; XDIM="7650"; YDIM="5408" - case "$MODEL" in - 0) set_clipping 170 80 169 80;; - 1) set_clipping 170 80 169 80;; - 2) set_clipping 170 80 169 80;; - 3) set_clipping 170 80 169 80;; - esac - ;; -34|envB5) PAPER=34; paper=envB5; XDIM="8316"; YDIM="5892" - case "$MODEL" in - 0) set_clipping 174 74 174 74;; - 1) set_clipping 174 74 174 74;; - 2) set_clipping 174 74 174 74;; - 3) set_clipping 174 74 174 74;; - esac - ;; -37|envMonarch) PAPER=37; paper=envMonarch;XDIM="4650"; YDIM="4500" - case "$MODEL" in - 0) set_clipping 174 78 173 78;; - 1) set_clipping 174 78 173 78;; - 2) set_clipping 174 78 173 78;; - 3) set_clipping 174 78 173 78;; - esac - ;; -70|262|A6) paper=A6; XDIM="4956"; YDIM="3498" - case "$MODEL" in - 1) PAPER=262; set_clipping 174 78 173 78;; - 2) PAPER=70; set_clipping 174 78 173 78;; - 3) PAPER=70; set_clipping 174 78 173 78;; - *) error "Unimplemented paper code $PAPER";; - esac - ;; -257|16k197x273) PAPER=257; paper=executive;XDIM="9306"; YDIM="6448" - case "$MODEL" in - 1) set_clipping 173 84 173 84;; - 2) set_clipping 173 84 173 84;; - 3) set_clipping 173 84 173 84;; - *) error "Unimplemented paper code $PAPER";; - esac - ;; -263|16k184x260) PAPER=263; paper=executive;XDIM="8692"; YDIM="6142" - case "$MODEL" in - 2) set_clipping 122 87 122 87;; - 3) set_clipping 122 87 122 87;; - *) error "Unimplemented paper code $PAPER";; - esac - ;; -264|16k195x270) PAPER=264; paper=executive;XDIM="9212"; YDIM="6378" - case "$MODEL" in - 2) set_clipping 126 87 126 87;; - 3) set_clipping 126 87 126 87;; - *) error "Unimplemented paper code $PAPER";; - esac - ;; -43|260|postcard) paper=executive;XDIM="4728"; YDIM="3498" - case "$MODEL" in - 1) PAPER=260; set_clipping 126 87 126 87;; - 2) PAPER=43; set_clipping 126 87 126 87;; - 3) PAPER=43; set_clipping 126 87 126 87;; - *) error "Unimplemented paper code $PAPER";; - esac - ;; -82|261|doublepostcardrotated) - paper=executive;XDIM="6996"; YDIM="4722" - case "$MODEL" in - 1) PAPER=261; set_clipping 126 87 126 87;; - 2) PAPER=82; set_clipping 126 87 126 87;; - 3) PAPER=82; set_clipping 126 87 126 87;; - *) error "Unimplemented paper code $PAPER";; - esac - ;; -258|fanfoldgermanlegal) - PAPER=258; paper=legal; XDIM="10200"; YDIM="7800" - case "$MODEL" in - 1) set_clipping 192 96 192 96;; - 2) set_clipping 192 96 192 96;; - 3) set_clipping 192 96 192 96;; - *) error "Unimplemented paper code $PAPER";; - esac - ;; -268|photo4x6) - PAPER=268; paper=a6; XDIM="4800"; YDIM="3600" - case "$MODEL" in - 3) set_clipping 192 96 192 96;; - *) error "Unimplemented paper code $PAPER";; - esac - ;; -269|photo5x8) - PAPER=269; paper=statement; XDIM="6000"; YDIM="4800" - case "$MODEL" in - 3) set_clipping 192 96 192 96;; - *) error "Unimplemented paper code $PAPER";; - esac - ;; -270|photo10x15) - PAPER=270; paper=postcard; XDIM="4818"; YDIM="3590" - case "$MODEL" in - 3) set_clipping 192 96 192 96;; - *) error "Unimplemented paper code $PAPER";; - esac - ;; -*) error "Unimplemented paper code $PAPER";; -esac -# e.g. /usr/share/ghostscript/7.07/lib/gs_statd.ps -PAPERSIZE="-sPAPERSIZE=$paper"; - -case "$RES" in -600x600) XDIM=`expr $XDIM / 2`;; -1200x600) ;; -2400x600) XDIM=`expr $XDIM \* 2`;; -esac -DIM="${XDIM}x${YDIM}" - -# -# Filter thru psnup if N-up printing has been requested -# -case $NUP in -[234689]|1[024568]) PREFILTER="nup";; -*) PREFILTER=cat;; -esac -if [ "$DEBUG" -ge 9 ]; then - PREFILTER="tee /tmp/$BASENAME.ps" -fi - -# -# 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) - ;; - *) - if [ -x /usr/bin/logger ]; then - logger -t "$BASENAME" -p lpr.info -- \ - "`basename $ICC2PS` -o $GAMMAFILE -t$INTENT > $ICCTMP.crd.ps" - fi - $ICC2PS -o $GAMMAFILE -t$INTENT > $ICCTMP.crd.ps 2>$ICCTMP.log \ - || error "Problem converting .ICM file to Postscript" - ;; - esac - - PSTOPS_OPTS="$PSTOPS_OPTS -c" - cat > $ICCTMP.usecie.ps <<-EOF - %!PS-Adobe-3.0 - <>setpagedevice - EOF - if [ "$QUALITY" = wts -o "$QUALITY" = as ]; then - if [ "$QUALITY" = wts ]; then - cat >> $ICCTMP.usecie.ps <<-EOF - << /UseWTS true >> setuserparams - EOF - else - cat >> $ICCTMP.usecie.ps <<-EOF - << /UseWTS false >> setuserparams - EOF - fi - cat >> $ICCTMP.usecie.ps <<-EOF - << - /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 - GAMMAFILE= - fi -} - -# -# Print the color space from an ICC file using "dd" -# -colorspace() { - if [ -r "$1" ]; then - dd if=$1 bs=4c skip=4 count=1 2>/dev/null - elif [ -r "$SHARE/icm/$1" ]; then - dd if=$1 bs=4c skip=4 count=1 2>/dev/null - else - echo none - fi -} - -if [ $DEBUG -gt 0 ]; then - ICCTMP=/tmp/icc -else - ICCTMP=/tmp/icc$$ -fi - -PSTOPS_OPTS="-n" - -if [ "" = "$COLOR" ]; then - COLORMODE= - GAMMAFILE= -else - case "$COLORMODE" in - default) COLORMODE=$DEFAULTCOLORMODE;; - esac - - case "$GAMMAFILE" in - default) - case "$MODEL" in - 3) GAMMAFILE=hp-cp1025-rgb-392-bpp1.icm;; - *) GAMMAFILE=DL2312.icm;; - esac - ;; - esac - - case "$GSVER" in - 9.*) - cs=`colorspace $GAMMAFILE` - if [ "$cs" = "CMYK" ]; then - COLORMODE=gs9 - QUALITY= - PSTOPS_OPTS="$PSTOPS_OPTS -9 -a" - fi - ;; - esac -fi - -CRDBASE="$PREFIX/share/foo2zjs/crd" -case "$RES" in - 600x600) SCREEN=screen1200.ps;; - 1200x600) SCREEN=screen1200.ps;; - 2400x600) SCREEN=screen2400.ps;; -esac - -case "$COLORMODE" in -0|"") - # Monochrome - ;; -gs9) - # Use new icc method in gs 9.* - AIB= - BC= - if [ -r "$GAMMAFILE" ]; then - GAMMAFILE="-sOutputICCProfile=$GAMMAFILE" - elif [ -r "$SHARE/icm/$GAMMAFILE" ]; then - GAMMAFILE="-sOutputICCProfile=$SHARE/icm/$GAMMAFILE" - else - GAMMAFILE= - fi - ;; -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|photo) - # Photo - GAMMAFILE="$CRDBASE/prolog.ps" - GAMMAFILE="$GAMMAFILE $CRDBASE/2300w-1200@150-l250-kx,ucr125,75-per.crd" - GAMMAFILE="$GAMMAFILE $CRDBASE/$SCREEN" - ;; -2|graphics) - # Photo and Text - GAMMAFILE="$CRDBASE/prolog.ps" - #GAMMAFILE="$GAMMAFILE $CRDBASE/2300w-1200@150-l250-kx,ucr100,75-per.crd" - GAMMAFILE="$GAMMAFILE $CRDBASE/kh.crd" - GAMMAFILE="$GAMMAFILE $CRDBASE/$SCREEN" - ;; -3|text) - # Graphic and Text - GAMMAFILE="$CRDBASE/prolog.ps" - #GAMMAFILE="$GAMMAFILE $CRDBASE/2300w-1200@150-l250-kx,ucr100,50-per.crd" - GAMMAFILE="$GAMMAFILE $CRDBASE/kx.crd" - GAMMAFILE="$GAMMAFILE $CRDBASE/$SCREEN" - ;; -4|tonersave) - # Reduced toner - GAMMAFILE="$CRDBASE/prolog.ps" - GAMMAFILE="$GAMMAFILE $CRDBASE/2300w-1200@150-l250-kx,ucr100,0-per.crd" - GAMMAFILE="$GAMMAFILE $CRDBASE/$SCREEN" - ;; -*.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'" - ;; -esac - -if [ "$COLOR" != "" -a "$QUALITY" = wts ]; then - PSTOPS_OPTS="$PSTOPS_OPTS -w" -elif [ "$COLOR" != "" -a "$QUALITY" = as ]; then - PSTOPS_OPTS="$PSTOPS_OPTS -a" -fi - -if [ "" != "$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 - fi -fi - -# -# 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" - -foo2zjs-pstops $PSTOPS_OPTS | \ -$PREFILTER \ -| ($GS $PAPERSIZE -g$DIM -r$RES $GSDEV $GSOPTS \ - -sOutputFile="|cat 1>&3" $GAMMAFILE -_ >/dev/null) 3>&1 \ -| foo2zjs -r$RES -g$DIM -p$PAPER -m$MEDIA -n$COPIES -d$DUPLEX -s$SOURCE \ - -z$MODEL $COLOR $CLIP_UL $CLIP_LR $CLIP_LOG $SAVETONER -T$DENSITY \ - -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 -- \ - "foo2zjs -r$RES -g$DIM -p$PAPER -m$MEDIA \ --n$COPIES -d$DUPLEX -s$SOURCE -z$MODEL $COLOR $CLIP_UL $CLIP_LR $CLIP_LOG \ -$SAVETONER -T$DENSITY $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 -fi - -exit 0 diff --git a/foo2zjs-wrapper.1 b/foo2zjs-wrapper.1 deleted file mode 100644 index 76ad312..0000000 --- a/foo2zjs-wrapper.1 +++ /dev/null @@ -1,448 +0,0 @@ -'\" t -'\" -'\" DO NOT EDIT! This file is generated from foo2zjs-wrapper.1in -'\" -'\" t -.TH foo2zjs-wrapper 1 "Sun May 26 18:25:20 2024" "foo2zjs-wrapper 0.0" -'\" -'\" -'\"========================================================================== -'\" STRINGS and MACROS -'\"========================================================================== -'\" -'\" Define strings for special characters that nroff doesn't have -'\" -'\" N.B. using .if cua to test for special characters did not work. -'\" -.if !'\*[.T]'ps' .ds ua up -.if '\*[.T]'ps' .ds ua \(ua -.if !'\*[.T]'ps' .ds da down -.if '\*[.T]'ps' .ds da \(da -.if !'\*[.T]'ps' .ds <- left -.if '\*[.T]'ps' .ds <- \(<- -.if !'\*[.T]'ps' .ds -> right -.if '\*[.T]'ps' .ds -> \(-> -'\" -'\" bx - box a Courier string for making keycaps -'\" -'\" N.B. this mess is to make the line drawing come out only -'\" if we are really generating postscript -'\" -.de bx -.ie !'\*[.T]'ps' \{\ -. RB [ \\$1 ]\\$2 -.\} -.el \{\ -. ie !r ps4html \{\ -'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul' -. ft CW -. nr par*bxw \w'\\$1'+.4m -\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\ -\Z'\h'.2m'\s-1\\$1\s+1'\ -\h'\\n[par*bxw]u'\\$2 -. ft P -. \} -. el \{\ -. RB [ \\$1 ]\\$2 -. \} -.\} -.. -'\" -'\" strings to set current color (null with old groff) -'\" -.if mred .ds red \m[red] -.if mgreen .ds green \m[green] -.if mblue .ds blue \m[blue] -.if mblack .ds black \m[black] -.if mblack .ds mP \mP -'\" -'\" fix for grotty + xterm. We call for orange, grotty outputs yellow, -'\" but xterm displays yellow as orange. The cycle is complete. -'\" -.if n .defcolor orange rgb #ffff00 -'\" -'\" color - set the current color (ignores request with old groff) -'\" -.de color -.if mred \m[\\$1]\c -.. -'\" -'\" colorword - colorize a word (ignored by old groff) -'\" -.de colorword -.ie m\\$1 \m[\\$1]\\$2\mP\c -.el \\$2\c -.. -'\" -'\" colbox - colorize a word in a filled box -'\" -.de colbox -.ie mred \M[\\$2]\ -\v'+.167v'\ -\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\ -\v'-.167v'\ -\m[\\$1]\\$3\mP\MP -.el \\$3\c -.. -'\" -'\" Macros for doing pdfmarks -'\" -.de specialps -.if '\*[.T]'ps' \\k_\X'ps: \\$*'\h'|\\n_u'\c -.. -'\" -'\" pdfmark PDFMARKCODE -'\" -.ds pdfmarks -.if d pdfmarks \{\ -.de pdfmark -. specialps exec [\\$1 pdfmark -.. -'\" -'\" pdfdest LINKNAME -'\" -.de pdfdest -.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST" -.. -'\" -'\" pdfbookmark COUNT LINKNAME STRING -'\" -.de pdfbookmark -. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT" -.. -'\" -'\" Define the SH and SS macros to save pdfmark information -'\" in "arrays" of numbers and strings. -'\" -.if !r rr_n \{\ -.nr rr_n 0 1 -.am SH -. nr rr_levels!\\n+[rr_n] 2 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.am SS -. nr rr_levels!\\n+[rr_n] 3 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.\} -'\" -'\" Called at the end of the document to generate the pdfmark outline -'\" -.de pdf_outline -.nr rr_levels!\\n+[rr_n] 1 -.nr rr_i 0 1 -.while \\n+[rr_i]<\\n[rr_n] \{\ -. nr rr_ip1 \\n[rr_i]+1 -. nr rr_count 0 -. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\ -. nr rr_j \\n[rr_i] 1 -. while \\n+[rr_j]<\\n[rr_n] \{\ -. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\ -. break -. \} -. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\ -. nr rr_count \\n[rr_count]+1 -. \} -. \} -. \} -. ds hhh \\*[rr_labels!\\n[rr_i]] -. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]" -.\} -.. -'\" -'\" Some postscript to make pdfmarks harmless on old interpreters... -'\" -.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse" -'\" -'\" Force display of Bookmarks in Acrobat when document is viewed. -'\" -.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW" -'\" -'\" Output the document info in pdfmarks -'\" -.pdfmark "\ - /Title (\*[an-title](\*[an-section])) \ - /Subject (\*[an-title] Manual Page) \ - /Author (Rick Richardson) \ - /Keywords (printing) \ - /Creator (groff \n(.x.\n(.y.\n(.Y -man) \ - /CreationDate (\*[an-extra1]) \ - /ModDate (\*[an-extra1]) \ - /DOCINFO" -\} -'\" -'\" The manual page name is only 1st level mark -'\" -.nr rr_levels!\n+[rr_n] 1 -.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section]) -.pdfdest Link\n[rr_n] -'\" -'\"========================================================================== -'\" MANUAL PAGE SOURCE -'\"========================================================================== -.SH NAME -foo2zjs-wrapper \- Convert Postscript into a ZJS printer stream -.SH SYNOPSIS -.B foo2zjs-wrapper -.RI [ options "] [" ps-file ] -.SH DESCRIPTION -.B foo2zjs-wrapper -is a Foomatic compatible printer wrapper for the \fBfoo2zjs\fP printer driver. -This script reads a Postscript \fIps-file\fP or standard input -and converts it to Zenographics ZjStream printer format -for driving the Minolta/QMS 2300 DL network color laser printer -and other Zenographics-based printers. -.P -This script can be used in a standalone fashion, but is intended to -be called from a printer spooler system which uses the Foomatic -printer database. - -.SH COMMAND LINE OPTIONS -.SS Normal Options -These are the options used to select the parameters of a -print job that are usually controlled on a per job basis. -.TP -.BI \-c -Print in color (else monochrome). -.TP -.BI \-C\0 colormode -Color correction mode [0]. -.TS -n l . -1 Photos (using m2300w CRDs) -2 Photos and text (using m2300w CRDs) -3 Graphics and text (using m2300w CRDs) -10 ICM color profile (using -G *.icm file) -.TE -.TP -.BI \-d\0 duplex -Duplex code to send to printer [1]. -.TS -| n l | n l | n l . -1 off 2 long edge 3 short edge -.TE -.TP -.BI \-m\0 media -Media code to send to printer [1]. -.TS -l r r r r r. -_ -Media 2300DL 2200DL HP 1018 HP P1102 HP -\^ HP 1005 HP 1020 HP P1606 CP1025 -\^ -z0 -z0 -z1 -z2 -z3 -_ -standard 1 1 1 1 1 -transparency 2 2 2 2 2 -envelope 257 na 267 267 267 -letterhead 259 na 513 513 513 -bond na na 260 260 260 -thick 261 4 261 na na -postcard 262 na na na na -rough na na 263 263 263 -heavy na na 262 262 262 -labels 263 3 263 265 265 -vellum na na 273 273 273 -medium na na na 282 282 -extraheavy na na na 283 283 -color na na 512 512 512 -light na na 258 258 258 -preprinted na na 514 514 514 -prepunched na na 515 515 515 -recycled na na 516 516 516 -.TE -.TP -.BI \-p\0 paper -Paper size code to send to printer [1]. -.TS -l r r r r. -_ -Paper MC 2300DL HP 1018 HP P1102 HP -\^ HP 1005 HP 1020 HP P1606 CP1025 -\^ -z0 -z1 -z2 -z3 -_ -letter 1 1 1 1 -legal 5 5 5 5 -executive 7 7 7 7 -A4 9 9 9 9 -A5 11 11 11 11 -B5jis 13 13 13 13 -env #10 20 20 20 20 -env DL 27 27 27 27 -env CL 28 28 28 28 -env B5 34 34 34 34 -env Monarch 37 37 37 37 -postcard (japan) na 260 43 43 -B5iso na 259 na na -A6 na 262 70 70 -double postcard rotated na 261 82 82 -16k 197x273 na 257 257 257 -fanfold german legal na 258 258 258 -16k 184x260 na na 263 263 -16k 195x270 na na 264 264 -photo 4x6 na na na 268 -photo 5x8 na na na 269 -photo 10x15 na na na 270 -.TE -.TP -.BI \-n\0 copies -Number of copies [1]. -.TP -.BI \-r\0 xres x yres -Set device resolution in pixels/inch [1200x600]. -.TP -.BI \-s\0 source -Source (Input Slot) code to send to printer [7]. -.TS -| n l | n l. -1 upper 4 manual -2 lower 7 auto -.TE -.TP -.BI \-t -Draft mode. Every other pixel is white. -.TP -.BI \-T\0 density -Print density (1-5). The default is 3 (medium). -.TP -.BI "\-2 \-3 \-4 \-5 \-6 \-8 \-9 \-10 \-12 \-14 \-15 \-16 \-18" -Print in N-up. Requires the \fBpsutils\fP package. -.TP -.BI \-o\0 orient -Orientation used for N-up. -.TS -l l l. -Portrait -op (normal) -Landscape -ol (rotated 90 degrees anticlockwise) -Seascape -os (rotated 90 degrees clockwise) -.TE -.SS Printer Tweaking Options -These are the options used to customize the operation of \fBfoo2zjs\fP -for a particular printer. -.TP -.BI \-u\0 xoff x yoff -Set the offset of the start of the printable region from the -upper left corner, in pixels [varies with paper size]. -The defaults should work on the 2200DL and 2300DL, and have not -been tested on any other printers. -.TP -.BI \-l\0 xoff x yoff -Set the offset of the end of the printable region from the -lower right corner, in pixels [varies with paper size]. -The defaults should work on the 2200DL and 2300DL, and have not -been tested on any other printers. -.TP -.BI \-L\0 mask -Send the logical clipping values from -u/-l in the ZjStream. -\fBfoo2zjs-wrapper\fP always runs Ghostscript with the ideal page dimensions, -so that the scale of the image is correct, -regardless whether or not the printer has unprintable regions. -This option is used to move the position of the clipped image -back to where it belongs on the page. The default is to send -the amount which was clipped by -u and -l, and should be -good in most cases. -.TS -l l. -0 don't send any logical clipping amounts -1 only send Y clipping amount -2 only send X clipping amount -3 send both X and Y clipping amounts -.TE -.TP -.BI \-P -Do not send START_PLANE codes on monochrome output. May be -needed by some monochrome-only printers, such as the -HP LaserJet 1000. -.TP -.BI \-X\0 padlen -Add extra zero padding to the end of BID segments. The default is -16 bytes. Padding 16 bytes of zeroes -is needed for older ZjStream printers, such as the Minolta 2200DL -and HP LaserJet 1000, and seems harmless to newer ones, such as -the Minolta 2300DL. So the default should be good for all cases. -.TP -.BI \-z\0 model -Model. Default is 0. -.TS -l l. -0 KM 2300DL / HP 1000 / HP 1005 -1 HP 1018 / HP 1020 / HP 1022 -2 HP Pro P1102 / P1566 / P1606dn -3 HP Pro CP1025 -.TE -.SS Color Tweaking Options -These are the options used to control the quality of color output. -Color correction is currently a WORK IN PROGRESS. -.TP -.BI \-g\0 gsopts -Additional options to pass to Ghostscript, such as -g\(lq-dDITHERPPI=nnn\(rq, -etc. This option may appear more than once. -.TP -.BI \-G\0 profile.icm -Convert \fIprofile.icm\fP to a Postscript color rendering -dictionary (CRD) using \fBfoo2zjs-icc2ps\fP and -adjust the printer colors by using the Postscript \fBsetcolorrendering\fP -operator. (WORK IN PROGRESS). -.TP -.BI \-G\0 gamma-file.ps -Prepend \fIgamma-file.ps\fP to the Postscript input to perform -color correction using the \fBsetcolortransfer\fP Postscript operator. -For example, the file might contain: -.br -{0.333 exp} {0.333 exp} {0.333 exp} {0.333 exp} setcolortransfer -.TP -.BI \-I\0 intent -Select profile intent from the ICM file. -0=Perceptual, 1=Colorimetric, 2=Saturation, 3=Absolute. -Default is 0 (perceptual). -.SS Debugging Options -These options are used for debugging \fBfoo2zjs\fP and its wrapper. -.TP -.BI \-S\0 plane -Output just a single color plane from a color print and print it -on the black plane. The default is to output all color planes. -.TS -l l. -1 Cyan -2 Magenta -3 Yellow -4 Black -.TE -.TP -.BI \-D\0 level -Set Debug level [0]. - -.SH EXAMPLES -Create a monochrome ZjStream from a Postscript document, -examine it, and then print it using a RAW print queue: - -.RS -.nf -foo2zjs-wrapper testpage.ps > testpage.zm -zjsdecode < testpage.zm -lpr -P raw testpage.zm -.fi -.RE -.P -Create a color ZjStream stream from a Postscript document: - -.RS -.nf -foo2zjs-wrapper -c testpage.ps > testpage.zc -.fi -.RE - -.SH FILES -.BR /usr/bin/foo2zjs-wrapper -.SH SEE ALSO -.BR foo2zjs (1), -.BR zjsdecode (1) -.SH "AUTHOR" -Rick Richardson -.br -http://foo2zjs.rkkda.com/ -'\" -'\" -'\" -.em pdf_outline diff --git a/foo2zjs.1 b/foo2zjs.1 deleted file mode 100644 index 504ff6c..0000000 --- a/foo2zjs.1 +++ /dev/null @@ -1,410 +0,0 @@ -'\" t -'\" -'\" DO NOT EDIT! This file is generated from foo2zjs.1in -'\" -'\" t -.TH foo2zjs 1 "Sun May 26 18:25:20 2024" "foo2zjs 0.0" -'\" -'\" -'\"========================================================================== -'\" STRINGS and MACROS -'\"========================================================================== -'\" -'\" Define strings for special characters that nroff doesn't have -'\" -'\" N.B. using .if cua to test for special characters did not work. -'\" -.if !'\*[.T]'ps' .ds ua up -.if '\*[.T]'ps' .ds ua \(ua -.if !'\*[.T]'ps' .ds da down -.if '\*[.T]'ps' .ds da \(da -.if !'\*[.T]'ps' .ds <- left -.if '\*[.T]'ps' .ds <- \(<- -.if !'\*[.T]'ps' .ds -> right -.if '\*[.T]'ps' .ds -> \(-> -'\" -'\" bx - box a Courier string for making keycaps -'\" -'\" N.B. this mess is to make the line drawing come out only -'\" if we are really generating postscript -'\" -.de bx -.ie !'\*[.T]'ps' \{\ -. RB [ \\$1 ]\\$2 -.\} -.el \{\ -. ie !r ps4html \{\ -'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul' -. ft CW -. nr par*bxw \w'\\$1'+.4m -\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\ -\Z'\h'.2m'\s-1\\$1\s+1'\ -\h'\\n[par*bxw]u'\\$2 -. ft P -. \} -. el \{\ -. RB [ \\$1 ]\\$2 -. \} -.\} -.. -'\" -'\" strings to set current color (null with old groff) -'\" -.if mred .ds red \m[red] -.if mgreen .ds green \m[green] -.if mblue .ds blue \m[blue] -.if mblack .ds black \m[black] -.if mblack .ds mP \mP -'\" -'\" fix for grotty + xterm. We call for orange, grotty outputs yellow, -'\" but xterm displays yellow as orange. The cycle is complete. -'\" -.if n .defcolor orange rgb #ffff00 -'\" -'\" color - set the current color (ignores request with old groff) -'\" -.de color -.if mred \m[\\$1]\c -.. -'\" -'\" colorword - colorize a word (ignored by old groff) -'\" -.de colorword -.ie m\\$1 \m[\\$1]\\$2\mP\c -.el \\$2\c -.. -'\" -'\" colbox - colorize a word in a filled box -'\" -.de colbox -.ie mred \M[\\$2]\ -\v'+.167v'\ -\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\ -\v'-.167v'\ -\m[\\$1]\\$3\mP\MP -.el \\$3\c -.. -'\" -'\" Macros for doing pdfmarks -'\" -.de specialps -.if '\*[.T]'ps' \\k_\X'ps: \\$*'\h'|\\n_u'\c -.. -'\" -'\" pdfmark PDFMARKCODE -'\" -.ds pdfmarks -.if d pdfmarks \{\ -.de pdfmark -. specialps exec [\\$1 pdfmark -.. -'\" -'\" pdfdest LINKNAME -'\" -.de pdfdest -.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST" -.. -'\" -'\" pdfbookmark COUNT LINKNAME STRING -'\" -.de pdfbookmark -. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT" -.. -'\" -'\" Define the SH and SS macros to save pdfmark information -'\" in "arrays" of numbers and strings. -'\" -.if !r rr_n \{\ -.nr rr_n 0 1 -.am SH -. nr rr_levels!\\n+[rr_n] 2 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.am SS -. nr rr_levels!\\n+[rr_n] 3 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.\} -'\" -'\" Called at the end of the document to generate the pdfmark outline -'\" -.de pdf_outline -.nr rr_levels!\\n+[rr_n] 1 -.nr rr_i 0 1 -.while \\n+[rr_i]<\\n[rr_n] \{\ -. nr rr_ip1 \\n[rr_i]+1 -. nr rr_count 0 -. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\ -. nr rr_j \\n[rr_i] 1 -. while \\n+[rr_j]<\\n[rr_n] \{\ -. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\ -. break -. \} -. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\ -. nr rr_count \\n[rr_count]+1 -. \} -. \} -. \} -. ds hhh \\*[rr_labels!\\n[rr_i]] -. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]" -.\} -.. -'\" -'\" Some postscript to make pdfmarks harmless on old interpreters... -'\" -.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse" -'\" -'\" Force display of Bookmarks in Acrobat when document is viewed. -'\" -.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW" -'\" -'\" Output the document info in pdfmarks -'\" -.pdfmark "\ - /Title (\*[an-title](\*[an-section])) \ - /Subject (\*[an-title] Manual Page) \ - /Author (Rick Richardson) \ - /Keywords (printing) \ - /Creator (groff \n(.x.\n(.y.\n(.Y -man) \ - /CreationDate (\*[an-extra1]) \ - /ModDate (\*[an-extra1]) \ - /DOCINFO" -\} -'\" -'\" The manual page name is only 1st level mark -'\" -.nr rr_levels!\n+[rr_n] 1 -.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section]) -.pdfdest Link\n[rr_n] -'\" -'\"========================================================================== -'\" MANUAL PAGE SOURCE -'\"========================================================================== -.SH NAME -foo2zjs \- Convert Ghostscript pbmraw or bitcmyk format into a -ZJS printer stream -.SH SYNOPSIS -.B foo2zjs -.RI [ options "] <" pbmraw-file " >" zjs-file -.sp 1 -.B foo2zjs -.RI [ options "] <" bitcmyk-file " >" zjs-file -.sp 1 -.B foo2zjs -.RI [ options "] <" pksmraw-file " >" zjs-file -.SH DESCRIPTION -.B foo2zjs -converts Ghostscript pbmraw, bitcmyk, or pksmraw output formats to monochrome -or color ZJS streams, -for driving the Minolta/QMS 2300 DL network color laser printer -and other Zenographics-based printers. - -.SH COMMAND LINE OPTIONS -.SS Normal Options -These are the options used to select the parameters of a -print job that are usually controlled on a per job basis. -.TP -.BI \-c -Force color mode if autodetect doesn't work. -.TP -.BI \-d\0 duplex -Duplex code to send to printer [1]. -.TS -| n l | n l | n l . -1 off 2 long edge 3 short edge -.TE -.TP -.BI \-g\0 xpix x ypix -Set page dimensions in pixels [10200x6600]. -.TP -.BI \-m\0 media -Media code to send to printer [1]. -.TS -l r r r r r. -_ -Media 2300DL 2200DL HP 1018 HP P1102 HP -\^ HP 1005 HP 1020 HP P1606 CP1025 -\^ -z0 -z0 -z1 -z2 -z3 -_ -standard 1 1 1 1 1 -transparency 2 2 2 2 2 -envelope 257 na 267 267 267 -letterhead 259 na 513 513 513 -bond na na 260 260 260 -thick 261 4 261 na na -postcard 262 na na na na -rough na na 263 263 263 -heavy na na 262 262 262 -labels 263 3 263 265 265 -vellum na na 273 273 273 -medium na na na 282 282 -extraheavy na na na 283 283 -color na na 512 512 512 -light na na 258 258 258 -preprinted na na 514 514 514 -prepunched na na 515 515 515 -recycled na na 516 516 516 -.TE -.TP -.BI \-p\0 paper -Paper code to send to printer [1]. -.TS -l r r r r. -_ -Paper MC 2300DL HP 1018 HP P1102 HP -\^ HP 1005 HP 1020 HP P1606 CP1025 -\^ -z0 -z1 -z2 -z3 -_ -letter 1 1 1 1 -legal 5 5 5 5 -executive 7 7 7 7 -A4 9 9 9 9 -A5 11 11 11 11 -B5jis 13 13 13 13 -env #10 20 20 20 20 -env DL 27 27 27 27 -env CL 28 28 28 28 -env B5 34 34 34 34 -env Monarch 37 37 37 37 -postcard (japan) na 260 43 43 -B5iso na 259 na na -A6 na 262 70 70 -double postcard rotated na 261 82 82 -16k 197x273 na 257 257 257 -fanfold german legal na 258 258 258 -16k 184x260 na na 263 263 -16k 195x270 na na 264 264 -photo 4x6 na na na 268 -photo 5x8 na na na 269 -photo 10x15 na na na 270 -.TE -.TP -.BI \-n\0 copies -Number of copies [1]. -.TP -.BI \-r\0 xres x yres -Set device resolution in pixels/inch [1200x600]. -.TP -.BI \-s\0 source -Source (InputSlot) code to send to printer [7]. -.TS -| n l | n l. -1 upper 4 manual -2 lower 7 auto -.TE -.TP -.BI \-t -Draft mode. Every other pixel is white. -.TP -.BI \-T\0 density -Print density (1-5). The default is 3 (medium). -.TP -.BI \-J\0 filename -Filename string to send to printer. -.TP -.BI \-U\0 username -Username string to send to printer. -.SS Printer Tweaking Options -These are the options used to customize the operation of \fBfoo2zjs\fP -for a particular printer. -.TP -.BI \-u\0 xoff x yoff -Set the offset of the start of the printable region from the -upper left corner, in pixels [0x0]. -.TP -.BI \-l\0 xoff x yoff -Set the offset of the end of the printable region from the -lower right corner, in pixels [0x0]. -.TP -.BI \-L\0 mask -Send logical clipping amounts implied by -u/-l in the ZjStream [3]. -.TS -l l. -0 don't send any logical clipping amounts -1 only send Y clipping amount -2 only send X clipping amount -3 send both X and Y clipping amounts -.TE -.TP -.BI \-P -Do not send START_PLANE codes on monochrome output. May be -needed by some black and white only printers, such as the -HP LaserJet 1000. -.TP -.BI \-A -AllIsBlack: convert C=1,M=1,Y=1 to just K=1. Works with bitcmyk input only. -.TP -.BI \-B -BlackClears: K=1 forces C,M,Y to 0. Works with bitcmyk input only. -.TP -.BI \-X\0 padlen -Add extra zero padding to the end of BID segments. The default is -16 bytes. Padding 16 bytes of zeroes -is needed for older ZjStream printers, such as the Minolta 2200DL -and HP LaserJet 1000, and seems harmless to newer ones, such as -the Minolta 2300DL. So the default should be good for all cases. -.TP -.BI \-z\0 model -Model. Default is 0. -.TS -l l. -0 KM 2300DL / HP 1000 / HP 1005 -1 HP 1018 / HP 1020 / HP 1022 -2 HP Pro P1102 / P1566 / P1606dn -3 HP Pro CP1025 -.TE -.SS Debugging Options -These options are used for debugging \fBfoo2zjs\fP. -.TP -.BI \-S\0 plane -Output just a single color plane from a color print and print it -on the black plane. The default is to output all color planes. -.TS -l l. -1 Cyan -2 Magenta -3 Yellow -4 Black -.TE -.TP -.BI \-D\0 level -Set Debug level [0]. - -.SH EXAMPLES -Create a black and white ZJS stream: - -.RS -.nf -gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE \ - -sPAPERSIZE=letter -r1200x600 -sDEVICE=pbmraw \ - -sOutputFile=- - < testpage.ps \ -| foo2zjs -r1200x600 -g10200x6600 -p1 >testpage.zm -.fi -.RE -.P -Create a color ZJS stream: - -.RS -.nf -gs -q -dBATCH -dSAFER -dQUIET -dNOPAUSE \ - -sPAPERSIZE=letter -g10200x6600 -r1200x600 -sDEVICE=bitcmyk \ - -sOutputFile=- - < testpage.ps \ -| foo2zjs -r1200x600 -g10200x6600 -p1 >testpage.zc -.fi -.RE - -.SH FILES -.BR /usr/bin/foo2zjs -.SH SEE ALSO -.BR foo2zjs-wrapper (1), -.BR zjsdecode (1) -.SH "AUTHOR" -Rick Richardson -.br -http://foo2zjs.rkkda.com/ -'\" -'\" -'\" -.em pdf_outline diff --git a/getweb b/getweb deleted file mode 100755 index 7040703..0000000 --- a/getweb +++ /dev/null @@ -1,511 +0,0 @@ -#!/bin/sh - -# -# (c) Copyright Rick Richardson 2008 -# - -# -# PLEASE don't remove the copyright statements. They should -# be displayed to the human that is running this. -# - -VERSION='$Id: getweb.in,v 1.112 2013/12/25 21:00:11 rick Exp $' - -WGETOPTS="--passive-ftp -q" - -usage() { -cat <&2 - exit 1 -} - -SYSTEM=`uname -s` -WGET=`type wget 2>/dev/null` -if [ "$SYSTEM" = Darwin -a "$WGET" = "" ] -then - WGETOPTS= - wget() { - shift - curl -o $* - } -fi - -# -# Download a .EXE file from the web, unzip it, and extract the -# files we want -getexe() { - url="$1" - exefile="$2" - shift; shift - - wget $WGETOPTS -O $exefile "$url/$exefile" || - error "Couldn't download $url/$exefile" - unzip -oj $exefile "$@" - rm $exefile -} - -# -# Download a .tar.gz file from the web, untar it, and extract the -# files we want -gettgz() { - url="$1" - file="$2" - what="$3" - - wget $WGETOPTS -O $file "$url/$file" || - error "Couldn't download $url/$file" - gunzip <$file | tar xvf - $what - rm $file -} - -copyright() { - echo - echo "$1" - echo -} - -getone() { - case "$1" in - lj1000|1000) - gettgz \ - http://foo2zjs.rkkda.com/firmware sihp1000.tar.gz \ - "" - #echo "provided" - #getexe \ - #ftp://ftp.hp.com/pub/softlib/software1/lj1488/lj-1145-2 \ - #lj1488en.exe \ - #sihp1000.img - copyright "(c) Copyright Hewlett-Packard 2001" - ;; - lj1005|1005) - gettgz \ - http://foo2zjs.rkkda.com/firmware sihp1005.tar.gz \ - "" - #echo "provided" - #getexe \ - #ftp://ftp.hp.com/pub/softlib/software2/COL2222/lj-10067-2 \ - #lj1005hostbased-en.exe \ - #sihp1005.img - copyright "(c) Copyright Hewlett-Packard 2002" - gettgz \ - http://foo2zjs.rkkda.com/firmware sihpP1005.tar.gz \ - "" - copyright "(c) Copyright Hewlett-Packard 2009" - ;; - lj1018|1018) - gettgz \ - http://foo2zjs.rkkda.com/firmware sihp1018.tar.gz \ - "" - copyright "(c) Copyright Hewlett-Packard 2005" - ;; - lj1020|1020) - # http://ftp.hp.com/pub/softlib/software8/COL14041/lj-39322-2/hp_LJ_1020-1022_Full_Solution.exe - gettgz \ - http://foo2zjs.rkkda.com/firmware sihp1020.tar.gz \ - "" - copyright "(c) Copyright Hewlett-Packard 2005" - ;; - [pP]100[57]) - gettgz \ - http://foo2zjs.rkkda.com/firmware sihpP1005.tar.gz \ - "" - copyright "(c) Copyright Hewlett-Packard 2009" - ;; - [pP]100[68]) - gettgz \ - http://foo2zjs.rkkda.com/firmware sihpP1006.tar.gz \ - "" - copyright "(c) Copyright Hewlett-Packard 2009" - ;; - [pP]1505) - gettgz \ - http://foo2zjs.rkkda.com/firmware sihpP1505.tar.gz \ - "" - copyright "(c) Copyright Hewlett-Packard 2009" - ;; - 2200dl|2200) - if true; then - gettgz \ - http://foo2zjs.rkkda.com/icm dl2300.tar.gz \ - "" - else - getexe \ - http://printer.konicaminolta.net/drivers/win2000 m22dlicc.exe \ - "*.icm" - fi - copyright "(c) Copyright Minolta-QMS 1999" - ;; - 2300dl|2300) - if true; then - gettgz \ - http://foo2zjs.rkkda.com/icm dl2300.tar.gz \ - "" - else - getexe \ - http://printer.konicaminolta.net/drivers/other m23dlicc.exe \ - "*.icm" - fi - gettgz \ - http://foo2zjs.rkkda.com/icm km2430.tar.gz \ - "" - copyright "(c) Copyright Minolta-QMS 2001" - ;; - 2300dl_fw) - # 2300DL firmware upgrade to v2.55 - BASE="http://crm01.minoltaeurope.com" - BASE="$BASE/openmind/technic/swfw/mswprtdl.nsf/logdwl" - FILE="MC2300DL_v255.zip" - URL="$BASE?openagent&4CE486C20839C75AC1256D9E001EBD1F/\$File/$FILE" - wget $WGETOPTS "$URL" || error "Couldn't download $URL" - echo "*** Now use a windows box to unzip and install $FILE ***" - ;; - cpwl|pageworks) - if true; then - gettgz \ - http://foo2zjs.rkkda.com/icm dl2300.tar.gz \ - "" - else - getexe \ - ftp://ftp.minolta-qms.com/pub/crc/out_going/windows cpplxp.exe \ - "*.IC_" - for i in C*.IC_ - do - base=`basename $i .IC_` - mv $base.IC_ $base.ic_ - ./msexpand $base.ic_ - rm -f $base.ic_ - done - fi - copyright "(c) Copyright Minolta-QMS 1998" - ;; - 2430) - gettgz \ - http://foo2zjs.rkkda.com/icm km2430.tar.gz \ - "" - copyright "(c) Copyright Konica Minolta 2003" - ;; - 2530|2490|6115|2480|1600w|1680|1690|4690|110|6121) - gettgz \ - http://foo2lava.rkkda.com/icm km2530.tar.gz \ - "" - copyright "(c) Copyright Konica Minolta 2005" - copyright "(c) Copyright Rick Richardson 2007. All Rights Reserved" - gettgz \ - http://foo2lava.rkkda.com/icm km-1600.tar.gz \ - "" - copyright "(c) Copyright Rick Richardson 2009. All Rights Reserved" - ;; - 1500) - gettgz \ - http://foo2hp.rkkda.com/icm hpclj2500.tar.gz \ - "" - copyright "(c) Copyright Hewlett-Packard 2002" - gettgz \ - http://foo2hp.rkkda.com/icm hpclj2600n.tar.gz \ - "" - copyright "(c) Copyright Hewlett-Packard 2003" - copyright "(c) Copyright Rick Richardson 2006. All Rights Reserved" - ;; - 1025) - gettgz \ - http://foo2zjs.rkkda.com/icm hp-cp1025.tar.gz \ - "" - copyright "(c) Copyright Rick Richardson 2010. All Rights Reserved" - ;; - 1215|1600|2600*) - gettgz \ - http://foo2hp.rkkda.com/icm hpclj2600n.tar.gz \ - "" - gettgz \ - http://foo2zjs.rkkda.com/icm km2430.tar.gz \ - "km2430_2.icm" - copyright "(c) Copyright Hewlett-Packard 2003" - copyright "(c) Copyright Rick Richardson 2006. All Rights Reserved" - gettgz \ - http://foo2hp.rkkda.com/icm hp1215.tar.gz \ - "" - copyright "(c) Copyright Rick Richardson 2008. All Rights Reserved" - ;; - 300|310|315|325|365|2160|3160|3175|3185|6110) - gettgz \ - http://foo2qpdl.rkkda.com/icm samclp300.tar.gz \ - "" - copyright "(c) Copyright Rick Richardson 2007. All Rights Reserved" - gettgz \ - http://foo2qpdl.rkkda.com/icm samclp315.tar.gz \ - "" - copyright "(c) Copyright Rick Richardson 2008. All Rights Reserved" - ;; - 600|610) - ;; - - 500) - gettgz \ - http://foo2slx.rkkda.com/icm lexc500.tar.gz \ - "" - copyright "(c) Copyright Lexmark 2006" - ;; - - oki) - echo "Please wait, ~20MB is being downloaded from a slow site..." - getexe \ - http://www.okiprintingsolutions.at/binaryData/16516/ \ - ICCProfiles.zip \ - "*OK3200*ICM" "*OK5600*ICM" "*rom732*7.zip" - unzip -oj *rom732*7.zip "*C3400*ICM" - rm -f *rom732*7.zip - for i in OK*ICM C3400*ICM; do - base=`basename $i .ICM` - mv "$base.ICM" "$base.icm" - done - copyright "(c) Copyright Okidata 2005, 2006" - ;; - 301) - gettgz \ - http://foo2hiperc.rkkda.com/icm okic301.tar.gz \ - "" - copyright "(c) Copyright Okidata 2012" - ;; - c310) - gettgz \ - http://foo2hiperc.rkkda.com/icm okic310.tar.gz \ - "" - copyright "(c) Copyright Okidata 2010" - ;; - c810) - gettgz \ - http://foo2hiperc.rkkda.com/icm okic810.tar.gz \ - "" - copyright "(c) Copyright Okidata 2008" - ;; - 3100|3200|5100|5150|5200|5250) - gettgz \ - http://foo2hiperc.rkkda.com/icm okic3200.tar.gz \ - "" - copyright "(c) Copyright Okidata 2005" - ;; - 3300|3400|3530) - gettgz \ - http://foo2hiperc.rkkda.com/icm okic3400.tar.gz \ - "" - copyright "(c) Copyright Okidata 2006" - ;; - 5500|5600|5800|160) - gettgz \ - http://foo2hiperc.rkkda.com/icm okic5600.tar.gz \ - "" - copyright "(c) Copyright Okidata 2006" - ;; - - xPPD) - # Snarf PPD files from linuxprinting - [ -d PPD ] || mkdir PPD - for i in foomatic-db/printer/*.xml - do - case "$i" in - */Gen*) continue;; - esac - printer=`basename $i .xml` - echo $printer - case "$printer" in - *1500*|*oak*) driver=foo2oak;; - *) driver=foo2zjs;; - esac - URL="http://www.linuxprinting.org/ppd-o-matic.cgi" - URL="$URL?driver=$driver&printer=$printer" - URL="$URL&.submit=Generate+PPD+file" - URL="$URL&show=1&.cgifields=shortgui&.cgifields=show" - wget $WGETOPTS -O PPD/$printer.ppd "$URL" || - error "Couldn't dowload $URL" - done - ;; - ppd) - # Generate PPD files using local tools - [ -d PPD ] || mkdir PPD - for i in foomatic-db/printer/*.xml - do - printer=`basename $i .xml` - echo $printer - case "$printer" in - *M1005*|*M1120*) driver=foo2xqx;; - *P1[05]0[56]*) driver=foo2xqx;; - *P2014*) driver=foo2xqx;; - *M1212*) driver=foo2xqx;; - *1500*|*OAKT*) driver=foo2oak;; - *1600*|*2600*) driver=foo2hp;; - *1215*) driver=foo2hp;; - *2530*|*24[89]0*) driver=foo2lava;; - *6115*) driver=foo2lava;; - *C110*) driver=foo2lava;; - *C500*) driver=foo2slx;; - *C3[234]00*) driver=foo2hiperc;; - *C5[12568]00*) driver=foo2hiperc;; - *CLP*|*CLX*|*6110*) driver=foo2qpdl;; - *) driver=foo2zjs;; - esac - ENGINE=../foomatic/foomatic-db-engine - PERL5LIB=$ENGINE/lib $ENGINE/foomatic-ppdfile \ - -d $driver -p $printer \ - > PPD/$printer.ppd - # | sed -e 's/\(^\*NickName.*\)"/\1 (foo2zjs recommended)"/' - done - ;; - update) - url=http://foo2zjs.rkkda.com - file=foo2zjs.tar.gz - wget $WGETOPTS -O $file $url/$file || - error "Couldn't download $url/$exefile" - mv getweb getweb.old - HERE=`pwd` - cd .. - tar zxf $HERE/$file - cd $HERE - echo "The tarball is extracted and the current directory is up to date." - echo -e "Remove the tarball (y/n)? \c" - read ans - if [ "$ans" = y ]; then - rm -f $file - fi - ;; - "") - usage - ;; - *) - error "Don't know how to get extra stuff for printer $1" - ;; - esac -} - -if [ $# = 0 ]; then - echo "$VERSION" - usage -fi - -for i in $* -do - case "$1" in - all) - getone 1000 - getone 1005 - getone 1018 - getone 1020 - - getone p1005 - getone p1006 - getone p1505 - - getone 2200 - getone 2300 - # getone 2430 already done - # getone cpwl # file doesn't exist 1/28/08 - - getone 1500 - getone 2600n - # getone 1215 # already done - getone 1025 - - getone 2530 - - getone 300 - # getone 6110 already done - getone 600 - - getone 500 - - getone 301 - getone c310 - getone c810 - getone 3200 - getone 3400 - getone 5600 - ;; - *) - getone $i - ;; - esac -done diff --git a/gipddecode b/gipddecode deleted file mode 100755 index ff11040..0000000 Binary files a/gipddecode and /dev/null differ diff --git a/gipddecode.1 b/gipddecode.1 deleted file mode 100644 index 30e26d1..0000000 --- a/gipddecode.1 +++ /dev/null @@ -1,284 +0,0 @@ -'\" t -'\" -'\" DO NOT EDIT! This file is generated from gipddecode.1in -'\" -.TH gipddecode 1 "Sun May 26 18:25:20 2024" "gipddecode 0.0" -'\" -'\" -'\"========================================================================== -'\" STRINGS and MACROS -'\"========================================================================== -'\" -'\" Define strings for special characters that nroff doesn't have -'\" -'\" N.B. using .if cua to test for special characters did not work. -'\" -.if !'\*[.T]'ps' .ds ua up -.if '\*[.T]'ps' .ds ua \(ua -.if !'\*[.T]'ps' .ds da down -.if '\*[.T]'ps' .ds da \(da -.if !'\*[.T]'ps' .ds <- left -.if '\*[.T]'ps' .ds <- \(<- -.if !'\*[.T]'ps' .ds -> right -.if '\*[.T]'ps' .ds -> \(-> -'\" -'\" bx - box a Courier string for making keycaps -'\" -'\" N.B. this mess is to make the line drawing come out only -'\" if we are really generating postscript -'\" -.de bx -.ie !'\*[.T]'ps' \{\ -. RB [ \\$1 ]\\$2 -.\} -.el \{\ -. ie !r ps4html \{\ -'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul' -. ft CW -. nr par*bxw \w'\\$1'+.4m -\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\ -\Z'\h'.2m'\s-1\\$1\s+1'\ -\h'\\n[par*bxw]u'\\$2 -. ft P -. \} -. el \{\ -. RB [ \\$1 ]\\$2 -. \} -.\} -.. -'\" -'\" strings to set current color (null with old groff) -'\" -.if mred .ds red \m[red] -.if mgreen .ds green \m[green] -.if mblue .ds blue \m[blue] -.if mblack .ds black \m[black] -.if mblack .ds mP \mP -'\" -'\" fix for grotty + xterm. We call for orange, grotty outputs yellow, -'\" but xterm displays yellow as orange. The cycle is complete. -'\" -.if n .defcolor orange rgb #ffff00 -'\" -'\" color - set the current color (ignores request with old groff) -'\" -.de color -.if mred \m[\\$1]\c -.. -'\" -'\" colorword - colorize a word (ignored by old groff) -'\" -.de colorword -.ie m\\$1 \m[\\$1]\\$2\mP\c -.el \\$2\c -.. -'\" -'\" colbox - colorize a word in a filled box -'\" -.de colbox -.ie mred \M[\\$2]\ -\v'+.167v'\ -\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\ -\v'-.167v'\ -\m[\\$1]\\$3\mP\MP -.el \\$3\c -.. -'\" -'\" Macros for doing pdfmarks -'\" -.de specialps -.if '\*[.T]'ps' \\k_\X'ps: \\$*'\h'|\\n_u'\c -.. -'\" -'\" pdfmark PDFMARKCODE -'\" -.ds pdfmarks -.if d pdfmarks \{\ -.de pdfmark -. specialps exec [\\$1 pdfmark -.. -'\" -'\" pdfdest LINKNAME -'\" -.de pdfdest -.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST" -.. -'\" -'\" pdfbookmark COUNT LINKNAME STRING -'\" -.de pdfbookmark -. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT" -.. -'\" -'\" Define the SH and SS macros to save pdfmark information -'\" in "arrays" of numbers and strings. -'\" -.if !r rr_n \{\ -.nr rr_n 0 1 -.am SH -. nr rr_levels!\\n+[rr_n] 2 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.am SS -. nr rr_levels!\\n+[rr_n] 3 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.\} -'\" -'\" Called at the end of the document to generate the pdfmark outline -'\" -.de pdf_outline -.nr rr_levels!\\n+[rr_n] 1 -.nr rr_i 0 1 -.while \\n+[rr_i]<\\n[rr_n] \{\ -. nr rr_ip1 \\n[rr_i]+1 -. nr rr_count 0 -. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\ -. nr rr_j \\n[rr_i] 1 -. while \\n+[rr_j]<\\n[rr_n] \{\ -. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\ -. break -. \} -. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\ -. nr rr_count \\n[rr_count]+1 -. \} -. \} -. \} -. ds hhh \\*[rr_labels!\\n[rr_i]] -. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]" -.\} -.. -'\" -'\" Some postscript to make pdfmarks harmless on old interpreters... -'\" -.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse" -'\" -'\" Force display of Bookmarks in Acrobat when document is viewed. -'\" -.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW" -'\" -'\" Output the document info in pdfmarks -'\" -.pdfmark "\ - /Title (\*[an-title](\*[an-section])) \ - /Subject (\*[an-title] Manual Page) \ - /Author (Rick Richardson) \ - /Keywords (printing) \ - /Creator (groff \n(.x.\n(.y.\n(.Y -man) \ - /CreationDate (\*[an-extra1]) \ - /ModDate (\*[an-extra1]) \ - /DOCINFO" -\} -'\" -'\" The manual page name is only 1st level mark -'\" -.nr rr_levels!\n+[rr_n] 1 -.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section]) -.pdfdest Link\n[rr_n] -'\" -'\"========================================================================== -'\" MANUAL PAGE SOURCE -'\"========================================================================== -.SH NAME -gipddecode \- Decode a GIPD stream into human readable form. -.SH SYNOPSIS -.B gipddecode -.RI [ options "] <" gipd-file -.SH DESCRIPTION -.B gipddecode -decodes a Granite Image Printer Driver (GIPD) stream into human readable form. -Granite Systems was acquired by Monotype Imaging. -.P -A GIPD stream is the printer language used by the -Lexmark X500 and the Dell 1125 MFP -printers. - -.SH COMMAND LINE OPTIONS -These are the options that can appear on the command line. -.TP -.BI \-d\0 basename -Basename of .pbm file for saving decompressed planes. -.TP -.BI \-h -Print hex file offsets. -.TP -.BI \-o -Print file offsets. -.TP -.BI \-D\0 level -Set Debug level [0]. - -.SH EXAMPLES -Decode an GIPD stream file. - -.nf -.ft CW -$ gipddecode -h x500-mono.prn - 0: OFST 0 len=128 - 80: OFST 1 len=128 - 100: OFST 2 len=128 - 180: OFST 3 len=128 - 200: OFST 4 len=128 - [SNIP] - 27d80: OFST 1275 len=128 - 27e00: \\033%-12345X@PJL SET DISPINFOWHILEPRINT=OFF - 27e2a: @PJL SET DISPATPAPERCHANG=OFF - 27e49: @PJL SET JAMRECOVERY=ON - 27e62: @PJL SET OUTPUTBLANKPAPER=OFF - 27e81: @PJL SET PRINTSLOWLY=OFF - 27e9b: @PJL SET REVERSEPRINT=OFF - 27eb6: \\033%-12345X - 27ebf: GDIJ len=108 - unk0=0, unk1=0, unk2=0, unk3=0, unk4=0 - unk5=16777221(0x1000005), unk6=0, unk7=0, unk8=0, paper=0 - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 27f37: GDIP len=52 - nplane = 1, w254 = 4896, h254 = 6110 - 132018de, 0, 0, 0, 0, 1000000, 0, 0, 0, 0, 0, 0, 0, - 27f77: GDIB 0 len=60 (0x3c) - 27fcb: GDIB 1 len=252 (0xfc) - 280df: GDIB 2 len=124 (0x7c) - 28173: GDIB 3 len=956 (0x3bc) - 28547: GDIB 4 len=1692 (0x69c) - 28bfb: GDIB 5 len=572 (0x23c) - 28e4f: GDIB 6 len=17084 (0x42bc) - 2d123: GDIB 7 len=18108 (0x46bc) - 317f7: GDIB 8 len=8508 (0x213c) - 3394b: GDIB 9 len=1756 (0x6dc) - 3403f: GDIB 10 len=1596 (0x63c) - 34693: GDIB 11 len=892 (0x37c) - 34a27: GDIB 12 len=2332 (0x91c) - 3535b: GDIB 13 len=8380 (0x20bc) - 3742f: GDIB 14 len=3452 (0xd7c) - 381c3: GDIB 15 len=60 (0x3c) - 38217: GDIB 16 len=1468 (0x5bc) - 387eb: GDIB 17 len=2076 (0x81c) - 3901f: GDIB 18 len=284 (0x11c) - 39153: GDIB 19 len=1660 (0x67c) - 397e7: GDIB 20 len=2908 (0xb5c) - 3a35b: GDIB 21 len=156 (0x9c) - 3a40f: GDIB 22 len=188 (0xbc) - 3a4e3: GDIB 23 len=220 (0xdc) - 3a5d7: GDIB 24 len=60 (0x3c) - 3a62b: PIDG - 3a637: JIDG -Total Size = 75843 (0x12843) - -.ft P -.fi - -.SH FILES -.BR /usr/bin/gipddecode -'\" .SH SEE ALSO -'\" .BR foo2gipd-wrapper (1), -'\" .BR foo2gipd (1) -.SH "AUTHOR" -Rick Richardson -'\" .br -'\" http://foo2hiperc.rkkda.com/ -'\" -'\" -'\" -.em pdf_outline diff --git a/gipddecode.1in b/gipddecode.1in index b802275..2b4ff71 100644 --- a/gipddecode.1in +++ b/gipddecode.1in @@ -39,7 +39,7 @@ Decode an GIPD stream file. .nf .ft CW -$ gipddecode -h x500-mono.prn +$ gipddecode \-h x500-mono.prn 0: OFST 0 len=128 80: OFST 1 len=128 100: OFST 2 len=128 diff --git a/gipddecode.c b/gipddecode.c index a325710..e15d65f 100644 --- a/gipddecode.c +++ b/gipddecode.c @@ -16,8 +16,8 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * along with this program; if not, see + * . * * Author: Rick Richardson b*/ diff --git a/hbpldecode b/hbpldecode deleted file mode 100755 index 149623f..0000000 Binary files a/hbpldecode and /dev/null differ diff --git a/hbpldecode.1 b/hbpldecode.1 deleted file mode 100644 index 165e01e..0000000 --- a/hbpldecode.1 +++ /dev/null @@ -1,385 +0,0 @@ -'\" t -'\" -'\" DO NOT EDIT! This file is generated from hbpldecode.1in -'\" -.TH hbpldecode 1 "Sun May 26 18:25:20 2024" "hbpldecode 0.0" -'\" -'\" -'\"========================================================================== -'\" STRINGS and MACROS -'\"========================================================================== -'\" -'\" Define strings for special characters that nroff doesn't have -'\" -'\" N.B. using .if cua to test for special characters did not work. -'\" -.if !'\*[.T]'ps' .ds ua up -.if '\*[.T]'ps' .ds ua \(ua -.if !'\*[.T]'ps' .ds da down -.if '\*[.T]'ps' .ds da \(da -.if !'\*[.T]'ps' .ds <- left -.if '\*[.T]'ps' .ds <- \(<- -.if !'\*[.T]'ps' .ds -> right -.if '\*[.T]'ps' .ds -> \(-> -'\" -'\" bx - box a Courier string for making keycaps -'\" -'\" N.B. this mess is to make the line drawing come out only -'\" if we are really generating postscript -'\" -.de bx -.ie !'\*[.T]'ps' \{\ -. RB [ \\$1 ]\\$2 -.\} -.el \{\ -. ie !r ps4html \{\ -'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul' -. ft CW -. nr par*bxw \w'\\$1'+.4m -\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\ -\Z'\h'.2m'\s-1\\$1\s+1'\ -\h'\\n[par*bxw]u'\\$2 -. ft P -. \} -. el \{\ -. RB [ \\$1 ]\\$2 -. \} -.\} -.. -'\" -'\" strings to set current color (null with old groff) -'\" -.if mred .ds red \m[red] -.if mgreen .ds green \m[green] -.if mblue .ds blue \m[blue] -.if mblack .ds black \m[black] -.if mblack .ds mP \mP -'\" -'\" fix for grotty + xterm. We call for orange, grotty outputs yellow, -'\" but xterm displays yellow as orange. The cycle is complete. -'\" -.if n .defcolor orange rgb #ffff00 -'\" -'\" color - set the current color (ignores request with old groff) -'\" -.de color -.if mred \m[\\$1]\c -.. -'\" -'\" colorword - colorize a word (ignored by old groff) -'\" -.de colorword -.ie m\\$1 \m[\\$1]\\$2\mP\c -.el \\$2\c -.. -'\" -'\" colbox - colorize a word in a filled box -'\" -.de colbox -.ie mred \M[\\$2]\ -\v'+.167v'\ -\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\ -\v'-.167v'\ -\m[\\$1]\\$3\mP\MP -.el \\$3\c -.. -'\" -'\" Macros for doing pdfmarks -'\" -.de specialps -.if '\*[.T]'ps' \\k_\X'ps: \\$*'\h'|\\n_u'\c -.. -'\" -'\" pdfmark PDFMARKCODE -'\" -.ds pdfmarks -.if d pdfmarks \{\ -.de pdfmark -. specialps exec [\\$1 pdfmark -.. -'\" -'\" pdfdest LINKNAME -'\" -.de pdfdest -.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST" -.. -'\" -'\" pdfbookmark COUNT LINKNAME STRING -'\" -.de pdfbookmark -. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT" -.. -'\" -'\" Define the SH and SS macros to save pdfmark information -'\" in "arrays" of numbers and strings. -'\" -.if !r rr_n \{\ -.nr rr_n 0 1 -.am SH -. nr rr_levels!\\n+[rr_n] 2 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.am SS -. nr rr_levels!\\n+[rr_n] 3 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.\} -'\" -'\" Called at the end of the document to generate the pdfmark outline -'\" -.de pdf_outline -.nr rr_levels!\\n+[rr_n] 1 -.nr rr_i 0 1 -.while \\n+[rr_i]<\\n[rr_n] \{\ -. nr rr_ip1 \\n[rr_i]+1 -. nr rr_count 0 -. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\ -. nr rr_j \\n[rr_i] 1 -. while \\n+[rr_j]<\\n[rr_n] \{\ -. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\ -. break -. \} -. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\ -. nr rr_count \\n[rr_count]+1 -. \} -. \} -. \} -. ds hhh \\*[rr_labels!\\n[rr_i]] -. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]" -.\} -.. -'\" -'\" Some postscript to make pdfmarks harmless on old interpreters... -'\" -.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse" -'\" -'\" Force display of Bookmarks in Acrobat when document is viewed. -'\" -.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW" -'\" -'\" Output the document info in pdfmarks -'\" -.pdfmark "\ - /Title (\*[an-title](\*[an-section])) \ - /Subject (\*[an-title] Manual Page) \ - /Author (Rick Richardson) \ - /Keywords (printing) \ - /Creator (groff \n(.x.\n(.y.\n(.Y -man) \ - /CreationDate (\*[an-extra1]) \ - /ModDate (\*[an-extra1]) \ - /DOCINFO" -\} -'\" -'\" The manual page name is only 1st level mark -'\" -.nr rr_levels!\n+[rr_n] 1 -.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section]) -.pdfdest Link\n[rr_n] -'\" -'\"========================================================================== -'\" MANUAL PAGE SOURCE -'\"========================================================================== -.SH NAME -hbpldecode \- Decode a HBPL stream into human readable form. -.SH SYNOPSIS -.B hbpldecode -.RI [ options "] <" hbpl-file -.SH DESCRIPTION -.B hbpldecode -decodes a HBPL stream into human readable form. -HBPL is Host Based Printer Language. -.P -There are two versions of HBPL in existence. -.P -Version one is an HBPL stream with JBIG2 (?) data. -This data is used by the Dell 1250c, -Dell C1660w, Epson AcuLaser C1700, Fuji-Xerox cp105b, and similar printers. -These printers are unsupported. -.P -Version two is an HBPL stream with JBIG encoded data. This data -is used by the Xerox WorkCentre 6015, -Fuji Xerox DocuPrint CM205, Dell 1355c, and similar printers. -These printers are supported by foo2hbpl2-wrapper et al. -.P -Both versions can be decoded by hbpldecode. - -.SH COMMAND LINE OPTIONS -These are the options that can appear on the command line. -.TP -.BI \-d\0 basename -Basename of .pbm file for saving decompressed planes. -.TP -.BI \-h -Print hex file offsets. -.TP -.BI \-o -Print file offsets. -.TP -.BI \-D\0 level -Set Debug level [0]. - -.SH EXAMPLES -Decode an HBPL stream file, version 1. - -.nf -.ft CW -$ hbpldecode -h 1250c-mono.prn - 0: \\033%-12345X@PJL JOB MODE=PRINTER - 1f: @PJL SET STRINGCODESET=UTF8 - 3b: @PJL COMMENT DATE=06/01/2011 - 58: @PJL COMMENT TIME=13:28:30 - 73: @PJL COMMENT DNAME=empty - Notepad - 96: @PJL SET JOBATTR="@LUNA=rick" - b4: @PJL SET COPIES=1 - c6: @PJL SET QTY=1 - d5: @PJL SET JOBATTR="@TRCH=OFF" - f2: @PJL SET DUPLEX=OFF - 106: @PJL SET BINDING=LONGEDGE - 120: @PJL SET RENDERMODE=GRAYSCALE - 13e: @PJL SET ECONOMODE=OFF - 155: @PJL SET RET=ON - 165: @PJL SET JOBATTR="@IREC=OFF" - 182: @PJL SET JOBATTR="@HOAD=I0A00020F" - 1a5: @PJL SET JOBATTR="@JOAU=rick" - 1c3: @PJL SET JOBATTR="@CNAM=RICK-VB" - 1e4: @PJL SET IWAMANUALDUP=OFF - 1fe: @PJL SET IWAJAMRECOVERY=AUTO - 21b: @PJL SET JOBATTR="@MSIP=NORMAL" - 23b: @PJL SET PAPERDIRECTION=SEF - 257: @PJL SET RESOLUTION=600 - 26f: @PJL SET BITSPERPIXEL=8 - 287: @PJL SET JOBATTR="@DRDM=RASTER" - 2a7: @PJL SET JOBATTR="@TCPR=33" - 2c3: @PJL SET JOBATTR="@TUCR=33" - 2df: @PJL SET JOBATTR="@TTRC=33" - 2fb: @PJL SET JOBATTR="@TSCR=33" - 317: @PJL SET JOBATTR="@GCPR=33" - 333: @PJL SET JOBATTR="@GUCR=33" - 34f: @PJL SET JOBATTR="@GTRC=33" - 36b: @PJL SET JOBATTR="@GSCR=33" - 387: @PJL SET JOBATTR="@ICPR=34" - 3a3: @PJL SET JOBATTR="@IUCR=34" - 3bf: @PJL SET JOBATTR="@ITRC=34" - 3db: @PJL SET JOBATTR="@ISCR=34" - 3f7: @PJL SET JOBATTR="@TDFT=0" - 412: @PJL SET JOBATTR="@GDFT=0" - 42d: @PJL SET JOBATTR="@IDFT=0" - 448: @PJL ENTER LANGUAGE=HBPL - 461: RECTYPE 'A' [0x41]: - 462: 81 a1: 0x0 - 465: 82 a2: 0x7 - 469: 83 a2: 0x1 - 46d: RECTYPE 'C' [0x43]: - 46e: 91 a1: 0x0 - 471: 92 a1: 0x1 - 474: 93 a1: 0x1 - 477: 94 a1: 0x0 - 47a: 95 c2: 0x0 - 480: 96 a1: 0x0 - 483: 97 c3: 0x0 - 489: 98 a1: 0x0 - 48c: 99 a4: 1 [PAGECNT] - 492: 9a c4: 5104x6600 [WxH] - 49c: 9b a1: 0x0 - 49f: 9c a1: 0x1 - 4a2: 9d a1: 0x9 - 4a5: 9e a1: 0x2 - 4a8: 9f a1: 0x5 - 4ab: a0 a1: 0x8 - 4ae: a1 a1: 0x0 - 4b1: a2 c4: 5104x6600 [WxH] - 4bb: RECTYPE 'Q' [0x51]: - 4bc: RECTYPE 'R' [0x52]: - 4bd: a3 a1: 0x0 - 4c0: a4 a2: 6457 (0x1939) bytes of data... - 1dfe: RECTYPE 'S' [0x53]: - 1dff: RECTYPE 'D' [0x44]: - 1e00: RECTYPE 'B' [0x42]: - 1dff: \\033%-12345X@PJL EOJ - -.ft P -.fi -Decode an HBPL stream file, version 2. - -.nf -.ft CW -$ hbpldecode -h 6015c-color.prn - 0: \033%-12345X@PJL JOB NAME=PRINTER - 20: @PJL SET JOBATTR="HOST:dual.rkkda.org" - 48: @PJL SET JOBATTR="USER:rick" - 66: @PJL SET JOBATTR="DOCU:(stdin)" - 87: @PJL SET JOBATTR="OWNR:rick" - a5: @PJL SET DUPLEX=OFF - ba: @PJL SET MEDIASOURCE=0 - d2: @PJL SET RENDERMODE=COLOR - ed: @PJL SET RESOLUTION=600 - 106: @PJL SET BITSPERPIXEL=2 - 11f: @PJL SET COPIES=1 - 132: @PJL ENTER LANGUAGE=HBPL - 14c: RECTYPE JP [Job Parameters] -00000000: 1b 4a 50 04 01 00 00 01 00 00 00 00 00 00 00 00 .JP..... ........ -00000010: b0 bd ac 43 00 f0 cf 08 f4 9f ac 43 59 ba a0 43 ...C.... ...CY..C -00000020: f4 9f ac 43 00 e0 cd 08 9c ba a0 43 00 f0 cf 08 ...C.... ...C.... -00000030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........ - 18c: RECTYPE PS [Page Start] -00000000: 1b 50 53 3c 00 14 00 00 06 19 00 00 00 78 f4 01 .PS<.... .....x.. -00000010: 90 03 00 00 04 01 01 00 58 02 e0 00 00 00 e0 00 ........ X....... -00000020: 00 00 e0 00 00 00 f0 00 00 00 00 00 00 00 00 00 ........ ........ -00000030: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ........ ........ - w,h=5120x6406 res=600 color=1 - mediatype=Plain(1) papersize=Letter(4) - 1cc: Cyan BIH: - DL = 0, D = 0, P = 1, - = 0, XY = 10240 x 6406 - L0 = 128, MX = 0, MY = 0 - Order = 0 - Options = 64 LRLTWO - 51 stripes, 0 layers, 1 planes - ...cyan data skipped... - 2ac: Magenta BIH: - DL = 0, D = 0, P = 1, - = 0, XY = 10240 x 6406 - L0 = 128, MX = 0, MY = 0 - Order = 0 - Options = 64 LRLTWO - 51 stripes, 0 layers, 1 planes - ...magenta data skipped... - 38c: Yellow BIH: - DL = 0, D = 0, P = 1, - = 0, XY = 10240 x 6406 - L0 = 128, MX = 0, MY = 0 - Order = 0 - Options = 64 LRLTWO - 51 stripes, 0 layers, 1 planes - ...yellow data skipped... - 46c: Black BIH: - DL = 0, D = 0, P = 1, - = 0, XY = 10240 x 6406 - L0 = 128, MX = 0, MY = 0 - Order = 0 - Options = 64 LRLTWO - 51 stripes, 0 layers, 1 planes - ...black data skipped... - 55c: RECTYPE PE [Page End] -00000000: 1b 50 45 3c 00 00 00 00 77 00 00 00 7c 00 00 00 .PE<.... w...|... -00000010: 08 e0 cd 08 00 00 00 00 9c 55 ac bf f4 9f ac 43 ........ .U.....C -00000020: e0 a3 ac 43 00 00 00 00 19 00 00 00 75 9e 99 43 ...C.... ....u..C -00000030: 00 21 99 43 00 00 00 00 01 00 00 00 9a 0e 99 43 .!.C.... .......C - 59c: \\033%-12345X@PJL EOJ - -.ft P -.fi - -.SH FILES -.BR /usr/bin/hbpldecode -.SH SEE ALSO -.BR foo2hbpl2-wrapper (1), -.BR foo2hbpl2 (1) -.SH "AUTHOR" -Rick Richardson -.br -Peter Korf -.br -http://foo2hbpl.rkkda.com/ -'\" -'\" -'\" -.em pdf_outline diff --git a/hbpldecode.1in b/hbpldecode.1in index 52d0ee7..61e294b 100644 --- a/hbpldecode.1in +++ b/hbpldecode.1in @@ -49,12 +49,12 @@ Decode an HBPL stream file, version 1. .nf .ft CW -$ hbpldecode -h 1250c-mono.prn +$ hbpldecode \-h 1250c-mono.prn 0: \\033%-12345X@PJL JOB MODE=PRINTER 1f: @PJL SET STRINGCODESET=UTF8 3b: @PJL COMMENT DATE=06/01/2011 58: @PJL COMMENT TIME=13:28:30 - 73: @PJL COMMENT DNAME=empty - Notepad + 73: @PJL COMMENT DNAME=empty \- Notepad 96: @PJL SET JOBATTR="@LUNA=rick" b4: @PJL SET COPIES=1 c6: @PJL SET QTY=1 @@ -129,7 +129,7 @@ Decode an HBPL stream file, version 2. .nf .ft CW -$ hbpldecode -h 6015c-color.prn +$ hbpldecode \-h 6015c-color.prn 0: \033%-12345X@PJL JOB NAME=PRINTER 20: @PJL SET JOBATTR="HOST:dual.rkkda.org" 48: @PJL SET JOBATTR="USER:rick" @@ -155,28 +155,28 @@ $ hbpldecode -h 6015c-color.prn w,h=5120x6406 res=600 color=1 mediatype=Plain(1) papersize=Letter(4) 1cc: Cyan BIH: - DL = 0, D = 0, P = 1, - = 0, XY = 10240 x 6406 + DL = 0, D = 0, P = 1, \- = 0, XY = 10240 x 6406 L0 = 128, MX = 0, MY = 0 Order = 0 Options = 64 LRLTWO 51 stripes, 0 layers, 1 planes ...cyan data skipped... 2ac: Magenta BIH: - DL = 0, D = 0, P = 1, - = 0, XY = 10240 x 6406 + DL = 0, D = 0, P = 1, \- = 0, XY = 10240 x 6406 L0 = 128, MX = 0, MY = 0 Order = 0 Options = 64 LRLTWO 51 stripes, 0 layers, 1 planes ...magenta data skipped... 38c: Yellow BIH: - DL = 0, D = 0, P = 1, - = 0, XY = 10240 x 6406 + DL = 0, D = 0, P = 1, \- = 0, XY = 10240 x 6406 L0 = 128, MX = 0, MY = 0 Order = 0 Options = 64 LRLTWO 51 stripes, 0 layers, 1 planes ...yellow data skipped... 46c: Black BIH: - DL = 0, D = 0, P = 1, - = 0, XY = 10240 x 6406 + DL = 0, D = 0, P = 1, \- = 0, XY = 10240 x 6406 L0 = 128, MX = 0, MY = 0 Order = 0 Options = 64 LRLTWO diff --git a/hipercdecode b/hipercdecode deleted file mode 100755 index 03e3e01..0000000 Binary files a/hipercdecode and /dev/null differ diff --git a/hipercdecode.1 b/hipercdecode.1 deleted file mode 100644 index b79e2f1..0000000 --- a/hipercdecode.1 +++ /dev/null @@ -1,345 +0,0 @@ -'\" t -'\" -'\" DO NOT EDIT! This file is generated from hipercdecode.1in -'\" -.TH hipercdecode 1 "Sun May 26 18:25:20 2024" "hipercdecode 0.0" -'\" -'\" -'\"========================================================================== -'\" STRINGS and MACROS -'\"========================================================================== -'\" -'\" Define strings for special characters that nroff doesn't have -'\" -'\" N.B. using .if cua to test for special characters did not work. -'\" -.if !'\*[.T]'ps' .ds ua up -.if '\*[.T]'ps' .ds ua \(ua -.if !'\*[.T]'ps' .ds da down -.if '\*[.T]'ps' .ds da \(da -.if !'\*[.T]'ps' .ds <- left -.if '\*[.T]'ps' .ds <- \(<- -.if !'\*[.T]'ps' .ds -> right -.if '\*[.T]'ps' .ds -> \(-> -'\" -'\" bx - box a Courier string for making keycaps -'\" -'\" N.B. this mess is to make the line drawing come out only -'\" if we are really generating postscript -'\" -.de bx -.ie !'\*[.T]'ps' \{\ -. RB [ \\$1 ]\\$2 -.\} -.el \{\ -. ie !r ps4html \{\ -'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul' -. ft CW -. nr par*bxw \w'\\$1'+.4m -\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\ -\Z'\h'.2m'\s-1\\$1\s+1'\ -\h'\\n[par*bxw]u'\\$2 -. ft P -. \} -. el \{\ -. RB [ \\$1 ]\\$2 -. \} -.\} -.. -'\" -'\" strings to set current color (null with old groff) -'\" -.if mred .ds red \m[red] -.if mgreen .ds green \m[green] -.if mblue .ds blue \m[blue] -.if mblack .ds black \m[black] -.if mblack .ds mP \mP -'\" -'\" fix for grotty + xterm. We call for orange, grotty outputs yellow, -'\" but xterm displays yellow as orange. The cycle is complete. -'\" -.if n .defcolor orange rgb #ffff00 -'\" -'\" color - set the current color (ignores request with old groff) -'\" -.de color -.if mred \m[\\$1]\c -.. -'\" -'\" colorword - colorize a word (ignored by old groff) -'\" -.de colorword -.ie m\\$1 \m[\\$1]\\$2\mP\c -.el \\$2\c -.. -'\" -'\" colbox - colorize a word in a filled box -'\" -.de colbox -.ie mred \M[\\$2]\ -\v'+.167v'\ -\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\ -\v'-.167v'\ -\m[\\$1]\\$3\mP\MP -.el \\$3\c -.. -'\" -'\" Macros for doing pdfmarks -'\" -.de specialps -.if '\*[.T]'ps' \\k_\X'ps: \\$*'\h'|\\n_u'\c -.. -'\" -'\" pdfmark PDFMARKCODE -'\" -.ds pdfmarks -.if d pdfmarks \{\ -.de pdfmark -. specialps exec [\\$1 pdfmark -.. -'\" -'\" pdfdest LINKNAME -'\" -.de pdfdest -.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST" -.. -'\" -'\" pdfbookmark COUNT LINKNAME STRING -'\" -.de pdfbookmark -. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT" -.. -'\" -'\" Define the SH and SS macros to save pdfmark information -'\" in "arrays" of numbers and strings. -'\" -.if !r rr_n \{\ -.nr rr_n 0 1 -.am SH -. nr rr_levels!\\n+[rr_n] 2 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.am SS -. nr rr_levels!\\n+[rr_n] 3 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.\} -'\" -'\" Called at the end of the document to generate the pdfmark outline -'\" -.de pdf_outline -.nr rr_levels!\\n+[rr_n] 1 -.nr rr_i 0 1 -.while \\n+[rr_i]<\\n[rr_n] \{\ -. nr rr_ip1 \\n[rr_i]+1 -. nr rr_count 0 -. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\ -. nr rr_j \\n[rr_i] 1 -. while \\n+[rr_j]<\\n[rr_n] \{\ -. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\ -. break -. \} -. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\ -. nr rr_count \\n[rr_count]+1 -. \} -. \} -. \} -. ds hhh \\*[rr_labels!\\n[rr_i]] -. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]" -.\} -.. -'\" -'\" Some postscript to make pdfmarks harmless on old interpreters... -'\" -.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse" -'\" -'\" Force display of Bookmarks in Acrobat when document is viewed. -'\" -.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW" -'\" -'\" Output the document info in pdfmarks -'\" -.pdfmark "\ - /Title (\*[an-title](\*[an-section])) \ - /Subject (\*[an-title] Manual Page) \ - /Author (Rick Richardson) \ - /Keywords (printing) \ - /Creator (groff \n(.x.\n(.y.\n(.Y -man) \ - /CreationDate (\*[an-extra1]) \ - /ModDate (\*[an-extra1]) \ - /DOCINFO" -\} -'\" -'\" The manual page name is only 1st level mark -'\" -.nr rr_levels!\n+[rr_n] 1 -.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section]) -.pdfdest Link\n[rr_n] -'\" -'\"========================================================================== -'\" MANUAL PAGE SOURCE -'\"========================================================================== -.SH NAME -hipercdecode \- Decode a HIPERC stream into human readable form. -.SH SYNOPSIS -.B hipercdecode -.RI [ options "] <" hiperc-file -.SH DESCRIPTION -.B hipercdecode -decodes a HIPERC stream into human readable form. -Uncompressed and JBIG formats are handled. -.P -An HIPERC stream is the printer language used by the -Oki Data C310dn, C3100, C3200n, C3250n, C3300n, C3400n, C5100n, C5250n, C5500n, -C5600, and the C5800n -printers. - -.SH COMMAND LINE OPTIONS -These are the options that can appear on the command line. -.TP -.BI \-d\0 basename -Basename of .pbm file for saving decompressed planes. -.TP -.BI \-h -Print hex file offsets. -.TP -.BI \-o -Print file offsets. -.TP -.BI \-D\0 level -Set Debug level [0]. - -.SH EXAMPLES -Decode an HIPERC stream file created by foo2hiperc. - -.nf -.ft CW -$ foo2hiperc-wrapper testpage.ps | hipercdecode -h - 0: \\033%-12345X@PJL - f: @PJL RDYMSG DISPLAY = "Unknown" - 30: @PJL SET OKIJOBACCOUNTJOB USERID="Unknown" JOBNAME="Unknown" - 6e: @PJL SET OKIAUXJOBINFO DATA="DocumentName=Unknown" - a2: @PJL SET OKIAUXJOBINFO DATA="ComputerName=dual.rkkda.org" - dd: @PJL SET OKIAUXJOBINFO DATA="ReceptionTime=00:00:00 2008/01/30" - 11e: @PJL SET OKIAUTOTRAYSWITCH=ON - 13d: @PJL SET OKIPAPERSIZECHECK=ENABLE - 160: @PJL SET RESOLUTION=600 - 179: @PJL SET PAPER=LETTER - 190: @PJL SET OKITRAYSEQUENCE=PAPERFEEDTRAY - 1b8: @PJL SET OKIPAPERFEED=TRAY1 - 1d5: @PJL SET OKIMEDIATYPE = PLAIN - 1f4: @PJL SET LPARM:PCL OKIPRINTMARGIN=INCH1D6 - 21f: @PJL SET COPIES=1 - 232: @PJL SET QTY=1 - 242: @PJL SET HIPERCEFFECTIVEBLOCKSIZE=34799360 - 26e: @PJL ENTER LANGUAGE=HIPERC - 289: RECTYPE 0 (len=52,0x34 cnt=1) - 291: BLKNUM 0, nbie=1, pn=3 [black] uc=0,0, wid=4864 ud=0,100 - 2a5: BLKNUM 1 (len=20), uncompressed=1, bie: - DL = 48, D = 48, P = 49, - = 48, XY = 4864 x 6816 - L0 = 256, MX = 0, MY = 0 - Order = 0 - Options = 0 - 1 stripes, 0 layers, 49 planes - 2bd: RECTYPE 1 (len=155668,0x26014 cnt=1) - 2c5: BLKNUM 0 (len=4), plane=3, uc=0,0,0 - 2cd: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ... - 262d1: RECTYPE 1 (len=155668,0x26014 cnt=2) - 262d9: BLKNUM 0 (len=4), plane=3, uc=0,0,0 - 262e1: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ... - 4c2e5: RECTYPE 1 (len=155668,0x26014 cnt=3) - 4c2ed: BLKNUM 0 (len=4), plane=3, uc=0,0,0 - 4c2f5: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ... - 722f9: RECTYPE 1 (len=155668,0x26014 cnt=4) - 72301: BLKNUM 0 (len=4), plane=3, uc=0,0,0 - 72309: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ... - 9830d: RECTYPE 1 (len=155668,0x26014 cnt=5) - 98315: BLKNUM 0 (len=4), plane=3, uc=0,0,0 - 9831d: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ... - be321: RECTYPE 1 (len=155668,0x26014 cnt=6) - be329: BLKNUM 0 (len=4), plane=3, uc=0,0,0 - be331: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ... - e4335: RECTYPE 1 (len=155668,0x26014 cnt=7) - e433d: BLKNUM 0 (len=4), plane=3, uc=0,0,0 - e4345: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ... -10a349: RECTYPE 1 (len=155668,0x26014 cnt=8) -10a351: BLKNUM 0 (len=4), plane=3, uc=0,0,0 -10a359: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ... -13035d: RECTYPE 1 (len=155668,0x26014 cnt=9) -130365: BLKNUM 0 (len=4), plane=3, uc=0,0,0 -13036d: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ... -156371: RECTYPE 1 (len=155668,0x26014 cnt=10) -156379: BLKNUM 0 (len=4), plane=3, uc=0,0,0 -156381: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ... -17c385: RECTYPE 1 (len=155668,0x26014 cnt=11) -17c38d: BLKNUM 0 (len=4), plane=3, uc=0,0,0 -17c395: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ... -1a2399: RECTYPE 1 (len=155668,0x26014 cnt=12) -1a23a1: BLKNUM 0 (len=4), plane=3, uc=0,0,0 -1a23a9: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ... -1c83ad: RECTYPE 1 (len=155668,0x26014 cnt=13) -1c83b5: BLKNUM 0 (len=4), plane=3, uc=0,0,0 -1c83bd: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ... -1ee3c1: RECTYPE 1 (len=155668,0x26014 cnt=14) -1ee3c9: BLKNUM 0 (len=4), plane=3, uc=0,0,0 -1ee3d1: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ... -2143d5: RECTYPE 1 (len=155668,0x26014 cnt=15) -2143dd: BLKNUM 0 (len=4), plane=3, uc=0,0,0 -2143e5: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ... -23a3e9: RECTYPE 1 (len=155668,0x26014 cnt=16) -23a3f1: BLKNUM 0 (len=4), plane=3, uc=0,0,0 -23a3f9: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ... -2603fd: RECTYPE 1 (len=155668,0x26014 cnt=17) -260405: BLKNUM 0 (len=4), plane=3, uc=0,0,0 -26040d: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ... -286411: RECTYPE 1 (len=155668,0x26014 cnt=18) -286419: BLKNUM 0 (len=4), plane=3, uc=0,0,0 -286421: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ... -2ac425: RECTYPE 1 (len=155668,0x26014 cnt=19) -2ac42d: BLKNUM 0 (len=4), plane=3, uc=0,0,0 -2ac435: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ... -2d2439: RECTYPE 1 (len=155668,0x26014 cnt=20) -2d2441: BLKNUM 0 (len=4), plane=3, uc=0,0,0 -2d2449: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ... -2f844d: RECTYPE 1 (len=155668,0x26014 cnt=21) -2f8455: BLKNUM 0 (len=4), plane=3, uc=0,0,0 -2f845d: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ... -31e461: RECTYPE 1 (len=155668,0x26014 cnt=22) -31e469: BLKNUM 0 (len=4), plane=3, uc=0,0,0 -31e471: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ... -344475: RECTYPE 1 (len=155668,0x26014 cnt=23) -34447d: BLKNUM 0 (len=4), plane=3, uc=0,0,0 -344485: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ... -36a489: RECTYPE 1 (len=155668,0x26014 cnt=24) -36a491: BLKNUM 0 (len=4), plane=3, uc=0,0,0 -36a499: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ... -39049d: RECTYPE 1 (len=155668,0x26014 cnt=25) -3904a5: BLKNUM 0 (len=4), plane=3, uc=0,0,0 -3904ad: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ... -3b64b1: RECTYPE 1 (len=155668,0x26014 cnt=26) -3b64b9: BLKNUM 0 (len=4), plane=3, uc=0,0,0 -3b64c1: BLKNUM 1 (len=155648), Data=00 00 00 00 00 00 00 00 00 00 00 ... -3dc4c5: RECTYPE 1 (len=97300,0x17c14 cnt=27) -3dc4cd: BLKNUM 0 (len=4), plane=3, uc=0,0,0 -3dc4d5: BLKNUM 1 (len=97280), Data=00 00 00 00 00 00 00 00 00 00 00 ... -3f40d9: RECTYPE 255 (len=8,0x8 cnt=28) -3f40e1: \\033%-12345X - -.ft P -.fi - -.SH FILES -.BR /usr/bin/hipercdecode -.SH SEE ALSO -.BR foo2hiperc-wrapper (1), -.BR foo2hiperc (1) -.SH "AUTHOR" -Rick Richardson -.br -http://foo2hiperc.rkkda.com/ -'\" -'\" -'\" -.em pdf_outline diff --git a/hipercdecode.1in b/hipercdecode.1in index f8dec45..10267cb 100644 --- a/hipercdecode.1in +++ b/hipercdecode.1in @@ -40,7 +40,7 @@ Decode an HIPERC stream file created by foo2hiperc. .nf .ft CW -$ foo2hiperc-wrapper testpage.ps | hipercdecode -h +$ foo2hiperc-wrapper testpage.ps | hipercdecode \-h 0: \\033%-12345X@PJL f: @PJL RDYMSG DISPLAY = "Unknown" 30: @PJL SET OKIJOBACCOUNTJOB USERID="Unknown" JOBNAME="Unknown" @@ -62,7 +62,7 @@ $ foo2hiperc-wrapper testpage.ps | hipercdecode -h 289: RECTYPE 0 (len=52,0x34 cnt=1) 291: BLKNUM 0, nbie=1, pn=3 [black] uc=0,0, wid=4864 ud=0,100 2a5: BLKNUM 1 (len=20), uncompressed=1, bie: - DL = 48, D = 48, P = 49, - = 48, XY = 4864 x 6816 + DL = 48, D = 48, P = 49, \- = 48, XY = 4864 x 6816 L0 = 256, MX = 0, MY = 0 Order = 0 Options = 0 diff --git a/hipercdecode.c b/hipercdecode.c index 50cea78..0922f9d 100644 --- a/hipercdecode.c +++ b/hipercdecode.c @@ -16,8 +16,8 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * along with this program; if not, see + * . * * Author: Rick Richardson b*/ diff --git a/icc2ps/COPYING b/icc2ps/COPYING old mode 100755 new mode 100644 diff --git a/icc2ps/Makefile b/icc2ps/Makefile index fab1d01..0777b40 100644 --- a/icc2ps/Makefile +++ b/icc2ps/Makefile @@ -9,7 +9,7 @@ SRC= icc2ps.c xgetopt.c LIB= cmscam97.c cmscnvrt.c cmserr.c cmsgamma.c cmsgmt.c cmsintrp.c cmsio1.c \ cmslut.c cmsmatsh.c cmsmtrx.c cmsnamed.c cmspack.c cmspcs.c cmsps2.c \ cmssamp.c cmswtpnt.c cmsxform.c cmsio0.c cmsvirt.c -CFLAGS= -O3 +CFLAGS+= -O3 INSTALL=install ifeq ($(UNAME),SunOS) INSTALL=/usr/ucb/install @@ -21,7 +21,7 @@ endif all: foo2zjs-icc2ps man foo2zjs-icc2ps: $(SRC) $(LIB) - $(CC) $(CFLAGS) $(SRC) $(LIB) -lm -o $@ + $(CC) $(CPPFLAGS) $(CFLAGS) $(SRC) $(LIB) -lm -o $@ $(LDFLAGS) install: all $(INSTALL) -c foo2zjs-icc2ps $(BIN) diff --git a/icc2ps/README b/icc2ps/README old mode 100755 new mode 100644 diff --git a/icc2ps/cmscam02.c b/icc2ps/cmscam02.c old mode 100755 new mode 100644 diff --git a/icc2ps/cmscam97.c b/icc2ps/cmscam97.c old mode 100755 new mode 100644 diff --git a/icc2ps/cmscgats.c b/icc2ps/cmscgats.c index 042429f..db4ab3f 100644 --- a/icc2ps/cmscgats.c +++ b/icc2ps/cmscgats.c @@ -620,7 +620,7 @@ void ReadReal(LPIT8 it8, int inum) if (it8->ch == '.') { // Decimal point double frac = 0.0; // fraction - int prec = 0; // precission + int prec = 0; // precision NextCh(it8); // Eats dec. point diff --git a/icc2ps/cmscnvrt.c b/icc2ps/cmscnvrt.c old mode 100755 new mode 100644 diff --git a/icc2ps/cmserr.c b/icc2ps/cmserr.c old mode 100755 new mode 100644 diff --git a/icc2ps/cmsgamma.c b/icc2ps/cmsgamma.c old mode 100755 new mode 100644 diff --git a/icc2ps/cmsgmt.c b/icc2ps/cmsgmt.c old mode 100755 new mode 100644 diff --git a/icc2ps/cmsintrp.c b/icc2ps/cmsintrp.c old mode 100755 new mode 100644 diff --git a/icc2ps/cmsio1.c b/icc2ps/cmsio1.c old mode 100755 new mode 100644 index 1f02720..1bd4e23 --- a/icc2ps/cmsio1.c +++ b/icc2ps/cmsio1.c @@ -71,6 +71,7 @@ void xswab(const void *from, void *to, size_t len) #undef STEP } #else +#include #define xswab swab #endif @@ -1161,7 +1162,7 @@ LCMSBOOL ReadCLUT(LPLCMSICCPROFILE Icc, size_t Offset, LPLUT NewLUT) AdjustEndianessArray16(NewLUT ->T, NewLUT->Tsize / sizeof(WORD)); } else { - cmsSignalError(LCMS_ERRC_ABORTED, "Unknow precission of '%d'", CLUT.prec); + cmsSignalError(LCMS_ERRC_ABORTED, "Unknow precision of '%d'", CLUT.prec); return FALSE; } diff --git a/icc2ps/cmslut.c b/icc2ps/cmslut.c old mode 100755 new mode 100644 diff --git a/icc2ps/cmsmatsh.c b/icc2ps/cmsmatsh.c old mode 100755 new mode 100644 index 634c9f3..971f931 --- a/icc2ps/cmsmatsh.c +++ b/icc2ps/cmsmatsh.c @@ -75,7 +75,7 @@ int ComputeTables(LPGAMMATABLE Table[3], LPWORD Out[3], LPL16PARAMS p16) AllLinear += cmsIsLinear(PtrW, p16 -> nSamples); } - // If is all linear, then supress table interpolation (this + // If is all linear, then suppress table interpolation (this // will speed greately some trivial operations. // Return 1 if present, 0 if all linear @@ -192,7 +192,7 @@ LPMATSHAPER cmsAllocMatShaper(LPMAT3 Matrix, LPGAMMATABLE Tables[], DWORD Behavi AllLinear += cmsIsLinear(PtrW, NewMatShaper -> p16.nSamples); } - // If is all linear, then supress table interpolation (this + // If is all linear, then suppress table interpolation (this // will speed greately some trivial operations if (AllLinear != 3) diff --git a/icc2ps/cmsmtrx.c b/icc2ps/cmsmtrx.c old mode 100755 new mode 100644 diff --git a/icc2ps/cmsnamed.c b/icc2ps/cmsnamed.c old mode 100755 new mode 100644 diff --git a/icc2ps/cmspack.c b/icc2ps/cmspack.c old mode 100755 new mode 100644 diff --git a/icc2ps/cmspcs.c b/icc2ps/cmspcs.c old mode 100755 new mode 100644 diff --git a/icc2ps/cmsps2.c b/icc2ps/cmsps2.c old mode 100755 new mode 100644 index 6c352a7..31592e7 --- a/icc2ps/cmsps2.c +++ b/icc2ps/cmsps2.c @@ -54,7 +54,7 @@ LCMSAPI DWORD LCMSEXPORT cmsGetPostScriptCRDEx(cmsHPROFILE hProfile, int Intent, Color Space Arrays (CSA) ================================================================================== - In order to obtain precission, code chooses between three ways to implement + In order to obtain precision, code chooses between three ways to implement the device -> XYZ transform. These cases identifies monochrome profiles (often implemented as a set of curves), matrix-shaper and LUT-based. @@ -1456,7 +1456,7 @@ int WriteOutputLUT(LPMEMSTREAM m, cmsHPROFILE hProfile, int Intent, DWORD dwFlag OutputFormat = CHANNELS_SH(nChannels) | BYTES_SH(2); // For absolute colorimetric, the LUT is encoded as relative - // in order to preserve precission. + // in order to preserve precision. RelativeEncodingIntent = Intent; if (RelativeEncodingIntent == INTENT_ABSOLUTE_COLORIMETRIC) diff --git a/icc2ps/cmssamp.c b/icc2ps/cmssamp.c old mode 100755 new mode 100644 diff --git a/icc2ps/cmswtpnt.c b/icc2ps/cmswtpnt.c old mode 100755 new mode 100644 diff --git a/icc2ps/cmsxform.c b/icc2ps/cmsxform.c old mode 100755 new mode 100644 diff --git a/icc2ps/foo2zjs-icc2ps b/icc2ps/foo2zjs-icc2ps deleted file mode 100755 index 11f8ff9..0000000 Binary files a/icc2ps/foo2zjs-icc2ps and /dev/null differ diff --git a/icc2ps/foo2zjs-icc2ps.1 b/icc2ps/foo2zjs-icc2ps.1 deleted file mode 100644 index deb70e5..0000000 --- a/icc2ps/foo2zjs-icc2ps.1 +++ /dev/null @@ -1,230 +0,0 @@ -'\" t -'\" -'\" DO NOT EDIT! This file is generated from foo2zjs-icc2ps.1in -'\" -.TH foo2zjs-icc2ps 1 "Sun Jun 20 04:33:46 2010" "foo2zjs-icc2ps 0.0" -'\" -'\" -'\"========================================================================== -'\" STRINGS and MACROS -'\"========================================================================== -'\" -'\" Define strings for special characters that nroff doesn't have -'\" -'\" N.B. using .if cua to test for special characters did not work. -'\" -.if !'\*[.T]'ps' .ds ua up -.if '\*[.T]'ps' .ds ua \(ua -.if !'\*[.T]'ps' .ds da down -.if '\*[.T]'ps' .ds da \(da -.if !'\*[.T]'ps' .ds <- left -.if '\*[.T]'ps' .ds <- \(<- -.if !'\*[.T]'ps' .ds -> right -.if '\*[.T]'ps' .ds -> \(-> -'\" -'\" bx - box a Courier string for making keycaps -'\" -'\" N.B. this mess is to make the line drawing come out only -'\" if we are really generating postscript -'\" -.de bx -.ie !'\*[.T]'ps' \{\ -. RB [ \\$1 ]\\$2 -.\} -.el \{\ -. ie !r ps4html \{\ -'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul' -. ft CW -. nr par*bxw \w'\\$1'+.4m -\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\ -\Z'\h'.2m'\s-1\\$1\s+1'\ -\h'\\n[par*bxw]u'\\$2 -. ft P -. \} -. el \{\ -. RB [ \\$1 ]\\$2 -. \} -.\} -.. -'\" -'\" strings to set current color (null with old groff) -'\" -.if mred .ds red \m[red] -.if mgreen .ds green \m[green] -.if mblue .ds blue \m[blue] -.if mblack .ds black \m[black] -.if mblack .ds mP \mP -'\" -'\" fix for grotty + xterm. We call for orange, grotty outputs yellow, -'\" but xterm displays yellow as orange. The cycle is complete. -'\" -.if n .defcolor orange rgb #ffff00 -'\" -'\" color - set the current color (ignores request with old groff) -'\" -.de color -.if mred \m[\\$1]\c -.. -'\" -'\" colorword - colorize a word (ignored by old groff) -'\" -.de colorword -.ie m\\$1 \m[\\$1]\\$2\mP\c -.el \\$2\c -.. -'\" -'\" colbox - colorize a word in a filled box -'\" -.de colbox -.ie mred \M[\\$2]\ -\v'+.167v'\ -\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\ -\v'-.167v'\ -\m[\\$1]\\$3\mP\MP -.el \\$3\c -.. -'\" -'\" Macros for doing pdfmarks -'\" -.de specialps -.if '\*[.T]'ps' \\k_\X'ps: \\$*'\h'|\\n_u'\c -.. -'\" -'\" pdfmark PDFMARKCODE -'\" -.ds pdfmarks -.if d pdfmarks \{\ -.de pdfmark -. specialps exec [\\$1 pdfmark -.. -'\" -'\" pdfdest LINKNAME -'\" -.de pdfdest -.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST" -.. -'\" -'\" pdfbookmark COUNT LINKNAME STRING -'\" -.de pdfbookmark -. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT" -.. -'\" -'\" Define the SH and SS macros to save pdfmark information -'\" in "arrays" of numbers and strings. -'\" -.if !r rr_n \{\ -.nr rr_n 0 1 -.am SH -. nr rr_levels!\\n+[rr_n] 2 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.am SS -. nr rr_levels!\\n+[rr_n] 3 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.\} -'\" -'\" Called at the end of the document to generate the pdfmark outline -'\" -.de pdf_outline -.nr rr_levels!\\n+[rr_n] 1 -.nr rr_i 0 1 -.while \\n+[rr_i]<\\n[rr_n] \{\ -. nr rr_ip1 \\n[rr_i]+1 -. nr rr_count 0 -. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\ -. nr rr_j \\n[rr_i] 1 -. while \\n+[rr_j]<\\n[rr_n] \{\ -. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\ -. break -. \} -. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\ -. nr rr_count \\n[rr_count]+1 -. \} -. \} -. \} -. ds hhh \\*[rr_labels!\\n[rr_i]] -. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]" -.\} -.. -'\" -'\" Some postscript to make pdfmarks harmless on old interpreters... -'\" -.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse" -'\" -'\" Force display of Bookmarks in Acrobat when document is viewed. -'\" -.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW" -'\" -'\" Output the document info in pdfmarks -'\" -.pdfmark "\ - /Title (\*[an-title](\*[an-section])) \ - /Subject (\*[an-title] Manual Page) \ - /Author (Rick Richardson) \ - /Keywords (printing) \ - /Creator (groff \n(.x.\n(.y.\n(.Y -man) \ - /CreationDate (\*[an-extra1]) \ - /ModDate (\*[an-extra1]) \ - /DOCINFO" -\} -'\" -'\" The manual page name is only 1st level mark -'\" -.nr rr_levels!\n+[rr_n] 1 -.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section]) -.pdfdest Link\n[rr_n] -'\" -.SH NAME -foo2zjs-icc2ps - little cms PostScript converter. -.SH SYNOPSIS -.B foo2zjs-icc2ps -.RI [ options ] -.SH DESCRIPTION -lcms is a standalone CMM engine, which deals with the color management. -It implements a fast transformation between ICC profiles. -.B foo2zjs-icc2ps -is little cms PostScript converter. -.SH COMMAND LINE OPTIONS -.TP -.B \-b -Black point compensation (CRD only). -.TP -.B \-c <0,1,2> -Precision (0=LowRes, 1=Normal (default), 2=Hi-res) (CRD only) -.TP -.BI \-i\ profile -Input profile: Generates Color Space Array (CSA). -.TP -.B \-n -Alternate way to set precision, number of CLUT points (CRD only) -.TP -.BI \-o\ profile -.p -Output profile: Generates Color Rendering Dictionary(CRD). -.TP -.B \-t <0,1,2,3> -Intent (0=Perceptual, 1=Colorimetric, 2=Saturation, 3=Absolute). -.TP -.B \-u -Do NOT generate resource name on CRD. -.SH FILES -.BR /usr/share/foo2*/icm/* -.SH SEE ALSO -.BR foo2hiperc-wrapper (1), -.BR foo2hp2600-wrapper (1), -.BR foo2lava-wrapper (1), -.BR foo2oak-wrapper (1), -.BR foo2qpdl-wrapper (1), -.BR foo2zjs-wrapper (1), -.SH "AUTHOR" -Rick Richardson -.br -http://foo2zjs.rkkda.com/ -'/" -'/" -'/" -.em pdf_outline diff --git a/icc2ps/foo2zjs-icc2ps.1in b/icc2ps/foo2zjs-icc2ps.1in index bbccb50..054bbdf 100644 --- a/icc2ps/foo2zjs-icc2ps.1in +++ b/icc2ps/foo2zjs-icc2ps.1in @@ -1,16 +1,16 @@ -.TH foo2zjs-icc2ps 1 "Sun Jun 20 04:33:46 2010" "foo2zjs-icc2ps 0.0" +.TH foo2zjs\-icc2ps 1 "Sun Jun 20 04:33:46 2010" "foo2zjs\-icc2ps 0.0" #ifndef OLDGROFF #include "../macros.man" #endif .SH NAME -foo2zjs-icc2ps - little cms PostScript converter. +foo2zjs\-icc2ps \- little cms PostScript converter. .SH SYNOPSIS -.B foo2zjs-icc2ps +.B foo2zjs\-icc2ps .RI [ options ] .SH DESCRIPTION lcms is a standalone CMM engine, which deals with the color management. It implements a fast transformation between ICC profiles. -.B foo2zjs-icc2ps +.B foo2zjs\-icc2ps is little cms PostScript converter. .SH COMMAND LINE OPTIONS .TP @@ -18,7 +18,7 @@ is little cms PostScript converter. Black point compensation (CRD only). .TP .B \-c <0,1,2> -Precision (0=LowRes, 1=Normal (default), 2=Hi-res) (CRD only) +Precision (0=LowRes, 1=Normal (default), 2=Hi\-res) (CRD only) .TP .BI \-i\ profile Input profile: Generates Color Space Array (CSA). @@ -27,7 +27,6 @@ Input profile: Generates Color Space Array (CSA). Alternate way to set precision, number of CLUT points (CRD only) .TP .BI \-o\ profile -.p Output profile: Generates Color Rendering Dictionary(CRD). .TP .B \-t <0,1,2,3> @@ -38,17 +37,14 @@ Do NOT generate resource name on CRD. .SH FILES .BR /usr/share/foo2*/icm/* .SH SEE ALSO -.BR foo2hiperc-wrapper (1), -.BR foo2hp2600-wrapper (1), -.BR foo2lava-wrapper (1), -.BR foo2oak-wrapper (1), -.BR foo2qpdl-wrapper (1), -.BR foo2zjs-wrapper (1), +.BR foo2hiperc\-wrapper (1), +.BR foo2hp2600\-wrapper (1), +.BR foo2lava\-wrapper (1), +.BR foo2oak\-wrapper (1), +.BR foo2qpdl\-wrapper (1), +.BR foo2zjs\-wrapper (1), .SH "AUTHOR" Rick Richardson .br http://foo2zjs.rkkda.com/ -'/" -'/" -'/" .em pdf_outline diff --git a/icc2ps/icc2ps.c b/icc2ps/icc2ps.c old mode 100755 new mode 100644 index 7c7df2b..8f78a55 --- a/icc2ps/icc2ps.c +++ b/icc2ps/icc2ps.c @@ -139,8 +139,8 @@ void Help(void) fprintf(stderr, "%cb - Black point compensation (CRD only)\n", SW); fprintf(stderr, "%cu - Do NOT generate resource name on CRD\n", SW); - fprintf(stderr, "%cc<0,1,2> - Precission (0=LowRes, 1=Normal (default), 2=Hi-res) (CRD only)\n", SW); - fprintf(stderr, "%cn - Alternate way to set precission, number of CLUT points (CRD only)\n", SW); + fprintf(stderr, "%cc<0,1,2> - Precision (0=LowRes, 1=Normal (default), 2=Hi-res) (CRD only)\n", SW); + fprintf(stderr, "%cn - Alternate way to set precision, number of CLUT points (CRD only)\n", SW); fprintf(stderr, "\n"); fprintf(stderr, "This program is intended to be a demo of the little cms\n" diff --git a/icc2ps/icc34.h b/icc2ps/icc34.h old mode 100755 new mode 100644 diff --git a/icc2ps/xgetopt.c b/icc2ps/xgetopt.c old mode 100755 new mode 100644 diff --git a/jbig_ar.c b/jbig_ar.c index 29f13bd..a21026b 100644 --- a/jbig_ar.c +++ b/jbig_ar.c @@ -20,20 +20,11 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * along with this program; if not, see + * . * * If you want to use this program under different license conditions, * then contact the author for an arrangement. - * - * It is possible that certain products which can be built using this - * software module might form inventions protected by patent rights in - * some countries (e.g., by patents about arithmetic coding algorithms - * owned by IBM and AT&T in the USA). Provision of this software by the - * author does NOT include any licences for any patents. In those - * countries where a patent licence is required for certain applications - * of this software module, you will have to obtain such a licence - * yourself. */ #include @@ -117,7 +108,7 @@ void arith_encode_init(struct jbg_arenc_state *s, int reuse_st) int i; if (!reuse_st) - for (i = 0; i < 4096; s->st[i++] = 0); + for (i = 0; i < 4096; s->st[i++] = 0) ; s->c = 0; s->a = 0x10000L; s->sc = 0; @@ -273,7 +264,7 @@ void arith_decode_init(struct jbg_ardec_state *s, int reuse_st) int i; if (!reuse_st) - for (i = 0; i < 4096; s->st[i++] = 0); + for (i = 0; i < 4096; s->st[i++] = 0) ; s->c = 0; s->a = 1; s->ct = 0; diff --git a/lavadecode b/lavadecode deleted file mode 100755 index 2b12296..0000000 Binary files a/lavadecode and /dev/null differ diff --git a/lavadecode.1 b/lavadecode.1 deleted file mode 100644 index 0197948..0000000 --- a/lavadecode.1 +++ /dev/null @@ -1,278 +0,0 @@ -'\" t -'\" -'\" DO NOT EDIT! This file is generated from lavadecode.1in -'\" -.TH lavadecode 1 "Sun May 26 18:25:20 2024" "lavadecode 0.0" -'\" -'\" -'\"========================================================================== -'\" STRINGS and MACROS -'\"========================================================================== -'\" -'\" Define strings for special characters that nroff doesn't have -'\" -'\" N.B. using .if cua to test for special characters did not work. -'\" -.if !'\*[.T]'ps' .ds ua up -.if '\*[.T]'ps' .ds ua \(ua -.if !'\*[.T]'ps' .ds da down -.if '\*[.T]'ps' .ds da \(da -.if !'\*[.T]'ps' .ds <- left -.if '\*[.T]'ps' .ds <- \(<- -.if !'\*[.T]'ps' .ds -> right -.if '\*[.T]'ps' .ds -> \(-> -'\" -'\" bx - box a Courier string for making keycaps -'\" -'\" N.B. this mess is to make the line drawing come out only -'\" if we are really generating postscript -'\" -.de bx -.ie !'\*[.T]'ps' \{\ -. RB [ \\$1 ]\\$2 -.\} -.el \{\ -. ie !r ps4html \{\ -'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul' -. ft CW -. nr par*bxw \w'\\$1'+.4m -\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\ -\Z'\h'.2m'\s-1\\$1\s+1'\ -\h'\\n[par*bxw]u'\\$2 -. ft P -. \} -. el \{\ -. RB [ \\$1 ]\\$2 -. \} -.\} -.. -'\" -'\" strings to set current color (null with old groff) -'\" -.if mred .ds red \m[red] -.if mgreen .ds green \m[green] -.if mblue .ds blue \m[blue] -.if mblack .ds black \m[black] -.if mblack .ds mP \mP -'\" -'\" fix for grotty + xterm. We call for orange, grotty outputs yellow, -'\" but xterm displays yellow as orange. The cycle is complete. -'\" -.if n .defcolor orange rgb #ffff00 -'\" -'\" color - set the current color (ignores request with old groff) -'\" -.de color -.if mred \m[\\$1]\c -.. -'\" -'\" colorword - colorize a word (ignored by old groff) -'\" -.de colorword -.ie m\\$1 \m[\\$1]\\$2\mP\c -.el \\$2\c -.. -'\" -'\" colbox - colorize a word in a filled box -'\" -.de colbox -.ie mred \M[\\$2]\ -\v'+.167v'\ -\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\ -\v'-.167v'\ -\m[\\$1]\\$3\mP\MP -.el \\$3\c -.. -'\" -'\" Macros for doing pdfmarks -'\" -.de specialps -.if '\*[.T]'ps' \\k_\X'ps: \\$*'\h'|\\n_u'\c -.. -'\" -'\" pdfmark PDFMARKCODE -'\" -.ds pdfmarks -.if d pdfmarks \{\ -.de pdfmark -. specialps exec [\\$1 pdfmark -.. -'\" -'\" pdfdest LINKNAME -'\" -.de pdfdest -.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST" -.. -'\" -'\" pdfbookmark COUNT LINKNAME STRING -'\" -.de pdfbookmark -. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT" -.. -'\" -'\" Define the SH and SS macros to save pdfmark information -'\" in "arrays" of numbers and strings. -'\" -.if !r rr_n \{\ -.nr rr_n 0 1 -.am SH -. nr rr_levels!\\n+[rr_n] 2 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.am SS -. nr rr_levels!\\n+[rr_n] 3 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.\} -'\" -'\" Called at the end of the document to generate the pdfmark outline -'\" -.de pdf_outline -.nr rr_levels!\\n+[rr_n] 1 -.nr rr_i 0 1 -.while \\n+[rr_i]<\\n[rr_n] \{\ -. nr rr_ip1 \\n[rr_i]+1 -. nr rr_count 0 -. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\ -. nr rr_j \\n[rr_i] 1 -. while \\n+[rr_j]<\\n[rr_n] \{\ -. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\ -. break -. \} -. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\ -. nr rr_count \\n[rr_count]+1 -. \} -. \} -. \} -. ds hhh \\*[rr_labels!\\n[rr_i]] -. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]" -.\} -.. -'\" -'\" Some postscript to make pdfmarks harmless on old interpreters... -'\" -.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse" -'\" -'\" Force display of Bookmarks in Acrobat when document is viewed. -'\" -.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW" -'\" -'\" Output the document info in pdfmarks -'\" -.pdfmark "\ - /Title (\*[an-title](\*[an-section])) \ - /Subject (\*[an-title] Manual Page) \ - /Author (Rick Richardson) \ - /Keywords (printing) \ - /Creator (groff \n(.x.\n(.y.\n(.Y -man) \ - /CreationDate (\*[an-extra1]) \ - /ModDate (\*[an-extra1]) \ - /DOCINFO" -\} -'\" -'\" The manual page name is only 1st level mark -'\" -.nr rr_levels!\n+[rr_n] 1 -.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section]) -.pdfdest Link\n[rr_n] -'\" -'\"========================================================================== -'\" MANUAL PAGE SOURCE -'\"========================================================================== -.SH NAME -lavadecode \- Decode a LAVAFLOW stream into human readable form. -.SH SYNOPSIS -.B lavadecode -.RI [ options "] <" lavaflow-file -.SH DESCRIPTION -.B lavadecode -decodes a LAVAFLOW stream into human readable form. -.P -A LAVAFLOW stream is the printer language used by some Konica Minolta -printers, such as the KM magicolor 2530 DL. - -.SH COMMAND LINE OPTIONS -These are the options that can appear on the command line. -.TP -.BI \-d\0 basename -Basename of .pbm file for saving decompressed planes. -.TP -.BI \-h -Print hex file offsets. -.TP -.BI \-o -Print file offsets. -.TP -.BI \-D\0 level -Set Debug level [0]. - -.SH EXAMPLES -Decode an LAVAFLOW stream file created by foo2lava. - -.nf -.ft CW -$ lavadecode -h < testpage.prn - 0: \\033%-12345X@PJL JOB NAME="stdin" - 1f: \\033%-12345X@PJL JOB USERNAME="" - 3d: \\033%-12345X@PJL JOB TIMESTAMP="07/20/2007" - 66: \\033%-12345X@PJL JOB OSINFO="Linux/2.6.20-1.2316.fc5" - 99: \\033%-12345X@PJL ENTER LANGUAGE=LAVAFLOW - bf: \\033E RESET - c1: \\033&l0S DUPLEX: [off] - c6: \\033&l0G - cb: \\033&u1200D X RESOLUTION: [1200] - d3: \\033&l1X COPIES: [1] - d8: \\033&x1X TRANSMIT ONCE COPIES: [1] - dd: \\033&l0O ORIENTATION: [port] - e2: \\033*r1U NBIE: [1] - e7: \\033*g8W BW/COLOR: [8] - fmt=2 np=1 - BLACK: X=1200, Y=600, unk=0, #=4(2) - f4: \\033*b1234M COMPRESSION: [1234] (JBIG) - fc: \\033&l2A PAGE SIZE: [letter] - 101: \\033&l255H PAPER SOURCE: [auto] - 108: \\033&l0M MEDIA TYPE: [plain] - 10d: \\033&l0E TOP MARGIN: [0] - 112: \\033*r9792S X RASTER: [9792,0x2640] - 11a: \\033*r6400T Y RASTER: [6400,0x1900] - 122: \\033&l0U - 127: \\033&l0Z - 12c: \\033*p200X X OFFSET: [200] - 133: \\033*p200Y Y OFFSET: [200] - 13a: \\033*r1A [Page 1] - 13f: \\033*b20V [black] - DL = 0, D = 0, P = 1, - = 0, XY = 9792 x 6400 - L0 = 128, MX = 0, MY = 0 - Order = 3 ILEAVE SMID - Options = 92 LRLTWO TPDON TPBON DPON - 50 stripes, 0 layers, 1 planes - 159: \\033*b65536V JBIG data (first) [65536,0x10000] - ff 02 c2 79 54 3e be e1 a0 de 08 9a b1 d2 c2 59 - ... ae 88 ef a7 c7 96 d3 96 a6 d7 2c 06 38 75 22 44 - 10162: \\033*b26432W JBIG data (end) [26432,0x6740] - 0e 89 66 ce 01 41 41 41 41 41 41 41 41 41 41 41 - ... 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 - 168ab: \\033*x3887138K BLACK DOTS: [3887138] - 168b6: \\033*x58781662W BLACK WHITEDOTS: [58781662] - 168c2: \\033*rC END PAGE - 168c6: \\033&l0H PAPER SOURCE: [eject] - 168cb: \\033E RESET - 168cd: \\033%-12345X -.ft P -.fi - -.SH FILES -.BR /usr/bin/lavadecode -.SH SEE ALSO -.BR foo2lava-wrapper (1), -.BR foo2lava (1) -.SH "AUTHOR" -Rick Richardson -.br -http://foo2lava.rkkda.com/ -'\" -'\" -'\" -.em pdf_outline diff --git a/lavadecode.1in b/lavadecode.1in index 3a4901e..36e3cff 100644 --- a/lavadecode.1in +++ b/lavadecode.1in @@ -37,7 +37,7 @@ Decode an LAVAFLOW stream file created by foo2lava. .nf .ft CW -$ lavadecode -h < testpage.prn +$ lavadecode \-h < testpage.prn 0: \\033%-12345X@PJL JOB NAME="stdin" 1f: \\033%-12345X@PJL JOB USERNAME="" 3d: \\033%-12345X@PJL JOB TIMESTAMP="07/20/2007" @@ -67,7 +67,7 @@ $ lavadecode -h < testpage.prn 133: \\033*p200Y Y OFFSET: [200] 13a: \\033*r1A [Page 1] 13f: \\033*b20V [black] - DL = 0, D = 0, P = 1, - = 0, XY = 9792 x 6400 + DL = 0, D = 0, P = 1, \- = 0, XY = 9792 x 6400 L0 = 128, MX = 0, MY = 0 Order = 3 ILEAVE SMID Options = 92 LRLTWO TPDON TPBON DPON diff --git a/msexpand b/msexpand index fe39f44..0a47580 100755 --- a/msexpand +++ b/msexpand @@ -15,8 +15,8 @@ # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +# along with this program; if not, see +# . # # Microsoft compress file structure: # Uses a 12 bit (4k) sliding window Lempel Ziv variant. diff --git a/oakdecode b/oakdecode deleted file mode 100755 index f84ff81..0000000 Binary files a/oakdecode and /dev/null differ diff --git a/oakdecode.1 b/oakdecode.1 deleted file mode 100644 index 6826c3d..0000000 --- a/oakdecode.1 +++ /dev/null @@ -1,274 +0,0 @@ -'\" t -'\" -'\" DO NOT EDIT! This file is generated from oakdecode.1in -'\" -.TH oakdecode 1 "Sun May 26 18:25:20 2024" "oakdecode 0.0" -'\" -'\" -'\"========================================================================== -'\" STRINGS and MACROS -'\"========================================================================== -'\" -'\" Define strings for special characters that nroff doesn't have -'\" -'\" N.B. using .if cua to test for special characters did not work. -'\" -.if !'\*[.T]'ps' .ds ua up -.if '\*[.T]'ps' .ds ua \(ua -.if !'\*[.T]'ps' .ds da down -.if '\*[.T]'ps' .ds da \(da -.if !'\*[.T]'ps' .ds <- left -.if '\*[.T]'ps' .ds <- \(<- -.if !'\*[.T]'ps' .ds -> right -.if '\*[.T]'ps' .ds -> \(-> -'\" -'\" bx - box a Courier string for making keycaps -'\" -'\" N.B. this mess is to make the line drawing come out only -'\" if we are really generating postscript -'\" -.de bx -.ie !'\*[.T]'ps' \{\ -. RB [ \\$1 ]\\$2 -.\} -.el \{\ -. ie !r ps4html \{\ -'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul' -. ft CW -. nr par*bxw \w'\\$1'+.4m -\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\ -\Z'\h'.2m'\s-1\\$1\s+1'\ -\h'\\n[par*bxw]u'\\$2 -. ft P -. \} -. el \{\ -. RB [ \\$1 ]\\$2 -. \} -.\} -.. -'\" -'\" strings to set current color (null with old groff) -'\" -.if mred .ds red \m[red] -.if mgreen .ds green \m[green] -.if mblue .ds blue \m[blue] -.if mblack .ds black \m[black] -.if mblack .ds mP \mP -'\" -'\" fix for grotty + xterm. We call for orange, grotty outputs yellow, -'\" but xterm displays yellow as orange. The cycle is complete. -'\" -.if n .defcolor orange rgb #ffff00 -'\" -'\" color - set the current color (ignores request with old groff) -'\" -.de color -.if mred \m[\\$1]\c -.. -'\" -'\" colorword - colorize a word (ignored by old groff) -'\" -.de colorword -.ie m\\$1 \m[\\$1]\\$2\mP\c -.el \\$2\c -.. -'\" -'\" colbox - colorize a word in a filled box -'\" -.de colbox -.ie mred \M[\\$2]\ -\v'+.167v'\ -\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\ -\v'-.167v'\ -\m[\\$1]\\$3\mP\MP -.el \\$3\c -.. -'\" -'\" Macros for doing pdfmarks -'\" -.de specialps -.if '\*[.T]'ps' \\k_\X'ps: \\$*'\h'|\\n_u'\c -.. -'\" -'\" pdfmark PDFMARKCODE -'\" -.ds pdfmarks -.if d pdfmarks \{\ -.de pdfmark -. specialps exec [\\$1 pdfmark -.. -'\" -'\" pdfdest LINKNAME -'\" -.de pdfdest -.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST" -.. -'\" -'\" pdfbookmark COUNT LINKNAME STRING -'\" -.de pdfbookmark -. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT" -.. -'\" -'\" Define the SH and SS macros to save pdfmark information -'\" in "arrays" of numbers and strings. -'\" -.if !r rr_n \{\ -.nr rr_n 0 1 -.am SH -. nr rr_levels!\\n+[rr_n] 2 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.am SS -. nr rr_levels!\\n+[rr_n] 3 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.\} -'\" -'\" Called at the end of the document to generate the pdfmark outline -'\" -.de pdf_outline -.nr rr_levels!\\n+[rr_n] 1 -.nr rr_i 0 1 -.while \\n+[rr_i]<\\n[rr_n] \{\ -. nr rr_ip1 \\n[rr_i]+1 -. nr rr_count 0 -. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\ -. nr rr_j \\n[rr_i] 1 -. while \\n+[rr_j]<\\n[rr_n] \{\ -. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\ -. break -. \} -. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\ -. nr rr_count \\n[rr_count]+1 -. \} -. \} -. \} -. ds hhh \\*[rr_labels!\\n[rr_i]] -. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]" -.\} -.. -'\" -'\" Some postscript to make pdfmarks harmless on old interpreters... -'\" -.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse" -'\" -'\" Force display of Bookmarks in Acrobat when document is viewed. -'\" -.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW" -'\" -'\" Output the document info in pdfmarks -'\" -.pdfmark "\ - /Title (\*[an-title](\*[an-section])) \ - /Subject (\*[an-title] Manual Page) \ - /Author (Rick Richardson) \ - /Keywords (printing) \ - /Creator (groff \n(.x.\n(.y.\n(.Y -man) \ - /CreationDate (\*[an-extra1]) \ - /ModDate (\*[an-extra1]) \ - /DOCINFO" -\} -'\" -'\" The manual page name is only 1st level mark -'\" -.nr rr_levels!\n+[rr_n] 1 -.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section]) -.pdfdest Link\n[rr_n] -'\" -'\"========================================================================== -'\" MANUAL PAGE SOURCE -'\"========================================================================== -.SH NAME -oakdecode \- Decode an OAKT printer stream into human readable form. -.SH SYNOPSIS -.B oakdecode -.RI [ options "] <" OAKT-file -.SH DESCRIPTION -.B oakdecode -decodes an OAKT printer stream into human readable form. -.P -An OAKT printer stream is the printer language used by the HP Color LaserJet -1500 and other printers. - -.SH COMMAND LINE OPTIONS -These are the options that can appear on the command line. -.TP -.BI \-d\0 basename -Basename of .pbm file for saving decompressed planes. -.TP -.BI \-r\0 basename -Basename of .jbg file for saving raw planes -.TP -.BI \-i -Suppress display of image records. -.TP -.BI \-o -Print file offsets. -.TP -.BI \-D\0 level -Set Debug level [0]. - -.SH EXAMPLES -Decode an OAKT file created by foo2oak. - -.nf -.ft CW -$ oakdecode < testpage.oak -0d (80) 1 OTHER -0c (64) Wed Nov 05 16:30:50 2003 a07d3 100005 32001e -0a (80) testpage.pdf -14 (16) (no args) -28 (16) Source=Tray1 -29 (80) PaperType=0 UNK8=2,0,0,0, blanks(63) -2a (32) Copies=1 UNK=0 -2b (32) papercode=25 xwid=4648 ywid=9000 UNK=0 -33 (64) - u0 u1 w h resx resy nBits - x0 x0 2128 4300 600 600 x1 -15 (16) (no args) - bih0 w h l0 bih5 dlen plen unk yOff P subP -3c (64) 00010000 2176 256 256 58030020 1050 1056 000 64 3 0 - DL = 0, D = 0, P = 1, - = 0, XY = 2176 x 256 - L0 = 256, MX = 32, MY = 0 - Order = 3 ILEAVE SMID - Options = 88 LRLTWO TPDON TPBON - 1 stripes, 0 layers, 1 planes -3c (64) 00010000 2176 256 256 58030020 3668 3680 000 320 3 0 -3c (64) 00010000 2176 256 256 58030020 1463 1472 000 640 3 0 -3c (64) 00010000 2176 256 256 58030020 1975 1984 000 896 3 0 -3c (64) 00010000 2176 224 224 58030020 2744 2752 000 1152 3 0 -3c (64) 00010000 2176 256 256 58030020 988 992 000 1440 3 0 -3c (64) 00010000 2176 256 256 58030020 2892 2896 000 1696 3 0 -3c (64) 00010000 2176 256 256 58030020 3634 3648 000 1952 3 0 -3c (64) 00010000 2176 256 256 58030020 3236 3248 000 2208 3 0 -3c (64) 00010000 2176 256 256 58030020 2279 2288 000 2464 3 0 -3c (64) 00010000 2176 256 256 58030020 3746 3760 000 2720 3 0 -3c (64) 00010000 2176 200 200 58030020 2404 2416 000 2976 3 0 -3c (64) 00010000 2176 256 256 58030020 3114 3120 000 3240 3 0 -3c (64) 00010000 2176 96 96 58030020 1142 1152 000 3496 3 0 -3c (64) 00010000 2176 256 256 58030020 2094 2112 000 3752 3 0 -3c (64) 00010000 2176 256 256 58030020 1319 1328 000 4008 3 0 -3c (64) 00010000 2176 36 36 58030020 208 224 000 4264 3 0 -17 (16) (no args) -18 (16) UNK=0 -0b (16) (no args) -.ft P -.fi - -.SH FILES -.BR /usr/bin/oakdecode -.SH SEE ALSO -.BR foo2oak-wrapper (1), -.BR foo2oak (1), -.BR jbg2pbm (1) -.SH "AUTHOR" -Rick Richardson -.br -http://foo2oak.rkkda.com/ -'\" -'\" -'\" -.em pdf_outline diff --git a/oakdecode.1in b/oakdecode.1in index e248af7..4e421a8 100644 --- a/oakdecode.1in +++ b/oakdecode.1in @@ -55,7 +55,7 @@ $ oakdecode < testpage.oak 15 (16) (no args) bih0 w h l0 bih5 dlen plen unk yOff P subP 3c (64) 00010000 2176 256 256 58030020 1050 1056 000 64 3 0 - DL = 0, D = 0, P = 1, - = 0, XY = 2176 x 256 + DL = 0, D = 0, P = 1, \- = 0, XY = 2176 x 256 L0 = 256, MX = 32, MY = 0 Order = 3 ILEAVE SMID Options = 88 LRLTWO TPDON TPBON diff --git a/opldecode b/opldecode deleted file mode 100755 index d434fce..0000000 Binary files a/opldecode and /dev/null differ diff --git a/opldecode.1 b/opldecode.1 deleted file mode 100644 index 0774186..0000000 --- a/opldecode.1 +++ /dev/null @@ -1,297 +0,0 @@ -'\" t -'\" -'\" DO NOT EDIT! This file is generated from opldecode.1in -'\" -.TH opldecode 1 "Sun May 26 18:25:20 2024" "opldecode 0.0" -'\" -'\" -'\"========================================================================== -'\" STRINGS and MACROS -'\"========================================================================== -'\" -'\" Define strings for special characters that nroff doesn't have -'\" -'\" N.B. using .if cua to test for special characters did not work. -'\" -.if !'\*[.T]'ps' .ds ua up -.if '\*[.T]'ps' .ds ua \(ua -.if !'\*[.T]'ps' .ds da down -.if '\*[.T]'ps' .ds da \(da -.if !'\*[.T]'ps' .ds <- left -.if '\*[.T]'ps' .ds <- \(<- -.if !'\*[.T]'ps' .ds -> right -.if '\*[.T]'ps' .ds -> \(-> -'\" -'\" bx - box a Courier string for making keycaps -'\" -'\" N.B. this mess is to make the line drawing come out only -'\" if we are really generating postscript -'\" -.de bx -.ie !'\*[.T]'ps' \{\ -. RB [ \\$1 ]\\$2 -.\} -.el \{\ -. ie !r ps4html \{\ -'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul' -. ft CW -. nr par*bxw \w'\\$1'+.4m -\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\ -\Z'\h'.2m'\s-1\\$1\s+1'\ -\h'\\n[par*bxw]u'\\$2 -. ft P -. \} -. el \{\ -. RB [ \\$1 ]\\$2 -. \} -.\} -.. -'\" -'\" strings to set current color (null with old groff) -'\" -.if mred .ds red \m[red] -.if mgreen .ds green \m[green] -.if mblue .ds blue \m[blue] -.if mblack .ds black \m[black] -.if mblack .ds mP \mP -'\" -'\" fix for grotty + xterm. We call for orange, grotty outputs yellow, -'\" but xterm displays yellow as orange. The cycle is complete. -'\" -.if n .defcolor orange rgb #ffff00 -'\" -'\" color - set the current color (ignores request with old groff) -'\" -.de color -.if mred \m[\\$1]\c -.. -'\" -'\" colorword - colorize a word (ignored by old groff) -'\" -.de colorword -.ie m\\$1 \m[\\$1]\\$2\mP\c -.el \\$2\c -.. -'\" -'\" colbox - colorize a word in a filled box -'\" -.de colbox -.ie mred \M[\\$2]\ -\v'+.167v'\ -\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\ -\v'-.167v'\ -\m[\\$1]\\$3\mP\MP -.el \\$3\c -.. -'\" -'\" Macros for doing pdfmarks -'\" -.de specialps -.if '\*[.T]'ps' \\k_\X'ps: \\$*'\h'|\\n_u'\c -.. -'\" -'\" pdfmark PDFMARKCODE -'\" -.ds pdfmarks -.if d pdfmarks \{\ -.de pdfmark -. specialps exec [\\$1 pdfmark -.. -'\" -'\" pdfdest LINKNAME -'\" -.de pdfdest -.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST" -.. -'\" -'\" pdfbookmark COUNT LINKNAME STRING -'\" -.de pdfbookmark -. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT" -.. -'\" -'\" Define the SH and SS macros to save pdfmark information -'\" in "arrays" of numbers and strings. -'\" -.if !r rr_n \{\ -.nr rr_n 0 1 -.am SH -. nr rr_levels!\\n+[rr_n] 2 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.am SS -. nr rr_levels!\\n+[rr_n] 3 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.\} -'\" -'\" Called at the end of the document to generate the pdfmark outline -'\" -.de pdf_outline -.nr rr_levels!\\n+[rr_n] 1 -.nr rr_i 0 1 -.while \\n+[rr_i]<\\n[rr_n] \{\ -. nr rr_ip1 \\n[rr_i]+1 -. nr rr_count 0 -. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\ -. nr rr_j \\n[rr_i] 1 -. while \\n+[rr_j]<\\n[rr_n] \{\ -. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\ -. break -. \} -. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\ -. nr rr_count \\n[rr_count]+1 -. \} -. \} -. \} -. ds hhh \\*[rr_labels!\\n[rr_i]] -. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]" -.\} -.. -'\" -'\" Some postscript to make pdfmarks harmless on old interpreters... -'\" -.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse" -'\" -'\" Force display of Bookmarks in Acrobat when document is viewed. -'\" -.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW" -'\" -'\" Output the document info in pdfmarks -'\" -.pdfmark "\ - /Title (\*[an-title](\*[an-section])) \ - /Subject (\*[an-title] Manual Page) \ - /Author (Rick Richardson) \ - /Keywords (printing) \ - /Creator (groff \n(.x.\n(.y.\n(.Y -man) \ - /CreationDate (\*[an-extra1]) \ - /ModDate (\*[an-extra1]) \ - /DOCINFO" -\} -'\" -'\" The manual page name is only 1st level mark -'\" -.nr rr_levels!\n+[rr_n] 1 -.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section]) -.pdfdest Link\n[rr_n] -'\" -'\"========================================================================== -'\" MANUAL PAGE SOURCE -'\"========================================================================== -.SH NAME -opldecode \- Decode a Raster Object (opl) stream into human readable form. -.SH SYNOPSIS -.B opldecode -.RI [ options "] <" zjs-file -.SH DESCRIPTION -.B opldecode -decodes a Raster Object (opl) stream into human readable form. -.P -A Raster Object stream is the printer language used by some Konica Minolta -printers, such as the KM magicolor 2480 MF. - -.SH COMMAND LINE OPTIONS -These are the options that can appear on the command line. -.TP -.BI \-d\0 basename -Basename of .pbm file for saving decompressed planes. -.TP -.BI \-h -Print hex file offsets. -.TP -.BI \-o -Print file offsets. -.TP -.BI \-D\0 level -Set Debug level [0]. - -.SH EXAMPLES -Decode an Raster Object stream file created by foo2lava-wrapper -z1. - -.nf -.ft CW -$ foo2lava-wrapper -z1 testpage.ps | opldecode -h - 0: Event=StartOfJob; - 11: OSVersion=WindowsXP; - 25: DrvVersion=2.0.1410.0; - 3b: Resolution=1200x600; - 4f: RasterObject.Compression=JBIG; - 6d: Sides=OneSided; - 7c: MediaSize=custom_size_8.5x11in; - 9b: MediaType=plain; - ab: MediaInputTrayCheck=top; - c3: RasterObject.BitsPerPixel=1; - df: RasterObject.Planes=00FFFF,0,0,0,0,0,0; - 106: RasterObject.Width=9792; - 11e: RasterObject.Height=6400; - 137: RasterObject.Data#20= - - DL = 0, D = 0, P = 1, - = 0, XY = 9792 x 6400 - L0 = 128, MX = 0, MY = 0 - Order = 3 ILEAVE SMID - Options = 92 LRLTWO TPDON TPBON DPON - 50 stripes, 0 layers, 1 planes - 161: RasterObject.Data#32768= - 817a: RasterObject.Data#32768= - 10193: RasterObject.Data#3168= - 10e0b: RasterObject.Planes=FF00FF,0,0,0,0,0,0; - 10e32: RasterObject.Width=9792; - 10e4a: RasterObject.Height=6400; - 10e63: RasterObject.Data#20= - - DL = 0, D = 0, P = 1, - = 0, XY = 9792 x 6400 - L0 = 128, MX = 0, MY = 0 - Order = 3 ILEAVE SMID - Options = 92 LRLTWO TPDON TPBON DPON - 50 stripes, 0 layers, 1 planes - 10e8d: RasterObject.Data#32768= - 18ea6: RasterObject.Data#32768= - 20ebf: RasterObject.Data#19200= - 259d8: RasterObject.Planes=FFFF00,0,0,0,0,0,0; - 259ff: RasterObject.Width=9792; - 25a17: RasterObject.Height=6400; - 25a30: RasterObject.Data#20= - - DL = 0, D = 0, P = 1, - = 0, XY = 9792 x 6400 - L0 = 128, MX = 0, MY = 0 - Order = 3 ILEAVE SMID - Options = 92 LRLTWO TPDON TPBON DPON - 50 stripes, 0 layers, 1 planes - 25a5a: RasterObject.Data#32768= - 2da73: RasterObject.Data#32768= - 35a8c: RasterObject.Data#32768= - 3daa5: RasterObject.Data#7056= - 3f64d: RasterObject.Planes=000000,0,0,0,0,0,0; - 3f674: RasterObject.Width=9792; - 3f68c: RasterObject.Height=6400; - 3f6a5: RasterObject.Data#20= - - DL = 0, D = 0, P = 1, - = 0, XY = 9792 x 6400 - L0 = 128, MX = 0, MY = 0 - Order = 3 ILEAVE SMID - Options = 92 LRLTWO TPDON TPBON DPON - 50 stripes, 0 layers, 1 planes - 3f6cf: RasterObject.Data#32768= - 476e8: RasterObject.Data#17472= - 4bb41: Event=EndOfPage; - 4bb51: Event=EndOfJob; - -.ft P -.fi - -.SH FILES -.BR /usr/bin/opldecode -.SH SEE ALSO -.BR foo2lava-wrapper (1), -.BR foo2opl (1) -.SH "AUTHOR" -Rick Richardson -.br -http://foo2lava.rkkda.com/ -'\" -'\" -'\" -.em pdf_outline diff --git a/opldecode.1in b/opldecode.1in index 9706bb0..45d0544 100644 --- a/opldecode.1in +++ b/opldecode.1in @@ -33,11 +33,11 @@ Print file offsets. Set Debug level [0]. .SH EXAMPLES -Decode an Raster Object stream file created by foo2lava-wrapper -z1. +Decode an Raster Object stream file created by foo2lava-wrapper \-z1. .nf .ft CW -$ foo2lava-wrapper -z1 testpage.ps | opldecode -h +$ foo2lava-wrapper \-z1 testpage.ps | opldecode \-h 0: Event=StartOfJob; 11: OSVersion=WindowsXP; 25: DrvVersion=2.0.1410.0; @@ -53,7 +53,7 @@ $ foo2lava-wrapper -z1 testpage.ps | opldecode -h 11e: RasterObject.Height=6400; 137: RasterObject.Data#20= - DL = 0, D = 0, P = 1, - = 0, XY = 9792 x 6400 + DL = 0, D = 0, P = 1, \- = 0, XY = 9792 x 6400 L0 = 128, MX = 0, MY = 0 Order = 3 ILEAVE SMID Options = 92 LRLTWO TPDON TPBON DPON @@ -66,7 +66,7 @@ $ foo2lava-wrapper -z1 testpage.ps | opldecode -h 10e4a: RasterObject.Height=6400; 10e63: RasterObject.Data#20= - DL = 0, D = 0, P = 1, - = 0, XY = 9792 x 6400 + DL = 0, D = 0, P = 1, \- = 0, XY = 9792 x 6400 L0 = 128, MX = 0, MY = 0 Order = 3 ILEAVE SMID Options = 92 LRLTWO TPDON TPBON DPON @@ -79,7 +79,7 @@ $ foo2lava-wrapper -z1 testpage.ps | opldecode -h 25a17: RasterObject.Height=6400; 25a30: RasterObject.Data#20= - DL = 0, D = 0, P = 1, - = 0, XY = 9792 x 6400 + DL = 0, D = 0, P = 1, \- = 0, XY = 9792 x 6400 L0 = 128, MX = 0, MY = 0 Order = 3 ILEAVE SMID Options = 92 LRLTWO TPDON TPBON DPON @@ -93,7 +93,7 @@ $ foo2lava-wrapper -z1 testpage.ps | opldecode -h 3f68c: RasterObject.Height=6400; 3f6a5: RasterObject.Data#20= - DL = 0, D = 0, P = 1, - = 0, XY = 9792 x 6400 + DL = 0, D = 0, P = 1, \- = 0, XY = 9792 x 6400 L0 = 128, MX = 0, MY = 0 Order = 3 ILEAVE SMID Options = 92 LRLTWO TPDON TPBON DPON diff --git a/opldecode.c b/opldecode.c index 6aebd33..8a361f6 100644 --- a/opldecode.c +++ b/opldecode.c @@ -16,8 +16,8 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * along with this program; if not, see + * . * * Author: Rick Richardson b*/ diff --git a/osx-hotplug/osx-hplj-hotplug.1 b/osx-hotplug/osx-hplj-hotplug.1 deleted file mode 100644 index 484d622..0000000 --- a/osx-hotplug/osx-hplj-hotplug.1 +++ /dev/null @@ -1,41 +0,0 @@ -'\" t -'\" -'\" DO NOT EDIT! This file is generated from osx-hotplug/osx-hplj-hotplug.1in -'\" -.TH osx-hplj-hotplug 1 "Sun Jun 20 04:33:46 2010" "osx-hplj-hotplug 0.0" -'\" -'\" -'\" -.SH NAME -osx-hplj-hotplug - Daemon for downloading firmware files for Mac OS X -.SH SYNOPSIS -.B osx-hplj-hotplug -.RI [ options ] -.SH DESCRIPTION -.B osx-hplj-hotplug -is a daemon for Mac OS X which watches for -Hewlett-Packard LaserJet 1000, 1005, 1018, -1020, P1005, P1006, P1007, P1008, and P1505 being plugged in. -If so, then the firmware is downloaded to it. -.P -NOTE: this is not needed by Linux, which has a proper hotplug mechanism. -.P -Here is a \fB/etc/rc.local\fP start: - -.nf -# BEGIN osx-hplj-hotplug from foo2zjs - killall osx-hplj-hotplug - osx-hplj-hotplug >/tmp/osx-hplj-hotplug 2>&1 & -# END osx-hplj-hotplug from foo2zjs -.fi -.SH COMMAND LINE OPTIONS -.TP -.BI \-D\0 level -Set Debug level [0]. -.SH FILES -.BR /usr/share/foo2*/firmware/* -.SH SEE ALSO -.BR /etc/rc.local, -.SH "AUTHOR" -Rick Richardson -.br diff --git a/osx-hotplug/osx-hplj-hotplug.1in b/osx-hotplug/osx-hplj-hotplug.1in index 317c20f..cd27b0e 100644 --- a/osx-hotplug/osx-hplj-hotplug.1in +++ b/osx-hotplug/osx-hplj-hotplug.1in @@ -3,7 +3,7 @@ #include "../macros.man" #endif .SH NAME -osx-hplj-hotplug - Daemon for downloading firmware files for Mac OS X +osx-hplj-hotplug \- Daemon for downloading firmware files for Mac OS X .SH SYNOPSIS .B osx-hplj-hotplug .RI [ options ] @@ -31,7 +31,7 @@ Set Debug level [0]. .SH FILES .BR /usr/share/foo2*/firmware/* .SH SEE ALSO -.BR /etc/rc.local, +.BR /etc/rc.local .SH "AUTHOR" Rick Richardson .br diff --git a/osx-hotplug/osx-hplj-hotplug.m b/osx-hotplug/osx-hplj-hotplug.m index 70fed51..f9da358 100644 --- a/osx-hotplug/osx-hplj-hotplug.m +++ b/osx-hotplug/osx-hplj-hotplug.m @@ -16,8 +16,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +along with this program; if not, see +. */ diff --git a/printer-profile.1 b/printer-profile.1 deleted file mode 100644 index 7539de9..0000000 --- a/printer-profile.1 +++ /dev/null @@ -1,244 +0,0 @@ -'\" t -'\" -'\" DO NOT EDIT! This file is generated from printer-profile.1in -'\" -.TH printer-profile 1 "Sun May 26 18:25:20 2024" "printer-profile 0.0" -'\" -'\" -'\"========================================================================== -'\" STRINGS and MACROS -'\"========================================================================== -'\" -'\" Define strings for special characters that nroff doesn't have -'\" -'\" N.B. using .if cua to test for special characters did not work. -'\" -.if !'\*[.T]'ps' .ds ua up -.if '\*[.T]'ps' .ds ua \(ua -.if !'\*[.T]'ps' .ds da down -.if '\*[.T]'ps' .ds da \(da -.if !'\*[.T]'ps' .ds <- left -.if '\*[.T]'ps' .ds <- \(<- -.if !'\*[.T]'ps' .ds -> right -.if '\*[.T]'ps' .ds -> \(-> -'\" -'\" bx - box a Courier string for making keycaps -'\" -'\" N.B. this mess is to make the line drawing come out only -'\" if we are really generating postscript -'\" -.de bx -.ie !'\*[.T]'ps' \{\ -. RB [ \\$1 ]\\$2 -.\} -.el \{\ -. ie !r ps4html \{\ -'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul' -. ft CW -. nr par*bxw \w'\\$1'+.4m -\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\ -\Z'\h'.2m'\s-1\\$1\s+1'\ -\h'\\n[par*bxw]u'\\$2 -. ft P -. \} -. el \{\ -. RB [ \\$1 ]\\$2 -. \} -.\} -.. -'\" -'\" strings to set current color (null with old groff) -'\" -.if mred .ds red \m[red] -.if mgreen .ds green \m[green] -.if mblue .ds blue \m[blue] -.if mblack .ds black \m[black] -.if mblack .ds mP \mP -'\" -'\" fix for grotty + xterm. We call for orange, grotty outputs yellow, -'\" but xterm displays yellow as orange. The cycle is complete. -'\" -.if n .defcolor orange rgb #ffff00 -'\" -'\" color - set the current color (ignores request with old groff) -'\" -.de color -.if mred \m[\\$1]\c -.. -'\" -'\" colorword - colorize a word (ignored by old groff) -'\" -.de colorword -.ie m\\$1 \m[\\$1]\\$2\mP\c -.el \\$2\c -.. -'\" -'\" colbox - colorize a word in a filled box -'\" -.de colbox -.ie mred \M[\\$2]\ -\v'+.167v'\ -\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\ -\v'-.167v'\ -\m[\\$1]\\$3\mP\MP -.el \\$3\c -.. -'\" -'\" Macros for doing pdfmarks -'\" -.de specialps -.if '\*[.T]'ps' \\k_\X'ps: \\$*'\h'|\\n_u'\c -.. -'\" -'\" pdfmark PDFMARKCODE -'\" -.ds pdfmarks -.if d pdfmarks \{\ -.de pdfmark -. specialps exec [\\$1 pdfmark -.. -'\" -'\" pdfdest LINKNAME -'\" -.de pdfdest -.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST" -.. -'\" -'\" pdfbookmark COUNT LINKNAME STRING -'\" -.de pdfbookmark -. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT" -.. -'\" -'\" Define the SH and SS macros to save pdfmark information -'\" in "arrays" of numbers and strings. -'\" -.if !r rr_n \{\ -.nr rr_n 0 1 -.am SH -. nr rr_levels!\\n+[rr_n] 2 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.am SS -. nr rr_levels!\\n+[rr_n] 3 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.\} -'\" -'\" Called at the end of the document to generate the pdfmark outline -'\" -.de pdf_outline -.nr rr_levels!\\n+[rr_n] 1 -.nr rr_i 0 1 -.while \\n+[rr_i]<\\n[rr_n] \{\ -. nr rr_ip1 \\n[rr_i]+1 -. nr rr_count 0 -. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\ -. nr rr_j \\n[rr_i] 1 -. while \\n+[rr_j]<\\n[rr_n] \{\ -. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\ -. break -. \} -. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\ -. nr rr_count \\n[rr_count]+1 -. \} -. \} -. \} -. ds hhh \\*[rr_labels!\\n[rr_i]] -. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]" -.\} -.. -'\" -'\" Some postscript to make pdfmarks harmless on old interpreters... -'\" -.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse" -'\" -'\" Force display of Bookmarks in Acrobat when document is viewed. -'\" -.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW" -'\" -'\" Output the document info in pdfmarks -'\" -.pdfmark "\ - /Title (\*[an-title](\*[an-section])) \ - /Subject (\*[an-title] Manual Page) \ - /Author (Rick Richardson) \ - /Keywords (printing) \ - /Creator (groff \n(.x.\n(.y.\n(.Y -man) \ - /CreationDate (\*[an-extra1]) \ - /ModDate (\*[an-extra1]) \ - /DOCINFO" -\} -'\" -'\" The manual page name is only 1st level mark -'\" -.nr rr_levels!\n+[rr_n] 1 -.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section]) -.pdfdest Link\n[rr_n] -'\" -'\"========================================================================== -'\" MANUAL PAGE SOURCE -'\"========================================================================== -.SH NAME -printer-profile \- Profile using X-Rite ColorMunki and Argyll CMS -.SH SYNOPSIS -.B printer-profile -.RI [ options "] manuf model [rgb|cmyk] [patches] [ink-limit]" -.SH DESCRIPTION -.B printer-profile -prints a test chart, uses the ColorMunki instrument to scan it in, then -computes an ICM profile using the Argyll Color Management System. - -Manuf is "sam". Model is "clp-300", "clp-315", "clp-325" or "clp-365". -.br -Manuf is "hp". Model is "2600" or "cp1215". -.br -Manuf is "km". Model is "2300" or "2530". -.br -Manuf is "dell". Model is "1355". -.br - -"rgb" is the usual setting. "patches" is a multiple 196 per page. - -Edit the script for additional models. - -.SH OPTIONS - -b 1|2 Bits per pixel (1) - -r XRESxYRES Resolution. Default=''. () - -P rem-print Remote print (64-bit) machine, or none (amd) - -S rem-scan Remote scan (ColorMunki) machine, or none (mac) - -D lvl Debug level - -.SH EXAMPLES -Profile the Samsung clp-315: - -.nf -.ft CW -$ printer-profile sam 315 rgb 196 -.ft P -.fi - -.SH BUGS -gs 8.64 and before has problems with 32-bit machines and color profile -data. Don't use! - -You need Argyll_V1.5.1 or later. -.SH FILES -.BR /usr/bin/printer-profile, -.BR /usr/share/foo2*/icm/testing.icm -.SH SEE ALSO -firefox http://www.xritephoto.com/html/colormunkisplash.htm -.br -firefox http://www.argyllcms.com/ -.br -firefox http://www.argyllcms.com/Argyll_V1.5.1_src.zip -.SH "AUTHOR" -Rick Richardson -.br -http://foo2zjs.rkkda.com/ -'\" -'\" -'\" -.em pdf_outline diff --git a/printer-profile.1in b/printer-profile.1in index 0f52054..9328db4 100644 --- a/printer-profile.1in +++ b/printer-profile.1in @@ -29,11 +29,11 @@ Manuf is "dell". Model is "1355". Edit the script for additional models. .SH OPTIONS - -b 1|2 Bits per pixel (1) - -r XRESxYRES Resolution. Default=''. () - -P rem-print Remote print (64-bit) machine, or none (amd) - -S rem-scan Remote scan (ColorMunki) machine, or none (mac) - -D lvl Debug level + \-b 1|2 Bits per pixel (1) + \-r XRESxYRES Resolution. Default=''. () + \-P rem-print Remote print (64-bit) machine, or none (amd) + \-S rem-scan Remote scan (ColorMunki) machine, or none (mac) + \-D lvl Debug level .SH EXAMPLES Profile the Samsung clp-315: diff --git a/qpdldecode b/qpdldecode deleted file mode 100755 index 4fb5507..0000000 Binary files a/qpdldecode and /dev/null differ diff --git a/qpdldecode.1 b/qpdldecode.1 deleted file mode 100644 index 23a98aa..0000000 --- a/qpdldecode.1 +++ /dev/null @@ -1,308 +0,0 @@ -'\" t -'\" -'\" DO NOT EDIT! This file is generated from qpdldecode.1in -'\" -.TH qpdldecode 1 "Sun May 26 18:25:20 2024" "qpdldecode 0.0" -'\" -'\" -'\"========================================================================== -'\" STRINGS and MACROS -'\"========================================================================== -'\" -'\" Define strings for special characters that nroff doesn't have -'\" -'\" N.B. using .if cua to test for special characters did not work. -'\" -.if !'\*[.T]'ps' .ds ua up -.if '\*[.T]'ps' .ds ua \(ua -.if !'\*[.T]'ps' .ds da down -.if '\*[.T]'ps' .ds da \(da -.if !'\*[.T]'ps' .ds <- left -.if '\*[.T]'ps' .ds <- \(<- -.if !'\*[.T]'ps' .ds -> right -.if '\*[.T]'ps' .ds -> \(-> -'\" -'\" bx - box a Courier string for making keycaps -'\" -'\" N.B. this mess is to make the line drawing come out only -'\" if we are really generating postscript -'\" -.de bx -.ie !'\*[.T]'ps' \{\ -. RB [ \\$1 ]\\$2 -.\} -.el \{\ -. ie !r ps4html \{\ -'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul' -. ft CW -. nr par*bxw \w'\\$1'+.4m -\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\ -\Z'\h'.2m'\s-1\\$1\s+1'\ -\h'\\n[par*bxw]u'\\$2 -. ft P -. \} -. el \{\ -. RB [ \\$1 ]\\$2 -. \} -.\} -.. -'\" -'\" strings to set current color (null with old groff) -'\" -.if mred .ds red \m[red] -.if mgreen .ds green \m[green] -.if mblue .ds blue \m[blue] -.if mblack .ds black \m[black] -.if mblack .ds mP \mP -'\" -'\" fix for grotty + xterm. We call for orange, grotty outputs yellow, -'\" but xterm displays yellow as orange. The cycle is complete. -'\" -.if n .defcolor orange rgb #ffff00 -'\" -'\" color - set the current color (ignores request with old groff) -'\" -.de color -.if mred \m[\\$1]\c -.. -'\" -'\" colorword - colorize a word (ignored by old groff) -'\" -.de colorword -.ie m\\$1 \m[\\$1]\\$2\mP\c -.el \\$2\c -.. -'\" -'\" colbox - colorize a word in a filled box -'\" -.de colbox -.ie mred \M[\\$2]\ -\v'+.167v'\ -\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\ -\v'-.167v'\ -\m[\\$1]\\$3\mP\MP -.el \\$3\c -.. -'\" -'\" Macros for doing pdfmarks -'\" -.de specialps -.if '\*[.T]'ps' \\k_\X'ps: \\$*'\h'|\\n_u'\c -.. -'\" -'\" pdfmark PDFMARKCODE -'\" -.ds pdfmarks -.if d pdfmarks \{\ -.de pdfmark -. specialps exec [\\$1 pdfmark -.. -'\" -'\" pdfdest LINKNAME -'\" -.de pdfdest -.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST" -.. -'\" -'\" pdfbookmark COUNT LINKNAME STRING -'\" -.de pdfbookmark -. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT" -.. -'\" -'\" Define the SH and SS macros to save pdfmark information -'\" in "arrays" of numbers and strings. -'\" -.if !r rr_n \{\ -.nr rr_n 0 1 -.am SH -. nr rr_levels!\\n+[rr_n] 2 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.am SS -. nr rr_levels!\\n+[rr_n] 3 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.\} -'\" -'\" Called at the end of the document to generate the pdfmark outline -'\" -.de pdf_outline -.nr rr_levels!\\n+[rr_n] 1 -.nr rr_i 0 1 -.while \\n+[rr_i]<\\n[rr_n] \{\ -. nr rr_ip1 \\n[rr_i]+1 -. nr rr_count 0 -. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\ -. nr rr_j \\n[rr_i] 1 -. while \\n+[rr_j]<\\n[rr_n] \{\ -. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\ -. break -. \} -. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\ -. nr rr_count \\n[rr_count]+1 -. \} -. \} -. \} -. ds hhh \\*[rr_labels!\\n[rr_i]] -. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]" -.\} -.. -'\" -'\" Some postscript to make pdfmarks harmless on old interpreters... -'\" -.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse" -'\" -'\" Force display of Bookmarks in Acrobat when document is viewed. -'\" -.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW" -'\" -'\" Output the document info in pdfmarks -'\" -.pdfmark "\ - /Title (\*[an-title](\*[an-section])) \ - /Subject (\*[an-title] Manual Page) \ - /Author (Rick Richardson) \ - /Keywords (printing) \ - /Creator (groff \n(.x.\n(.y.\n(.Y -man) \ - /CreationDate (\*[an-extra1]) \ - /ModDate (\*[an-extra1]) \ - /DOCINFO" -\} -'\" -'\" The manual page name is only 1st level mark -'\" -.nr rr_levels!\n+[rr_n] 1 -.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section]) -.pdfdest Link\n[rr_n] -'\" -'\"========================================================================== -'\" MANUAL PAGE SOURCE -'\"========================================================================== -.SH NAME -qpdldecode \- Decode a QPDL stream into human readable form. -.SH SYNOPSIS -.B qpdldecode -.RI [ options "] <" qpdl-file -.SH DESCRIPTION -.B qpdldecode -decodes a QPDL stream into human readable form. -Only the JBIG compression format (0x13) is handled. -.P -An QPDL stream is the printer language used by the -Samsung CLP-300, CLP-600, CLX-3160 and the -Xerox Phaser 6110 -printers. - -.SH COMMAND LINE OPTIONS -These are the options that can appear on the command line. -.TP -.BI \-d\0 basename -Basename of .pbm file for saving decompressed planes. -.TP -.BI \-h -Print hex file offsets. -.TP -.BI \-o -Print file offsets. -.TP -.BI \-D\0 level -Set Debug level [0]. - -.SH EXAMPLES -Decode an QPDL stream file created by foo2qpdl. - -.nf -.ft CW - 0: \\033%-12345X@PJL DEFAULT SERVICEDATE=20070212 - 2c: @PJL SET USERNAME="Unknown" - 49: @PJL SET JOBNAME="testpage.pdf" - 6a: @PJL SET COLORMODE=COLOR - 84: @PJL SET PAPERTYPE = NORMAL - a1: @PJL ENTER LANGUAGE = QPDL - bd: RECTYPE 0x0 len=17 - res=600, copies=1, papersize=letter(0), w=2550, h=3300 - papersource=auto, unk=0, duplex=0:0, unk=0,2, unk=268(0x10c) - ce: RECTYPE 0xc len=68(0x44) - stripe=0, WB=1248(0x4e0), H=128(0x80), plane=4, comp=0x13, - len=56(0x38) - magic=0x39abcdef, len=20(0x14), unk=0,0,0,0,0,0, - checksum=0x356 - DL = 0, D = 0, P = 1, - = 0, XY = 9984 x 6400 - L0 = 6400, MX = 0, MY = 0 - Order = 0 - Options = 72 LRLTWO TPBON - 1 stripes, 0 layers, 1 planes - 112: RECTYPE 0xc len=68(0x44) - stripe=0, WB=1248(0x4e0), H=128(0x80), plane=1, comp=0x13, - len=56(0x38) - magic=0x39abcdef, len=20(0x14), unk=0,0,0,0,0,0, - checksum=0x356 - DL = 0, D = 0, P = 1, - = 0, XY = 9984 x 6400 - L0 = 6400, MX = 0, MY = 0 - Order = 0 - Options = 72 LRLTWO TPBON - 1 stripes, 0 layers, 1 planes - 156: RECTYPE 0xc len=68(0x44) - stripe=0, WB=1248(0x4e0), H=128(0x80), plane=2, comp=0x13, - len=56(0x38) - magic=0x39abcdef, len=20(0x14), unk=0,0,0,0,0,0, - checksum=0x356 - DL = 0, D = 0, P = 1, - = 0, XY = 9984 x 6400 - L0 = 6400, MX = 0, MY = 0 - Order = 0 - Options = 72 LRLTWO TPBON - 1 stripes, 0 layers, 1 planes - 19a: RECTYPE 0xc len=68(0x44) - stripe=0, WB=1248(0x4e0), H=128(0x80), plane=3, comp=0x13, - len=56(0x38) - magic=0x39abcdef, len=20(0x14), unk=0,0,0,0,0,0, - checksum=0x356 - DL = 0, D = 0, P = 1, - = 0, XY = 9984 x 6400 - L0 = 6400, MX = 0, MY = 0 - Order = 0 - Options = 72 LRLTWO TPBON - 1 stripes, 0 layers, 1 planes - 1de: RECTYPE 0xc len=77488(0x12eb0) - stripe=1, WB=1248(0x4e0), H=128(0x80), plane=1, comp=0x13, - len=77476(0x12ea4) - magic=0x39abcdef, len=77440(0x12e80), unk=2000000,0,0,0,0,0, - checksum=0x9326d7 - 1308e: RECTYPE 0xc len=77680(0x12f70) - stripe=1, WB=1248(0x4e0), H=128(0x80), plane=2, comp=0x13, - len=77668(0x12f64) - magic=0x39abcdef, len=77632(0x12f40), unk=2000000,0,0,0,0,0, - checksum=0x9367e5 - 25ffe: RECTYPE 0xc len=69232(0x10e70) - stripe=1, WB=1248(0x4e0), H=128(0x80), plane=3, comp=0x13, - len=69220(0x10e64) - magic=0x39abcdef, len=69184(0x10e40), unk=2000000,0,0,0,0,0, - checksum=0x83938a - 36e6e: RECTYPE 0xc len=45616(0xb230) - stripe=1, WB=1248(0x4e0), H=128(0x80), plane=4, comp=0x13, - len=45604(0xb224) - magic=0x39abcdef, len=45568(0xb200), unk=2000000,0,0,0,0,0, - checksum=0x58015d - 4209e: RECTYPE 0x1 len=3 - copies=1 - 420a1: RECTYPE 0x9 len=0 - 420a2: \\033%-12345X - -.ft P -.fi - -.SH FILES -.BR /usr/bin/qpdldecode -.SH SEE ALSO -.BR foo2qpdl-wrapper (1), -.BR foo2qpdl (1) -.SH "AUTHOR" -Rick Richardson -.br -http://foo2qpdl.rkkda.com/ -'\" -'\" -'\" -.em pdf_outline diff --git a/qpdldecode.1in b/qpdldecode.1in index d8b2f35..7f9804b 100644 --- a/qpdldecode.1in +++ b/qpdldecode.1in @@ -54,7 +54,7 @@ Decode an QPDL stream file created by foo2qpdl. len=56(0x38) magic=0x39abcdef, len=20(0x14), unk=0,0,0,0,0,0, checksum=0x356 - DL = 0, D = 0, P = 1, - = 0, XY = 9984 x 6400 + DL = 0, D = 0, P = 1, \- = 0, XY = 9984 x 6400 L0 = 6400, MX = 0, MY = 0 Order = 0 Options = 72 LRLTWO TPBON @@ -64,7 +64,7 @@ Decode an QPDL stream file created by foo2qpdl. len=56(0x38) magic=0x39abcdef, len=20(0x14), unk=0,0,0,0,0,0, checksum=0x356 - DL = 0, D = 0, P = 1, - = 0, XY = 9984 x 6400 + DL = 0, D = 0, P = 1, \- = 0, XY = 9984 x 6400 L0 = 6400, MX = 0, MY = 0 Order = 0 Options = 72 LRLTWO TPBON @@ -74,7 +74,7 @@ Decode an QPDL stream file created by foo2qpdl. len=56(0x38) magic=0x39abcdef, len=20(0x14), unk=0,0,0,0,0,0, checksum=0x356 - DL = 0, D = 0, P = 1, - = 0, XY = 9984 x 6400 + DL = 0, D = 0, P = 1, \- = 0, XY = 9984 x 6400 L0 = 6400, MX = 0, MY = 0 Order = 0 Options = 72 LRLTWO TPBON @@ -84,7 +84,7 @@ Decode an QPDL stream file created by foo2qpdl. len=56(0x38) magic=0x39abcdef, len=20(0x14), unk=0,0,0,0,0,0, checksum=0x356 - DL = 0, D = 0, P = 1, - = 0, XY = 9984 x 6400 + DL = 0, D = 0, P = 1, \- = 0, XY = 9984 x 6400 L0 = 6400, MX = 0, MY = 0 Order = 0 Options = 72 LRLTWO TPBON diff --git a/qpdldecode.c b/qpdldecode.c index d6336df..cac319d 100644 --- a/qpdldecode.c +++ b/qpdldecode.c @@ -16,8 +16,8 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * along with this program; if not, see + * . * * Author: Rick Richardson b*/ @@ -82,7 +82,7 @@ usage(void) "\n" " Decode a QPDL stream into human readable form.\n" "\n" -" A Quick Page Description Langauge (QPDL) is the printer language" +" A Quick Page Description language (QPDL) is the printer language" " used by some Samsung printers, such as the CLP-600n.\n" "\n" " Also known as SPLC." diff --git a/slxdecode b/slxdecode deleted file mode 100755 index 038595c..0000000 Binary files a/slxdecode and /dev/null differ diff --git a/slxdecode.1 b/slxdecode.1 deleted file mode 100644 index 0148201..0000000 --- a/slxdecode.1 +++ /dev/null @@ -1,285 +0,0 @@ -'\" t -'\" -'\" DO NOT EDIT! This file is generated from slxdecode.1in -'\" -.TH slxdecode 1 "Sun May 26 18:25:20 2024" "slxdecode 0.0" -'\" -'\" -'\"========================================================================== -'\" STRINGS and MACROS -'\"========================================================================== -'\" -'\" Define strings for special characters that nroff doesn't have -'\" -'\" N.B. using .if cua to test for special characters did not work. -'\" -.if !'\*[.T]'ps' .ds ua up -.if '\*[.T]'ps' .ds ua \(ua -.if !'\*[.T]'ps' .ds da down -.if '\*[.T]'ps' .ds da \(da -.if !'\*[.T]'ps' .ds <- left -.if '\*[.T]'ps' .ds <- \(<- -.if !'\*[.T]'ps' .ds -> right -.if '\*[.T]'ps' .ds -> \(-> -'\" -'\" bx - box a Courier string for making keycaps -'\" -'\" N.B. this mess is to make the line drawing come out only -'\" if we are really generating postscript -'\" -.de bx -.ie !'\*[.T]'ps' \{\ -. RB [ \\$1 ]\\$2 -.\} -.el \{\ -. ie !r ps4html \{\ -'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul' -. ft CW -. nr par*bxw \w'\\$1'+.4m -\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\ -\Z'\h'.2m'\s-1\\$1\s+1'\ -\h'\\n[par*bxw]u'\\$2 -. ft P -. \} -. el \{\ -. RB [ \\$1 ]\\$2 -. \} -.\} -.. -'\" -'\" strings to set current color (null with old groff) -'\" -.if mred .ds red \m[red] -.if mgreen .ds green \m[green] -.if mblue .ds blue \m[blue] -.if mblack .ds black \m[black] -.if mblack .ds mP \mP -'\" -'\" fix for grotty + xterm. We call for orange, grotty outputs yellow, -'\" but xterm displays yellow as orange. The cycle is complete. -'\" -.if n .defcolor orange rgb #ffff00 -'\" -'\" color - set the current color (ignores request with old groff) -'\" -.de color -.if mred \m[\\$1]\c -.. -'\" -'\" colorword - colorize a word (ignored by old groff) -'\" -.de colorword -.ie m\\$1 \m[\\$1]\\$2\mP\c -.el \\$2\c -.. -'\" -'\" colbox - colorize a word in a filled box -'\" -.de colbox -.ie mred \M[\\$2]\ -\v'+.167v'\ -\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\ -\v'-.167v'\ -\m[\\$1]\\$3\mP\MP -.el \\$3\c -.. -'\" -'\" Macros for doing pdfmarks -'\" -.de specialps -.if '\*[.T]'ps' \\k_\X'ps: \\$*'\h'|\\n_u'\c -.. -'\" -'\" pdfmark PDFMARKCODE -'\" -.ds pdfmarks -.if d pdfmarks \{\ -.de pdfmark -. specialps exec [\\$1 pdfmark -.. -'\" -'\" pdfdest LINKNAME -'\" -.de pdfdest -.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST" -.. -'\" -'\" pdfbookmark COUNT LINKNAME STRING -'\" -.de pdfbookmark -. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT" -.. -'\" -'\" Define the SH and SS macros to save pdfmark information -'\" in "arrays" of numbers and strings. -'\" -.if !r rr_n \{\ -.nr rr_n 0 1 -.am SH -. nr rr_levels!\\n+[rr_n] 2 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.am SS -. nr rr_levels!\\n+[rr_n] 3 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.\} -'\" -'\" Called at the end of the document to generate the pdfmark outline -'\" -.de pdf_outline -.nr rr_levels!\\n+[rr_n] 1 -.nr rr_i 0 1 -.while \\n+[rr_i]<\\n[rr_n] \{\ -. nr rr_ip1 \\n[rr_i]+1 -. nr rr_count 0 -. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\ -. nr rr_j \\n[rr_i] 1 -. while \\n+[rr_j]<\\n[rr_n] \{\ -. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\ -. break -. \} -. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\ -. nr rr_count \\n[rr_count]+1 -. \} -. \} -. \} -. ds hhh \\*[rr_labels!\\n[rr_i]] -. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]" -.\} -.. -'\" -'\" Some postscript to make pdfmarks harmless on old interpreters... -'\" -.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse" -'\" -'\" Force display of Bookmarks in Acrobat when document is viewed. -'\" -.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW" -'\" -'\" Output the document info in pdfmarks -'\" -.pdfmark "\ - /Title (\*[an-title](\*[an-section])) \ - /Subject (\*[an-title] Manual Page) \ - /Author (Rick Richardson) \ - /Keywords (printing) \ - /Creator (groff \n(.x.\n(.y.\n(.Y -man) \ - /CreationDate (\*[an-extra1]) \ - /ModDate (\*[an-extra1]) \ - /DOCINFO" -\} -'\" -'\" The manual page name is only 1st level mark -'\" -.nr rr_levels!\n+[rr_n] 1 -.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section]) -.pdfdest Link\n[rr_n] -'\" -'\"========================================================================== -'\" MANUAL PAGE SOURCE -'\"========================================================================== -.SH NAME -slxdecode \- Decode a SLX stream into human readable form. -.SH SYNOPSIS -.B slxdecode -.RI [ options "] <" slx-file -.SH DESCRIPTION -.B slxdecode -decodes a SLX stream into human readable form. -.P -A SLX stream is the printer language used by some Lexmark -printers, such as the C500. -.P -More information on the Software Imaging K.K. SLX stream can be found at: -.P -.RS -http://softwareimaging.com/products-services/sorcerer/index.asp -.RE - -.SH COMMAND LINE OPTIONS -These are the options that can appear on the command line. -.TP -.BI \-d\0 basename -Basename of .pbm file for saving decompressed planes. -.TP -.BI \-r\0 basename -Basename of .jbg file for saving raw planes -.TP -.BI \-h -Print hex file offsets. -.TP -.BI \-o -Print file offsets. -.TP -.BI \-D\0 level -Set Debug level [0]. - -.SH EXAMPLES -Decode an SLX file created by foo2slx. - -.nf -.ft CW -$ slxdecode < testpage.zm -SLX_MAGIC, 0x584c53a5 (SLX) -SLT_START_DOC, 12 items - SLI_PAGECOUNT, 4294967295 (0xffffffff) - SLI_DMDUPLEX, 0 (0x0) - SLI_DMCOLLATE, 0 (0x0) - SLI_0x3, 0 (0x0) - SLI_DISPLAY, 0 (0x0) - SLI_0x5, 0 (0x0) - SLI_0x6, 0 (0x0) - SLI_0x7, 1 (0x1) - SLI_0x8, 0 (0x0) - SLI_0x9, 0 (0x0) - SLI_COUNT, 1 (0x1) - SLI_DMCOLLATE, 0 (0x0) -SLT_START_PAGE, 16 items [Page 1] - SLI_DMPAPER, 6 (0x6) - SLI_CUSTOM_X, 0 (0x0) - SLI_CUSTOM_Y, 0 (0x0) - SLI_DMCOPIES, 1 (0x1) - SLI_DMDEFAULTSOURCE, 0 (0x0) - SLI_DMMEDIATYPE, 0 (0x0) - SLI_NBIE, 0 (0x0) - SLI_RESOLUTION_X, 600 (0x258) - SLI_RESOLUTION_Y, 600 (0x258) - SLI_OFFSET_X, 102 (0x66) - SLI_OFFSET_Y, 102 (0x66) - SLI_RASTER_X, 4896 (0x1320) - SLI_RASTER_Y, 6392 (0x18f8) - SLI_0x10d, 4896 (0x1320) - SLI_0x10e, 6392 (0x18f8) - SLI_0x10f, 1 (0x1) -SLT_JBIG_BIH, 0 items - Data: 20 bytes - DL = 0, D = 0, P = 1, - = 0, XY = 4896 x 6392 - L0 = 128, MX = 0, MY = 0 - Order = 0 - Options = 8 TPBON - 50 stripes, 0 layers, 1 planes -SLT_JBIG_BID, 0 items - Data: 116 bytes -SLT_END_JBIG, 0 items -SLT_END_PAGE, 0 items -SLT_END_DOC, 0 items -.ft P -.fi - -.SH FILES -.BR /usr/bin/slxdecode -.SH SEE ALSO -.BR foo2slx-wrapper (1), -.BR foo2slx (1), -.BR jbg2pbm (1) -.SH "AUTHOR" -Rick Richardson -.br -http://foo2slx.rkkda.com/ -'\" -'\" -'\" -.em pdf_outline diff --git a/slxdecode.1in b/slxdecode.1in index 7f9ebc5..30f24bc 100644 --- a/slxdecode.1in +++ b/slxdecode.1in @@ -80,7 +80,7 @@ SLT_START_PAGE, 16 items [Page 1] SLI_0x10f, 1 (0x1) SLT_JBIG_BIH, 0 items Data: 20 bytes - DL = 0, D = 0, P = 1, - = 0, XY = 4896 x 6392 + DL = 0, D = 0, P = 1, \- = 0, XY = 4896 x 6392 L0 = 128, MX = 0, MY = 0 Order = 0 Options = 8 TPBON diff --git a/slxdecode.c b/slxdecode.c index 069dead..a7f858a 100644 --- a/slxdecode.c +++ b/slxdecode.c @@ -16,8 +16,8 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * along with this program; if not, see + * . * * Author: Rick Richardson b*/ diff --git a/usb_printerid b/usb_printerid deleted file mode 100755 index 3879085..0000000 Binary files a/usb_printerid and /dev/null differ diff --git a/usb_printerid.1 b/usb_printerid.1 deleted file mode 100644 index 2db973a..0000000 --- a/usb_printerid.1 +++ /dev/null @@ -1,226 +0,0 @@ -'\" t -'\" -'\" DO NOT EDIT! This file is generated from usb_printerid.1in -'\" -.TH usb_printerid 1 "Sun May 26 18:25:20 2024" "usb_printerid 0.0" -'\" -'\" -'\"========================================================================== -'\" STRINGS and MACROS -'\"========================================================================== -'\" -'\" Define strings for special characters that nroff doesn't have -'\" -'\" N.B. using .if cua to test for special characters did not work. -'\" -.if !'\*[.T]'ps' .ds ua up -.if '\*[.T]'ps' .ds ua \(ua -.if !'\*[.T]'ps' .ds da down -.if '\*[.T]'ps' .ds da \(da -.if !'\*[.T]'ps' .ds <- left -.if '\*[.T]'ps' .ds <- \(<- -.if !'\*[.T]'ps' .ds -> right -.if '\*[.T]'ps' .ds -> \(-> -'\" -'\" bx - box a Courier string for making keycaps -'\" -'\" N.B. this mess is to make the line drawing come out only -'\" if we are really generating postscript -'\" -.de bx -.ie !'\*[.T]'ps' \{\ -. RB [ \\$1 ]\\$2 -.\} -.el \{\ -. ie !r ps4html \{\ -'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul' -. ft CW -. nr par*bxw \w'\\$1'+.4m -\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\ -\Z'\h'.2m'\s-1\\$1\s+1'\ -\h'\\n[par*bxw]u'\\$2 -. ft P -. \} -. el \{\ -. RB [ \\$1 ]\\$2 -. \} -.\} -.. -'\" -'\" strings to set current color (null with old groff) -'\" -.if mred .ds red \m[red] -.if mgreen .ds green \m[green] -.if mblue .ds blue \m[blue] -.if mblack .ds black \m[black] -.if mblack .ds mP \mP -'\" -'\" fix for grotty + xterm. We call for orange, grotty outputs yellow, -'\" but xterm displays yellow as orange. The cycle is complete. -'\" -.if n .defcolor orange rgb #ffff00 -'\" -'\" color - set the current color (ignores request with old groff) -'\" -.de color -.if mred \m[\\$1]\c -.. -'\" -'\" colorword - colorize a word (ignored by old groff) -'\" -.de colorword -.ie m\\$1 \m[\\$1]\\$2\mP\c -.el \\$2\c -.. -'\" -'\" colbox - colorize a word in a filled box -'\" -.de colbox -.ie mred \M[\\$2]\ -\v'+.167v'\ -\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\ -\v'-.167v'\ -\m[\\$1]\\$3\mP\MP -.el \\$3\c -.. -'\" -'\" Macros for doing pdfmarks -'\" -.de specialps -.if '\*[.T]'ps' \\k_\X'ps: \\$*'\h'|\\n_u'\c -.. -'\" -'\" pdfmark PDFMARKCODE -'\" -.ds pdfmarks -.if d pdfmarks \{\ -.de pdfmark -. specialps exec [\\$1 pdfmark -.. -'\" -'\" pdfdest LINKNAME -'\" -.de pdfdest -.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST" -.. -'\" -'\" pdfbookmark COUNT LINKNAME STRING -'\" -.de pdfbookmark -. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT" -.. -'\" -'\" Define the SH and SS macros to save pdfmark information -'\" in "arrays" of numbers and strings. -'\" -.if !r rr_n \{\ -.nr rr_n 0 1 -.am SH -. nr rr_levels!\\n+[rr_n] 2 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.am SS -. nr rr_levels!\\n+[rr_n] 3 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.\} -'\" -'\" Called at the end of the document to generate the pdfmark outline -'\" -.de pdf_outline -.nr rr_levels!\\n+[rr_n] 1 -.nr rr_i 0 1 -.while \\n+[rr_i]<\\n[rr_n] \{\ -. nr rr_ip1 \\n[rr_i]+1 -. nr rr_count 0 -. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\ -. nr rr_j \\n[rr_i] 1 -. while \\n+[rr_j]<\\n[rr_n] \{\ -. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\ -. break -. \} -. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\ -. nr rr_count \\n[rr_count]+1 -. \} -. \} -. \} -. ds hhh \\*[rr_labels!\\n[rr_i]] -. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]" -.\} -.. -'\" -'\" Some postscript to make pdfmarks harmless on old interpreters... -'\" -.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse" -'\" -'\" Force display of Bookmarks in Acrobat when document is viewed. -'\" -.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW" -'\" -'\" Output the document info in pdfmarks -'\" -.pdfmark "\ - /Title (\*[an-title](\*[an-section])) \ - /Subject (\*[an-title] Manual Page) \ - /Author (Rick Richardson) \ - /Keywords (printing) \ - /Creator (groff \n(.x.\n(.y.\n(.Y -man) \ - /CreationDate (\*[an-extra1]) \ - /ModDate (\*[an-extra1]) \ - /DOCINFO" -\} -'\" -'\" The manual page name is only 1st level mark -'\" -.nr rr_levels!\n+[rr_n] 1 -.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section]) -.pdfdest Link\n[rr_n] -'\" -'\"========================================================================== -'\" MANUAL PAGE SOURCE -'\"========================================================================== -.SH NAME -usb_printerid \- prints the ID of the printer on a USB port -.SH SYNOPSIS -.B usb_printerid -.RI [ options "] /dev/usb/lpNNN" -.SH DESCRIPTION -.B usb_printerid -prints the identification of the printer on a USB port using -the ioctl control -\fBLPIOC_GET_DEVICE_ID\fP. - -.SH EXAMPLES -Print the USB info before and after downloading the firmware. - -.nf -.ft CW -# usb_printerid /dev/usb/lp0 -GET_DEVICE_ID string: -MFG:Hewlett-Packard;MDL:HP LaserJet 1020;CMD:ACL;CLS:PRINTER;\e -DES:HP LaserJet 1020; - -# cp /usr/share/foo2zjs/firmware/sihp1020.dl /dev/usb/lp0 - -# usb_printerid /dev/usb/lp0 -GET_DEVICE_ID string: -MFG:Hewlett-Packard;MDL:HP LaserJet 1020;CMD:ACL;CLS:PRINTER;\e -DES:HP LaserJet 1020;FWVER:20050309; -.ft P -.fi - -.SH FILES -.BR /usr/bin/usb_printerid, -.BR /usr/share/foo2*/firmware/* -.SH SEE ALSO -.BR arm2hpdl (1) -.SH "AUTHOR" -Rick Richardson -.br -http://foo2zjs.rkkda.com/ -'\" -'\" -'\" -.em pdf_outline diff --git a/xqxdecode b/xqxdecode deleted file mode 100755 index e2c2b21..0000000 Binary files a/xqxdecode and /dev/null differ diff --git a/xqxdecode.1 b/xqxdecode.1 deleted file mode 100644 index 842054b..0000000 --- a/xqxdecode.1 +++ /dev/null @@ -1,287 +0,0 @@ -'\" t -'\" -'\" DO NOT EDIT! This file is generated from xqxdecode.1in -'\" -.TH xqxdecode 1 "Sun May 26 18:25:20 2024" "xqxdecode 0.0" -'\" -'\" -'\"========================================================================== -'\" STRINGS and MACROS -'\"========================================================================== -'\" -'\" Define strings for special characters that nroff doesn't have -'\" -'\" N.B. using .if cua to test for special characters did not work. -'\" -.if !'\*[.T]'ps' .ds ua up -.if '\*[.T]'ps' .ds ua \(ua -.if !'\*[.T]'ps' .ds da down -.if '\*[.T]'ps' .ds da \(da -.if !'\*[.T]'ps' .ds <- left -.if '\*[.T]'ps' .ds <- \(<- -.if !'\*[.T]'ps' .ds -> right -.if '\*[.T]'ps' .ds -> \(-> -'\" -'\" bx - box a Courier string for making keycaps -'\" -'\" N.B. this mess is to make the line drawing come out only -'\" if we are really generating postscript -'\" -.de bx -.ie !'\*[.T]'ps' \{\ -. RB [ \\$1 ]\\$2 -.\} -.el \{\ -. ie !r ps4html \{\ -'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul' -. ft CW -. nr par*bxw \w'\\$1'+.4m -\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\ -\Z'\h'.2m'\s-1\\$1\s+1'\ -\h'\\n[par*bxw]u'\\$2 -. ft P -. \} -. el \{\ -. RB [ \\$1 ]\\$2 -. \} -.\} -.. -'\" -'\" strings to set current color (null with old groff) -'\" -.if mred .ds red \m[red] -.if mgreen .ds green \m[green] -.if mblue .ds blue \m[blue] -.if mblack .ds black \m[black] -.if mblack .ds mP \mP -'\" -'\" fix for grotty + xterm. We call for orange, grotty outputs yellow, -'\" but xterm displays yellow as orange. The cycle is complete. -'\" -.if n .defcolor orange rgb #ffff00 -'\" -'\" color - set the current color (ignores request with old groff) -'\" -.de color -.if mred \m[\\$1]\c -.. -'\" -'\" colorword - colorize a word (ignored by old groff) -'\" -.de colorword -.ie m\\$1 \m[\\$1]\\$2\mP\c -.el \\$2\c -.. -'\" -'\" colbox - colorize a word in a filled box -'\" -.de colbox -.ie mred \M[\\$2]\ -\v'+.167v'\ -\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\ -\v'-.167v'\ -\m[\\$1]\\$3\mP\MP -.el \\$3\c -.. -'\" -'\" Macros for doing pdfmarks -'\" -.de specialps -.if '\*[.T]'ps' \\k_\X'ps: \\$*'\h'|\\n_u'\c -.. -'\" -'\" pdfmark PDFMARKCODE -'\" -.ds pdfmarks -.if d pdfmarks \{\ -.de pdfmark -. specialps exec [\\$1 pdfmark -.. -'\" -'\" pdfdest LINKNAME -'\" -.de pdfdest -.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST" -.. -'\" -'\" pdfbookmark COUNT LINKNAME STRING -'\" -.de pdfbookmark -. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT" -.. -'\" -'\" Define the SH and SS macros to save pdfmark information -'\" in "arrays" of numbers and strings. -'\" -.if !r rr_n \{\ -.nr rr_n 0 1 -.am SH -. nr rr_levels!\\n+[rr_n] 2 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.am SS -. nr rr_levels!\\n+[rr_n] 3 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.\} -'\" -'\" Called at the end of the document to generate the pdfmark outline -'\" -.de pdf_outline -.nr rr_levels!\\n+[rr_n] 1 -.nr rr_i 0 1 -.while \\n+[rr_i]<\\n[rr_n] \{\ -. nr rr_ip1 \\n[rr_i]+1 -. nr rr_count 0 -. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\ -. nr rr_j \\n[rr_i] 1 -. while \\n+[rr_j]<\\n[rr_n] \{\ -. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\ -. break -. \} -. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\ -. nr rr_count \\n[rr_count]+1 -. \} -. \} -. \} -. ds hhh \\*[rr_labels!\\n[rr_i]] -. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]" -.\} -.. -'\" -'\" Some postscript to make pdfmarks harmless on old interpreters... -'\" -.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse" -'\" -'\" Force display of Bookmarks in Acrobat when document is viewed. -'\" -.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW" -'\" -'\" Output the document info in pdfmarks -'\" -.pdfmark "\ - /Title (\*[an-title](\*[an-section])) \ - /Subject (\*[an-title] Manual Page) \ - /Author (Rick Richardson) \ - /Keywords (printing) \ - /Creator (groff \n(.x.\n(.y.\n(.Y -man) \ - /CreationDate (\*[an-extra1]) \ - /ModDate (\*[an-extra1]) \ - /DOCINFO" -\} -'\" -'\" The manual page name is only 1st level mark -'\" -.nr rr_levels!\n+[rr_n] 1 -.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section]) -.pdfdest Link\n[rr_n] -'\" -'\"========================================================================== -'\" MANUAL PAGE SOURCE -'\"========================================================================== -.SH NAME -xqxdecode \- Decode a XQX stream into human readable form. -.SH SYNOPSIS -.B xqxdecode -.RI [ options "] <" xqx-file -.SH DESCRIPTION -.B xqxdecode -decodes a XQX stream into human readable form. -.P -An XQX stream is the printer language used by some HP LaserJet -printers, such as the HP LaserJet M1005 (MFP). - -.SH COMMAND LINE OPTIONS -These are the options that can appear on the command line. -.TP -.BI \-d\0 basename -Basename of .pbm file for saving decompressed planes. -.TP -.BI \-h -Print hex file offsets. -.TP -.BI \-o -Print file offsets. -.TP -.BI \-D\0 level -Set Debug level [0]. - -.SH EXAMPLES -Decode an XQX stream file created by foo2xqx. - -.nf -.ft CW -$ xqxdecode -h < testpage.xm - 0: \\033%-12345X@PJL JOB - 12: @PJL SET JAMRECOVERY=OFF - 2b: @PJL SET DENSITY=3 - 3e: @PJL SET ECONOMODE=OFF - 55: @PJL SET RET=MEDIUM - 69: @PJL INFO STATUS - 7a: @PJL USTATUS DEVICE = ON - 93: @PJL USTATUS JOB = ON - a9: @PJL USTATUS PAGE = ON - c0: @PJL USTATUS TIMED = 30 - 10c: @PJL SET JOBATTR="JobAttr4=20061118160242" - 10c: XQX_MAGIC, 0x5851582c (,XQX) - 110: XQX_START_DOC(1), 7 items - 118: XQXI_0x80000000, 84 (0x54) - 124: XQXI_0x10000005, 1 (0x1) - 130: XQXI_0x10000001, 0 (0x0) - 13c: XQXI_DMDUPLEX, 0 (0x0) - 148: XQXI_0x10000000, 0 (0x0) - 154: XQXI_0x10000003, 1 (0x1) - 160: XQXI_END, 3735928559 (0xdeadbeef) - 16c: XQX_START_PAGE(3), 15 items [Page 1] - 174: XQXI_0x80000000, 180 (0xb4) - 180: XQXI_0x20000005, 1 (0x1) - 18c: XQXI_DMDEFAULTSOURCE, 7 (0x7) - 198: XQXI_DMMEDIATYPE, 1 (0x1) - 1a4: XQXI_0x20000007, 1 (0x1) - 1b0: XQXI_RESOLUTION_X, 600 (0x258) - 1bc: XQXI_RESOLUTION_Y, 600 (0x258) - 1c8: XQXI_RASTER_X, 9856 (0x2680) - 1d4: XQXI_RASTER_Y, 6432 (0x1920) - 1e0: XQXI_VIDEO_BPP, 2 (0x2) - 1ec: XQXI_VIDEO_X, 4923 (0x133b) - 1f8: XQXI_VIDEO_Y, 6432 (0x1920) - 204: XQXI_ECONOMODE, 0 (0x0) - 210: XQXI_DMPAPER, 1 (0x1) - 21c: XQXI_END, 3735928559 (0xdeadbeef) - 228: XQX_START_PLANE(5), 4 items - 230: XQXI_0x80000000, 64 (0x40) - 23c: XQXI_0x40000000, 0 (0x0) - 248: XQXI_BIH(0x40000002) - DL = 0, D = 0, P = 1, - = 0, XY = 9856 x 6432 - L0 = 128, MX = 16, MY = 0 - Order = 3 ILEAVE SMID - Options = 92 LRLTWO TPDON TPBON DPON - 51 stripes, 0 layers, 1 planes - - 264: XQXI_END, 3735928559 (0xdeadbeef) - 270: XQX_JBIG(7), 110 items - 2e6: XQX_END_PLANE(6), 0 items - 2ee: XQX_END_PAGE(4), 0 items - 2f6: XQX_END_DOC(2), 0 items -Total size: 110 bytes - 0: \\033%-12345X@PJL EOJ - 12: \\033%-12345X - -.ft P -.fi - -.SH FILES -.BR /usr/bin/xqxdecode -.SH SEE ALSO -.BR foo2xqx-wrapper (1), -.BR foo2xqx (1) -.SH "AUTHOR" -Rick Richardson -.br -http://foo2xqx.rkkda.com/ -'\" -'\" -'\" -.em pdf_outline diff --git a/xqxdecode.1in b/xqxdecode.1in index 488d192..fc32d76 100644 --- a/xqxdecode.1in +++ b/xqxdecode.1in @@ -37,7 +37,7 @@ Decode an XQX stream file created by foo2xqx. .nf .ft CW -$ xqxdecode -h < testpage.xm +$ xqxdecode \-h < testpage.xm 0: \\033%-12345X@PJL JOB 12: @PJL SET JAMRECOVERY=OFF 2b: @PJL SET DENSITY=3 @@ -78,7 +78,7 @@ $ xqxdecode -h < testpage.xm 230: XQXI_0x80000000, 64 (0x40) 23c: XQXI_0x40000000, 0 (0x0) 248: XQXI_BIH(0x40000002) - DL = 0, D = 0, P = 1, - = 0, XY = 9856 x 6432 + DL = 0, D = 0, P = 1, \- = 0, XY = 9856 x 6432 L0 = 128, MX = 16, MY = 0 Order = 3 ILEAVE SMID Options = 92 LRLTWO TPDON TPBON DPON diff --git a/zjsdecode b/zjsdecode deleted file mode 100755 index 5cba7e3..0000000 Binary files a/zjsdecode and /dev/null differ diff --git a/zjsdecode.1 b/zjsdecode.1 deleted file mode 100644 index 52d5323..0000000 --- a/zjsdecode.1 +++ /dev/null @@ -1,281 +0,0 @@ -'\" t -'\" -'\" DO NOT EDIT! This file is generated from zjsdecode.1in -'\" -.TH zjsdecode 1 "Sun May 26 18:25:20 2024" "zjsdecode 0.0" -'\" -'\" -'\"========================================================================== -'\" STRINGS and MACROS -'\"========================================================================== -'\" -'\" Define strings for special characters that nroff doesn't have -'\" -'\" N.B. using .if cua to test for special characters did not work. -'\" -.if !'\*[.T]'ps' .ds ua up -.if '\*[.T]'ps' .ds ua \(ua -.if !'\*[.T]'ps' .ds da down -.if '\*[.T]'ps' .ds da \(da -.if !'\*[.T]'ps' .ds <- left -.if '\*[.T]'ps' .ds <- \(<- -.if !'\*[.T]'ps' .ds -> right -.if '\*[.T]'ps' .ds -> \(-> -'\" -'\" bx - box a Courier string for making keycaps -'\" -'\" N.B. this mess is to make the line drawing come out only -'\" if we are really generating postscript -'\" -.de bx -.ie !'\*[.T]'ps' \{\ -. RB [ \\$1 ]\\$2 -.\} -.el \{\ -. ie !r ps4html \{\ -'\" \(br\|\s-1\f(CB\\$1\fP\s+1\|\(br\l'|0\(rn'\l'|0\(ul' -. ft CW -. nr par*bxw \w'\\$1'+.4m -\Z'\v'.25m'\D'l 0 -1m'\D'l \\n[par*bxw]u 0'\D'l 0 1m'\D'l -\\n[par*bxw]u 0''\ -\Z'\h'.2m'\s-1\\$1\s+1'\ -\h'\\n[par*bxw]u'\\$2 -. ft P -. \} -. el \{\ -. RB [ \\$1 ]\\$2 -. \} -.\} -.. -'\" -'\" strings to set current color (null with old groff) -'\" -.if mred .ds red \m[red] -.if mgreen .ds green \m[green] -.if mblue .ds blue \m[blue] -.if mblack .ds black \m[black] -.if mblack .ds mP \mP -'\" -'\" fix for grotty + xterm. We call for orange, grotty outputs yellow, -'\" but xterm displays yellow as orange. The cycle is complete. -'\" -.if n .defcolor orange rgb #ffff00 -'\" -'\" color - set the current color (ignores request with old groff) -'\" -.de color -.if mred \m[\\$1]\c -.. -'\" -'\" colorword - colorize a word (ignored by old groff) -'\" -.de colorword -.ie m\\$1 \m[\\$1]\\$2\mP\c -.el \\$2\c -.. -'\" -'\" colbox - colorize a word in a filled box -'\" -.de colbox -.ie mred \M[\\$2]\ -\v'+.167v'\ -\D'P 0 -0.9v \w'\\$3'u 0 0 +0.9v -\w'\\$3'u 0'\ -\v'-.167v'\ -\m[\\$1]\\$3\mP\MP -.el \\$3\c -.. -'\" -'\" Macros for doing pdfmarks -'\" -.de specialps -.if '\*[.T]'ps' \\k_\X'ps: \\$*'\h'|\\n_u'\c -.. -'\" -'\" pdfmark PDFMARKCODE -'\" -.ds pdfmarks -.if d pdfmarks \{\ -.de pdfmark -. specialps exec [\\$1 pdfmark -.. -'\" -'\" pdfdest LINKNAME -'\" -.de pdfdest -.pdfmark "/Dest /\\$1 /View [/XYZ -5 PL null] /DEST" -.. -'\" -'\" pdfbookmark COUNT LINKNAME STRING -'\" -.de pdfbookmark -. pdfmark "/View [/XYZ 44 730 1.0] /Count \\$1 /Dest /\\$2 /Title (\\$3) /OUT" -.. -'\" -'\" Define the SH and SS macros to save pdfmark information -'\" in "arrays" of numbers and strings. -'\" -.if !r rr_n \{\ -.nr rr_n 0 1 -.am SH -. nr rr_levels!\\n+[rr_n] 2 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.am SS -. nr rr_levels!\\n+[rr_n] 3 -. ds rr_labels!\\n[rr_n] \\$* -. pdfdest Link\\n[rr_n] -.. -.\} -'\" -'\" Called at the end of the document to generate the pdfmark outline -'\" -.de pdf_outline -.nr rr_levels!\\n+[rr_n] 1 -.nr rr_i 0 1 -.while \\n+[rr_i]<\\n[rr_n] \{\ -. nr rr_ip1 \\n[rr_i]+1 -. nr rr_count 0 -. if \\n[rr_levels!\\n[rr_ip1]]>\\n[rr_levels!\\n[rr_i]] \{\ -. nr rr_j \\n[rr_i] 1 -. while \\n+[rr_j]<\\n[rr_n] \{\ -. if \\n[rr_levels!\\n[rr_j]]<=\\n[rr_levels!\\n[rr_i]] \{\ -. break -. \} -. if \\n[rr_levels!\\n[rr_j]]==(\\n[rr_levels!\\n[rr_i]]+1) \{\ -. nr rr_count \\n[rr_count]+1 -. \} -. \} -. \} -. ds hhh \\*[rr_labels!\\n[rr_i]] -. pdfbookmark -\\n[rr_count] Link\\n[rr_i] "\\*[hhh]" -.\} -.. -'\" -'\" Some postscript to make pdfmarks harmless on old interpreters... -'\" -.specialps "def /pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse" -'\" -'\" Force display of Bookmarks in Acrobat when document is viewed. -'\" -.pdfmark "[/PageMode /UseOutlines /Page 1 /View [/XYZ null null null] /DOCVIEW" -'\" -'\" Output the document info in pdfmarks -'\" -.pdfmark "\ - /Title (\*[an-title](\*[an-section])) \ - /Subject (\*[an-title] Manual Page) \ - /Author (Rick Richardson) \ - /Keywords (printing) \ - /Creator (groff \n(.x.\n(.y.\n(.Y -man) \ - /CreationDate (\*[an-extra1]) \ - /ModDate (\*[an-extra1]) \ - /DOCINFO" -\} -'\" -'\" The manual page name is only 1st level mark -'\" -.nr rr_levels!\n+[rr_n] 1 -.ds rr_labels!\n[rr_n] \*[an-title](\*[an-section]) -.pdfdest Link\n[rr_n] -'\" -'\"========================================================================== -'\" MANUAL PAGE SOURCE -'\"========================================================================== -.SH NAME -zjsdecode \- Decode a ZjStream into human readable form. -.SH SYNOPSIS -.B zjsdecode -.RI [ options "] <" zjs-file -.SH DESCRIPTION -.B zjsdecode -decodes a ZjStream into human readable form. -.P -A ZjStream is the printer language used by some Minolta/QMS and -HP printers, such as the 2300DL and LJ-1000. -.P -More information on Zenographics ZjStream can be found at: -.P -.RS -http://ddk.zeno.com -.RE - -.SH COMMAND LINE OPTIONS -These are the options that can appear on the command line. -.TP -.BI \-d\0 basename -Basename of .pbm file for saving decompressed planes. -.TP -.BI \-r\0 basename -Basename of .jbg file for saving raw planes -.TP -.BI \-h -Print hex file offsets. -.TP -.BI \-o -Print file offsets. -.TP -.BI \-p -Don't do 4 byte padding -.TP -.BI \-D\0 level -Set Debug level [0]. - -.SH EXAMPLES -Decode an ZjStream file created by foo2zjs. - -.nf -.ft CW -$ zjsdecode < testpage.zm -ZJT_START_DOC, 3 items - ZJI_PAGECOUNT, 0 (0x0) - ZJI_DMDUPLEX, 1 (0x1) - ZJI_QUANTITY, 1 (0x1) -ZJT_START_PAGE, 17 items - ZJI_0x17, 0 (0x0) - ZJI_0x16, 1 (0x1) - ZJI_VIDEO_X, 10200 (0x27d8) - ZJI_VIDEO_Y, 6600 (0x19c8) - ZJI_VIDEO_BPP, 1 (0x1) - ZJI_RASTER_X, 10200 (0x27d8) - ZJI_RASTER_Y, 6600 (0x19c8) - ZJI_OFFSET_X, 0 (0x0) - ZJI_OFFSET_Y, 0 (0x0) - ZJI_NBIE, 1 (0x1) - ZJI_RESOLUTION_X, 1200 (0x4b0) - ZJI_RESOLUTION_Y, 600 (0x258) - ZJI_DMDEFAULTSOURCE, 7 (0x7) - ZJI_DMCOPIES, 1 (0x1) - ZJI_DMPAPER, 1 (0x1) - ZJI_DMMEDIATYPE, 1 (0x1) - ZJI_MINOLTA_PAGE_NUMBER, 1 (0x1) -ZJT_JBIG_BIH, 0 items - Data: 20 bytes - DL = 0, D = 0, P = 1, - = 0, XY = 10200 x 6600 - L0 = 128, MX = 16, MY = 0 - Order = 3 ILEAVE SMID - Options = 92 LRLTWO TPDON TPBON DPON - 52 stripes, 0 layers, 1 planes -ZJT_JBIG_BID, 0 items - Data: 65536 bytes -ZJT_JBIG_BID, 0 items - Data: 29120 bytes -ZJT_END_JBIG, 0 items -ZJT_END_PAGE, 0 items -ZJT_END_DOC, 0 items -.ft P -.fi - -.SH FILES -.BR /usr/bin/zjsdecode -.SH SEE ALSO -.BR foo2zjs-wrapper (1), -.BR foo2zjs (1), -.BR jbg2pbm (1) -.SH "AUTHOR" -Rick Richardson -.br -http://foo2zjs.rkkda.com/ -'\" -'\" -'\" -.em pdf_outline diff --git a/zjsdecode.1in b/zjsdecode.1in index ea6c443..567f840 100644 --- a/zjsdecode.1in +++ b/zjsdecode.1in @@ -74,7 +74,7 @@ ZJT_START_PAGE, 17 items ZJI_MINOLTA_PAGE_NUMBER, 1 (0x1) ZJT_JBIG_BIH, 0 items Data: 20 bytes - DL = 0, D = 0, P = 1, - = 0, XY = 10200 x 6600 + DL = 0, D = 0, P = 1, \- = 0, XY = 10200 x 6600 L0 = 128, MX = 16, MY = 0 Order = 3 ILEAVE SMID Options = 92 LRLTWO TPDON TPBON DPON diff --git a/zjsdecode.c b/zjsdecode.c index 05ac22d..5c0fce6 100644 --- a/zjsdecode.c +++ b/zjsdecode.c @@ -16,8 +16,8 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + * along with this program; if not, see + * . * * Author: Rick Richardson b*/