[cups.general] Adding PJL commands in front of Postscript output

Kevin Shanahan kmshanah at ucwb.org.au
Thu Apr 26 16:18:46 PDT 2007


Hi,

I'm trying to solve a problem printing to a Toshiba eStudio 351c copier
using the CUPS for Windows drivers. Normal postscript printing works
fine, but there are problems when trying to use the copier's department
codes to restrict the users that can print in colour vs. b&w.

Basically, the copier does not recognise when a document is colour or
not, so just assumes everything is in colour. When comparing the output
of the Toshiba Windows PS3 driver to the CUPS driver, the Toshiba driver
prepends a number of PJL commands to the job.

For CUPS, we're using the PPD file from here:
  http://www.eid.toshiba.com.au/driver_es281c-351c-451c.asp
  http://www.eid.toshiba.com.au/drivers/281c-351c-451c/Unix%20Filters_v2.0/EST4511_451c_CUPS_205.gz

I've attached the driver output from simple document to show the
differences between the two drivers. I'm wondering if there's any way to
enhance this PPD to enable CUPS to generate the same PJL commands as the
Toshiba driver spits out?

Then again, I may be on the wrong track altogether, as there's a lot
more difference between the files than just that. Any pointers
appreciated.

Regards,
Kevin.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ccs-cups.prn
Type: application/postscript
Size: 80748 bytes
Desc: not available
URL: <https://lists.cups.org/pipermail/cups/attachments/20070426/f83ed0a6/attachment-0001.ai>
-------------- next part --------------
%-12345X at PJL COMMENT TOSHIBA e-STUDIO451cSeries PSL 10.20
@PJL JOB NAME="Microsoft Word - Document1"
@PJL COMMENT DSSC PRINT ORIENTATION=0
@PJL COMMENT DSSC PRINT COLLATE=1
@PJL COMMENT DSSC PRINT ALTERNATION=0
@PJL COMMENT DSSC PRINT RENDERMODE=GRAYSCALE
@PJL COMMENT DSSC PRINT STAPLING=0
@PJL COMMENT DSSC PRINT HOLEPUNCH=0
@PJL COMMENT DSSC PRINT DUPLEX=0
@PJL COMMENT DSSC PRINT SHEETORIENTATION=0
@PJL SET OUTBIN=OPTIONALOUTBIN2
@PJL COMMENT DSSC PRINT PRINTMODE=NORMAL
@PJL COMMENT DSSC PRINT TONERSAVE=0
@PJL COMMENT DSSC PRINT WHITEPAPER=0
@PJL COMMENT DSSC PRINT BLACKOVERPRINT=0
@PJL COMMENT DSSC PRINT PUREBLACK=0
@PJL COMMENT DSSC PRINT SMOOTHING=1
@PJL COMMENT DSSC PRINT SCREENTYPE=AUTO
@PJL COMMENT DSSC PRINT PUREGRAY=0
@PJL COMMENT DSSC PRINT XYRESOLUTION=600x600
@PJL COMMENT DSSC PRINT THINLINELIMIT=0
@PJL COMMENT DSSC PRINT CERTIFIED=1
@PJL COMMENT DSSC PRINT ACCESSCODE=
@PJL COMMENT DSSC PRINT SUBMISSIONLOC=127.0.0.1
@PJL COMMENT DSSC PRINT USERLOGIN=kmshanah
@PJL COMMENT DSSC PRINT TIME=1177570807
@PJL COMMENT DSSC PRINT SC=5
@PJL COMMENT DSSC PRINT VERSIONNUMBER=e-STUDIO451cSeries PSL3 2.5.38.0
@PJL COMMENT DSSC PRINT CHARCODE=CP1252
@PJL SET RESOLUTION=600
@PJL COMMENT DSSC PRINT SUBMISSIONID=46304DF7-6C30-3AA-3C33-36A65FC6D120
@PJL COMMENT DSSC PRINT NUPCOUNT=1
@PJL ENTER LANGUAGE=POSTSCRIPT
%!PS-Adobe-3.0
%%Title: Microsoft Word - Document1
%%Creator: GSPS W2K 10.20
%%CreationDate: 04/26/2007 16:30:07
%%Pages: (atend)
%%PageOrder: Special
%%LanguageLevel: 3
%%DocumentData: Clean8Bit
%%EndComments
%%BeginProlog
%%BeginResource: procset GSPS_error 1.0 0
/nl{currentpoint exch pop 100 exch 10 sub moveto}def errordict begin
/handleerror{showpage 100 720 moveto/Courier findfont 10 scalefont setfont
(ERROR: )show errordict begin $error begin errorname =string cvs show
nl(OFFENDING COMMAND: )show/command load =string cvs show nl
nl(OPERAND STACK: )show $error/ostack known{ostack aload length{=string
cvs nl show}repeat}if end end showpage stop}bind def end
%%EndResource
%%BeginResource: procset GSPS_header 2.0 0
userdict /GSdict 200 dict dup begin put/bd{bind def}bind def/d/def load def
/,/load load d/$/roll , d/~/exch , d/S/show , d/xS/xshow , d/yS/yshow , d
/xyS/xyshow , d/m/moveto , d/l/rlineto , d/np/newpath , d/cp/closepath , d
/sj/setlinejoin , d/sd/setdash , d/sw/setlinewidth , d/sc/setlinecap , d
/ff/findfont , d/sf/setfont , d/sg/setgray , d/rgb/setrgbcolor , d/^/index , d
/:/gsave , d/;/grestore , d/rf/rectfill , d/crs{cliprestore}bd/ed{~ d}bd
/RMF{ff ~ makefont def}bd/rec{m 1 ^ 0 l 0 ~ l neg 0 l cp}bd/rc{; : rectclip}bd
/rc3{crs rectclip}bd/s{: stroke ;}bd/eof{: eofill ;}bd/f{: fill ;}bd
/MF{~ selectfont}bd/EA{1 ^ 0/G0 put 4 string 1 1 4 -1 ${3 copy neg ~ cvs dup
0 71 put cvn 3 -1 $ ~ put}for pop}bd userdict begin/B{pop pop pop pop}bd
/max{2 copy lt{~}if pop}bd/min{2 copy gt{~}if pop}bd /iclip/initclip , def end
%%EndResource
%%EndProlog
%%BeginSetup
<</DeferredMediaSelection true/Collate false/NumCopies 1>> setpagedevice
<</ProcessColorModel /DeviceGray>> setpagedevice
<< /ProcessColorModel /DeviceGray >> setpagedevice globaldict /TTEC known{ userdict begin /gamma {exch 255 mul floor cvi get	255 div } def TRC_G5 run /allTRC gamma_gray5 def /allHT ht2 def /setAllResource{{allTRC gamma} settransfer allHT  sethalftone } def << /Install {setAllResource} >> setpagedevice end}{ } ifelse
%%EndSetup

