<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div><div>On Mar 16, 2010, at 1:55 AM, Matthew O'Donnell wrote:</div><blockquote type="cite"><div><font class="Apple-style-span" color="#000000">...<br></font>Thanks very much for this info, it was very helpful, my apologies for taking so long to reply.<br>I have still not quite mastered this - I am trying to issue device specific (Oki) PJL commands, and can only find a way to issue some standard PJL commands (e.g. @PJL SET RESOLUTION, @PJL SET PAPERWIDTH). Is there anyway to include a block of device specific PJL, without rewriting the rastertopclx.c filter?<br></div></blockquote></div><div><br></div>If you are looking for generic job startup code, use:<div><br></div><div>    *cupsPJL StartJob: "...."</div><div><br></div><div>in the PPD file.</div><div><br></div><div>From the old DDK documentation:</div><div><br></div><div><span class="Apple-style-span" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; border-collapse: collapse; -webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; "><h3 style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; "><a name="4_2_3">PJL Attributes</a></h3><p style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; ">The HP-PCL driver also supports extensive Printer Job Language (PJL) commands through a combination of PPD attributes and options. <a href="http://www.cups.org/documentation.php/doc-other/cupsddk.html#TABLE3-3" style="font-weight: normal; text-decoration: none; color: rgb(0, 0, 153); ">Table 3-3</a> lists the PJL attributes that are supported along with the PPD options they map to. PJL attributes are specified using the <tt>Attribute</tt> directive using the <tt>cupsPJL</tt> keyword. For example, the following attribute provides the PJL commands to enable or disable the resolution enhancement features of the printer:</p><pre style="font-family: monaco, courier, monospace; font-size: 13px; ">    Attribute cupsPJL cupsRET
              "@PJL SET SMOOTHING=%?False:OFF;%?True:ON;%n"