%%Page: 1 1

%%BeginPageSetup
<</PageSize [595 842] /ImagingBBox null>> setpagedevice
<</Duplex false>> setpagedevice
<</MediaType (Plain)>> setpagedevice
 <</ManualFeed false>> setpagedevice
 <</MediaPosition 9>> setpagedevice

%%EndPageSetup
/GSpagesave save def
 gsave 
/GSsetup {0 842 translate 0.12 -0.12 scale}bd
/GSxlate {118 118 translate}bd/GSscale {1 1 scale}bd end

GSdict begin GSsetup GSxlate GSscale gsave

 0 0 4725 6780 rc3
632 682 m 0 sg
/IsChar{~/CharStrings get ~ known}bd/MapCh{3 -1 $/Encoding get 3 1
$ put}bd/MapDegree{dup 16#b0 ~/degree IsChar{/degree}{/ring}ifelse MapCh}
bd/MapBB{dup 16#a6 ~/brokenbar IsChar{/brokenbar}{/bar}ifelse MapCh}bd
/reencode{begin currentdict dup length dict begin{1 ^/FID ne{d}
{pop pop}ifelse}forall/FontName ed dup length 0 ne{/Encoding Encoding 256
array copy d 0 ~{dup type/nametype eq{Encoding 2 ^ 2 ^ put pop 1
add}{~ pop}ifelse}forall}if pop currentdict dup end end/FontName get ~
definefont dup MapDegree MapBB}bd/nds{{/.notdef}repeat}bd
/nf{dup 3 -1 $ ff 4 -1 $ 3 1 $ reencode RMF}bd
/CS0enc[/grave/acute/circumflex/tilde/macron/breve/dotaccent/dieresis/ring
/cedilla/hungarumlaut/ogonek/caron/dotlessi/fi/fl/Lslash/lslash/Zcaron/zcaron
/minus 11 nds StandardEncoding 32 95 getinterval aload pop/.notdef/Euro/.notdef
/quotesinglbase/florin/quotedblbase/ellipsis/dagger/daggerdbl/circumflex
/perthousand/Scaron/guilsinglleft/OE/.notdef/Zcaron 2 nds/quoteleft/quoteright
/quotedblleft/quotedblright/bullet/endash/emdash/tilde/trademark/scaron/guilsinglright
/oe/.notdef/zcaron/Ydieresis/.notdef/exclamdown/cent/sterling/currency/yen/brokenbar/section
/dieresis/copyright/ordfeminine/guillemotleft/logicalnot/hyphen/registered
/macron/degree/plusminus/twosuperior/threesuperior/acute/mu/paragraph
/periodcentered/cedilla/onesuperior/ordmasculine/guillemotright/onequarter
/onehalf/threequarters/questiondown/Agrave/Aacute/Acircumflex/Atilde/Adieresis
/Aring/AE/Ccedilla/Egrave/Eacute/Ecircumflex/Edieresis/Igrave/Iacute/Icircumflex
/Idieresis/Eth/Ntilde/Ograve/Oacute/Ocircumflex/Otilde/Odieresis/multiply/Oslash
/Ugrave/Uacute/Ucircumflex/Udieresis/Yacute/Thorn/germandbls/agrave/aacute
/acircumflex/atilde/adieresis/aring/ae/ccedilla/egrave/eacute/ecircumflex
/edieresis/igrave/iacute/icircumflex/idieresis/eth/ntilde/ograve/oacute
/ocircumflex/otilde/odieresis/divide/oslash/ugrave/uacute/ucircumflex/udieresis
/yacute/thorn/ydieresis]d CS0enc dup 39/quotesingle put 96/grave put
/fm{[1 0 0 1 0 0]scale ~[1 0 0 1 0 0]rotate[1 0 0 1 0 0]concatmatrix[1 0 0 -1 0 0]
[1 0 0 1 0 0]concatmatrix}bd/ifm{4 1 $ fm[1 0 0 1 0 0]concatmatrix}bd
/rif{[1 0 0.25 1 0 0]ifm}bd/ttif{[1 0 0.05 1 0 0]ifm}bd
/F1 0 217.633 217.633 fm CS0enc /Times-Roman /Times-Roman0 nf F1 sf
(Test Document)[ 133 96 84 60 54 157 109 96 108 168 96 109 0 ]xS
1962 682 m ( )S
; ; showpage
GSpagesave restore
%%Trailer
%%Pages: 1
%%EOF
%-12345X at PJL EOJ
%-12345X


More information about the cups mailing list