</pre><p style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; ">The directive, <tt>Attribute</tt>, is followed by the attribute keyword, <tt>cupsPJL</tt>, the attribute name, <tt>cupsRET</tt>, and the attribute value, in this case a PJL command string. The command string consists of PJL command text and special substitution fields starting with the percent (<tt>%</tt>) character.</p><p style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; ">In the example above, the <tt>%?</tt> substitution conditionally inserts some text if the string matches the option value, typically the name of the choice. In this case, we have two conditional substitutions. The first inserts the text <tt>OFF</tt> if the <tt>cupsRET</tt> option is <tt>False</tt>, and the second inserts the text <tt>ON</tt> if the option is <tt>True</tt>. The syntax is as follows:</p><pre style="font-family: monaco, courier, monospace; font-size: 13px; ">    %?<i>look for</i>:<i>insert</i>;
</pre><p style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; ">Multiple conditional substitutions can be listed up to about 230 characters - the PPD file format imposed a 255 character line length limit, and attribute values cannot span multiple lines.</p><p style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; ">Aside from conditional substitutions, the HP-PCL driver supports the following additional substitutions. Unknown substitutions are inserted verbatim:</p><ul><li><tt>%%</tt> - inserts the percent character (<tt>%</tt>).</li><li><tt>%b</tt> - inserts the job-billing value for this job.</li><li><tt>%h</tt> - inserts the job-originating-hostname value for this job.</li><li><tt>%j</tt> - inserts the job-id value for this job.</li><li><tt>%n</tt> - inserts the carriage return (ASCII CR or <tt>0D</tt> hex) and linefeed (ASCII LF or <tt>0A</tt> hex) characters.</li><li><tt>%q</tt> - inserts the double quote character (<tt>"</tt>).</li><li><tt>%s</tt> - inserts the current option value or choice.</li><li><tt>%t</tt> - inserts the name/title of this job.</li><li><tt>%u</tt> - inserts the job-originating-username value for this job.</li></ul><h3 style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; "><a name="4_2_4">Adding PJL Options to the Basic LaserJet Driver</a></h3><p style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; ">All three HP LaserJet models support additional options via PJL commands. <a href="http://www.cups.org/documentation.php/doc-other/cupsddk.html#LISTING3-2" style="font-weight: normal; text-decoration: none; color: rgb(0, 0, 153); ">Listing 3-2</a> shows a modified version of the driver which adds support the resolution enhancement and toner saving features of the printers.</p><p style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; ">The new resolution enhancement option consists of a PPD attribute containing the <tt>cupsRET</tt> command followed by the <tt>cupsRET</tt>option. Since this option applies to the entire job, the option is placed in the <tt>DocumentSetup</tt> section:</p><pre style="font-family: monaco, courier, monospace; font-size: 13px; ">    Attribute cupsPJL cupsRET
              "@PJL SET SMOOTHING=%?False:OFF;%?True:ON;%n"

    Option "cupsRET/Smoothing" Boolean DocumentSetup 10
      Choice "False/Off" ""
      *Choice "True/On" ""
</pre><p style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; ">The toner saving option is added the same way using the <tt>cupsTonerSave</tt> attribute and option:</p><pre style="font-family: monaco, courier, monospace; font-size: 13px; ">    Attribute cupsPJL cupsTonerSave
              "@PJL SET ECONOMODE=%?False:OFF;%?True:ON;%n"

    Option "cupsTonerSave/Save Toner" Boolean DocumentSetup 10
      *Choice "False/No" ""
      Choice "True/Yes" ""
</pre><p style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; ">Since we didn't specify a group for these options, they will be put in the <tt>General</tt> option group.</p><center><table border="1" cellpadding="5" cellspacing="0" style="border-collapse: collapse; "><caption align="bottom"><i><a name="TABLE3-3">Table 3-3, PJL attributes and options</a></i></caption><tbody><tr bgcolor="#cccccc"><th width="25%" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; ">Attribute</th><th width="25%" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; ">Option</th><th width="50%" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; ">Description</th></tr><tr><td valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; "><tt>COLORSPACE. ColorModel</tt></td><td valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; ">Varies</td><td align="justify" valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; ">Specifies the colorspace to set at the beginning of the job.</td></tr><tr><td valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; "><tt>cupsBooklet</tt></td><td valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; "><tt>cupsBooklet</tt></td><td align="justify" valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; ">Specifies the PJL commands to send for setting the booklet printing mode.</td></tr><tr><td valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; "><tt>cupsPunch</tt></td><td valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; "><tt>cupsPunch</tt></td><td align="justify" valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; ">Specifies the PJL commands to send for setting the punch mode.</td></tr><tr><td valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; "><tt>cupsRET</tt></td><td valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; "><tt>cupsRET</tt></td><td align="justify" valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; ">Specifies the PJL commands to set the resolution enhancement mode.</td></tr><tr><td valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; "><tt>cupsStaple</tt></td><td valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; "><tt>cupsStaple</tt></td><td align="justify" valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; ">Specifies the PJL commands to send for setting the stapler mode.</td></tr><tr><td valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; "><tt>cupsTonerSave</tt></td><td valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; "><tt>cupsTonerSave</tt></td><td align="justify" valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; ">Specifies the PJL commands to set the toner saving mode.</td></tr><tr><td valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; "><tt>Duplex</tt></td><td valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; "><tt>Duplex</tt></td><td align="justify" valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; ">Specifies the PJL commands to send for setting the duplex mode.</td></tr><tr><td valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; "><tt>EndJob</tt></td><td valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; ">N/A</td><td align="justify" valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; ">Specifies the PJL commands to send at the end of a job.</td></tr><tr><td valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; "><tt>Jog</tt></td><td valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; ">Varies</td><td align="justify" valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; ">Specifies the PJL commands to send for setting the output jogging.</td></tr><tr><td valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; "><tt>MediaClass</tt></td><td valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; ">Varies</td><td align="justify" valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; ">Specifies the PJL commands to send for setting the media class.</td></tr><tr><td valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; "><tt>MediaColor</tt></td><td valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; ">Varies</td><td align="justify" valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; ">Specifies the PJL commands to send for setting the media color.</td></tr><tr><td valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; "><tt>MediaType</tt></td><td valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; "><tt>MediaType</tt></td><td align="justify" valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; ">Specifies the PJL commands to send for setting the media type.</td></tr><tr><td valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; "><tt>OutputType</tt></td><td valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; ">Varies</td><td align="justify" valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; ">Specifies the PJL commands to send for setting the output type.</td></tr><tr><td valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; "><tt>RENDERINTENT. ColorModel</tt></td><td valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; ">Varies</td><td align="justify" valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; ">Specifies the rendering intent to set at the beginning of the job.</td></tr><tr><td valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; "><tt>RENDERMODE. ColorModel</tt></td><td valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; ">Varies</td><td align="justify" valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; ">Specifies the render mode to set at the beginning of the job.</td></tr></tbody></table></center><center><table border="1" cellpadding="5" cellspacing="0" style="border-collapse: collapse; position: static; z-index: auto; "><caption align="bottom"><i>Table 3-3, PJL attributes and options, continued...</i></caption><tbody><tr bgcolor="#cccccc"><th width="25%" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; ">Attribute</th><th width="25%" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; ">Option</th><th width="50%" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; ">Description</th></tr><tr><td valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; "><tt>StartJob</tt></td><td valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; ">N/A</td><td align="justify" valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; ">Specifies the PJL commands to send at the beginning of a job.</td></tr><tr><td valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; "><tt>Tumble</tt></td><td valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; "><tt>Duplex</tt></td><td align="justify" valign="top" style="font-family: 'lucida grande', geneva, helvetica, arial, sans-serif; ">Specifies the PJL commands to send for setting the duplex tumble mode.<br><br></td></tr></tbody></table></center></span><div><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Monaco; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Monaco; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>________________________________________________________________________</div><div>Michael Sweet, Senior Printing System Engineer, PWG Chair</div><div><br></div></div></span><br class="Apple-interchange-newline"></span><br class="Apple-interchange-newline">
</div>
<br></div></div></body></html>