"Fossies" - the Fresh Open Source Software Archive

Member "ifhp-3.5.22/DOCS/IFHP-Reference.sgml" (17 Mar 2009, 237129 Bytes) of package /linux/misc/old/ifhp-3.5.22.tgz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) XML source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 <!DOCTYPE book
    2   SYSTEM "IFHP-Reference.dtd"
    3  -- PUBLIC "-//FreeBSD//DTD DocBook V3.1-Based Extension//EN" --
    4  -- PUBLIC "-//OASIS//DTD DocBook V3.1//EN" --
    5 [
    6   <!ENTITY LPRng "<application/LPRng/">
    7   <!ENTITY IFHP "<application/ifhp/">
    8 ]>
    9 
   10 <book>
   11 <bookinfo>
   12 <title> IFHP Reference Manual</title>
   13 <subtitle> 17 Mar 2009 (For ifhp-3.5.22)</subtitle>
   14 
   15 <author>
   16 <firstname>Patrick</firstname>
   17 <othername role=mi>A</othername>
   18 <surname>Powell</surname>
   19 <affiliation>
   20 <address>
   21 <email>papowell@astart.com</email>
   22 AStArt Technologies addr
   23 6741 Convoy Court,
   24 San Diego, CA 92111
   25 Phone <phone>858-874-6543</phone>
   26 Fax <fax>858-751-2435</fax>
   27 </address>
   28 </affiliation>
   29 </author>
   30 <copyright>
   31 <year>2002</year>
   32 <holder role="mailto:papowell@astart.com">Patrick Powell</holder>
   33 </copyright>
   34 
   35 <releaseinfo>$Id: IFHP-Reference.sgml,v 1.14 2004/10/05 15:50:15 papowell Exp papowell $</releaseinfo>
   36 
   37     <legalnotice>
   38      <important>
   39     <para>
   40         THIS DOCUMENTATION AND THE DESCRIBED SOFTWARE IS PROVIDED BY
   41       THE AUTHORS "AS IS" AND ANY
   42       EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
   43       IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
   44       PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR
   45       ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
   46       CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
   47       SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
   48       BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
   49       LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
   50       NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
   51       DOCUMENTATION, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
   52       DAMAGE.</para>
   53       </important>
   54     </legalnotice>
   55 
   56 <abstract><para>The &IFHP; program is an enhanced, extended, highly configurable,
   57 and portable implementation of a print filter for use with the &LPRng;
   58 Print spooler package.
   59 <literal>&IFHP;</literal> supports network, serial, and parallel printers,
   60 does page accounting and job recovery,
   61 and allows an extremely high level of configuration and tuning.
   62 <literal>&IFHP;</literal> gets its flexibility by using a configuration file
   63 to set its operational characteristics.  The configuration file can contain
   64 multiple separate printer configurations and the configuration selection is done
   65 by a very simple command line option.
   66 The filter supports text,  PostScript,
   67 PCL, and PJL printers, and can be configured to handle a wide range of
   68 printer quirks and mis-implementations.</para></abstract>
   69 
   70 </bookinfo>
   71 
   72 <preface>
   73 <title>Preface</title>
   74 
   75 <sect1><title>Introduction</title>
   76 <para>
   77 The &IFHP; Print Filter is the primary print filter for the &LPRng;
   78 Print Spooler.
   79 This document is designed to be the single basic reference for the
   80 &IFHP; software;
   81 the &LPRng; software is distributed separately
   82 and has additional documentation.
   83 </para>
   84 </sect1>
   85 
   86 <sect1>
   87 <title>Acknowledgements</title>
   88 <para>I would like to thank all of the &LPRng; users
   89 who so relentlessly tried the incredible number of permutations and
   90 combinations of printers and software,
   91 and whose requests for <emphasis>just one more feature</emphasis>
   92 led to the development of the software.
   93 </para>
   94 </sect1>
   95 
   96     <sect1>
   97       <title>Shell Prompts</title>
   98 
   99       <para>The following table shows the default system prompt and superuser
  100     prompt. The examples will use this prompt to indicate which user you
  101     should be running the example as.</para>
  102 
  103       <informaltable frame="none">
  104     <tgroup cols="2">
  105       <thead>
  106         <row>
  107           <entry>User</entry>
  108           <entry>Prompt</entry>
  109         </row>
  110       </thead>
  111 
  112       <tbody>
  113         <row>
  114           <entry>Normal user</entry>
  115           <entry><prompt>%</prompt></entry>
  116         </row>
  117 
  118         <row>
  119           <entry><literal>root</literal></entry>
  120           <entry><prompt>#</prompt></entry>
  121         </row>
  122       </tbody>
  123     </tgroup>
  124       </informaltable>
  125     </sect1>
  126 
  127     <sect1>
  128       <title>Typographic Conventions</title>
  129 
  130       <para>The following table describes the typographic conventions used in
  131     this book.</para>
  132 
  133       <informaltable frame="none">
  134     <tgroup cols="2">
  135       <thead>
  136         <row>
  137           <entry>Meaning</entry>
  138           <entry>Examples</entry>
  139         </row>
  140       </thead>
  141 
  142       <tbody>
  143         <row>
  144           <entry>The name of commands, files, and directories. On screen
  145         computer output.</entry>
  146           <entry><para>Edit your <filename>.login</filename>
  147           file.</para><para>Use <command>ls -a</command> to list all
  148           files.</para><para><screen>You have mail.</screen>
  149         </para></entry>
  150         </row>
  151 
  152         <row>
  153           <entry>What you type, when contrasted with on-screen computer
  154         output.</entry>
  155 
  156           <entry><screen><prompt>%</prompt> <userinput>su</userinput>
  157 Password:</screen></entry>
  158         </row>
  159 
  160         <row>
  161           <entry>Manual page references.</entry>
  162 
  163           <entry>Use <citerefentry>
  164           <refentrytitle>su</refentrytitle>
  165           <manvolnum>1</manvolnum>
  166         </citerefentry> to change user names.</entry>
  167         </row>
  168 
  169         <row>
  170           <entry>User and group names</entry>
  171 
  172           <entry>Only <literal>root</literal> can do this.</entry>
  173         </row>
  174 
  175         <row>
  176           <entry>Emphasis</entry>
  177 
  178           <entry>You <emphasis>must</emphasis>
  179 do this.</entry>
  180         </row>
  181 
  182         <row>
  183           <entry>Command line variables; replace with the real name or
  184         variable.</entry>
  185 
  186           <entry>To delete a file, type <command>rm <filename><replaceable>filename</replaceable></filename></command></entry>
  187         </row>
  188 
  189         <row>
  190           <entry>Environment variables</entry>
  191 
  192           <entry><envar>$HOME</envar> is your home directory.</entry>
  193         </row>
  194       </tbody>
  195     </tgroup>
  196       </informaltable>
  197     </sect1>
  198 
  199     <sect1>
  200       <title>Notes, warnings, and examples</title>
  201 
  202       <para>Within the text appear notes, warnings, and examples.</para>
  203 
  204       <note>
  205     <para>Notes are represented like this, and contain information that
  206       you should take note of, as it may affect what you do.</para>
  207       </note>
  208 
  209       <warning>
  210     <para>Warnings are represented like this, and contain information
  211       warning you about possible damage if you do not follow the
  212       instructions. This damage may be physical, to your hardware or to
  213       you, or it may be non-physical, such as the inadvertant deletion of
  214       important files.</para>
  215       </warning>
  216 
  217       <informalexample>
  218 
  219     <para>Examples are represented like this, and typically contain
  220       examples you should walk through, or show you what the results of a
  221       particular action should be.</para>
  222       </informalexample>
  223     </sect1>
  224 
  225   </preface>
  226 <chapter>
  227 <title>Introduction</title>
  228 
  229 <para>The &IFHP; print filter is the latest in a long evolutionary path
  230 of print filters for the &LPRng; print spooler system.
  231 It unifies the low level printer communication facilities
  232 and provide a common code base for future development.</para>
  233 
  234 <para>This document is the complete set of references and
  235 installation guide for the &IFHP; print filter.
  236 It covers compilation, installation,
  237 initial testing,
  238 details of system configuration,
  239 and configuration options that would be needed by the
  240 system administrator.
  241 Previous releases of &IFHP; had a large selection of
  242 <acronym>README</acronym>
  243 files
  244 which are now incorporated into the IFHP Reference Manual.</para>
  245 
  246 <para><anchor id="website">
  247 Information
  248 about &LPRng; and &IFHP; can be found on the &LPRng; web page
  249 <ulink URL="http://www.lprng.com">http://www.lprng.com</ulink>.</para>
  250 
  251 <para><anchor id="maillist">
  252 There is mailing list for &IFHP; and &LPRng; at <email>lprng@lprng.com</email>.
  253 In order to reduce the amount of unsolicited <emphasis>spam</emphasis> mail posted to the list
  254 you must subscribe to the list before posting to it.
  255 To subscribe,
  256 send email message to
  257 <emphasis remap=tt><ulink URL="mailto:lprng-request@lprng.com">lprng-request@lprng.com</ulink></emphasis>,
  258 with the single word <emphasis>subscribe</emphasis> in the body.</para>
  259 
  260 <para>Several presentations of &LPRng; and print spooling software have been made
  261 at the Large Scale Installation Administrator (LISA) conferences and
  262 are in the &IFHP; distribution and available on web sites.
  263 The slides for the LISA 97 tutorial on
  264 <ulink URL="ftp://ftp.lprng.com/pub/LPRng/LISA97.tgz">Printers and Network Print Spooling</ulink>
  265 are the <filename>LISA97.ppt</filename> in the
  266 &LPRng; distribution.</para>
  267 
  268 <para>During development of &IFHP;, the following documents were invaluable
  269 references.
  270 For Printer Job Language (PJL) related issues
  271 see the Printer Job Language Technical Reference Manual,
  272 Hewlett Packard, 10th Edition, October 1997.
  273 For PCL related issues see
  274 the PCL 5 Printer Language Technical Reference Manual,
  275 First Edition, 1992.
  276 These manuals are available through the Hewlett Packard Developers Program.
  277 See
  278 <ulink URL="http://www.hp.com/go/devexchange">http://www.hp.com/go/devexchange</ulink>
  279 for information on how to join.</para>
  280 
  281 
  282 <sect1>
  283 <title>Copyright and Disclaimer</title>
  284 
  285 <para>Material included in this document from the &IFHP; distribution
  286 Copyright Patrick Powell 1988-1999, where applicable.
  287 The rights to distribute this document complete or in part are hereby
  288 granted for non-commercial purposes. Partial reproductions must
  289 acknowledge the source.
  290 Permission to distribute this file together with &LPRng;, &IFHP; and `derived
  291 works' is explicitly granted.</para>
  292 
  293 <para><emphasis remap=bf>THE MATERIAL IN THIS DOCUMENT IS PROVIDED WITHOUT FEE AND AS-IS WITH NO
  294 WARRANTY REGARDING FITNESS OF USE FOR ANY PURPOSE. THE AUTHOR AND ALL
  295 CONTRIBUTORS ARE NOT LIABLE FOR ANY DAMAGES, DIRECT OR INDIRECT,
  296 RESULTING FROM THE USE OF INFORMATION PROVIDED IN THIS DOCUMENT.</emphasis></para>
  297 
  298 </sect1>
  299 
  300 <sect1>
  301 <title>Commercial Support</title>
  302 
  303 <para><ulink URL="http://www.astart.com">AStArt Technologies (http://www.astart.com)</ulink>
  304 provides commercial support and enhancements for
  305 &LPRng;, &IFHP;, and other network software.
  306 AStArt provides network and system consulting services for UNIX and NT
  307 systems, as well as real time and network software.</para>
  308 
  309 </sect1>
  310 
  311 <sect1>
  312 <title>Web Site</title>
  313 
  314 <para>Web Page:
  315 <ulink URL="http://www.lprng.com">http://www.lprng.com</ulink></para>
  316 
  317 </sect1>
  318 
  319 
  320 <sect1
  321 id="secftp">
  322 <title>FTP Sites
  323 </title>
  324 
  325 <para>Main FTP Site:
  326 <simplelist type=vert columns=1>
  327 <member>
  328 <ulink URL="ftp://ftp.lprng.com/pub/LPRng">ftp://ftp.lprng.com/pub/LPRng</ulink> (US)
  329 </member>
  330 </simplelist>
  331 </para>
  332 
  333 <!-- MIRRORSTART -->
  334 <para>Mirrors:<!-- <br> -->
  335 <simplelist type=vert columns=1>
  336 <member><ulink URL="ftp://ftp.u-aizu.ac.jp/pub/net/lpr/LPRng">ftp://ftp.u-aizu.ac.jp/pub/net/lpr/LPRng</ulink> (JA) </member>
  337 <member><ulink URL="ftp://ftp.cs.columbia.edu/pub/archives/pkg/LPRng">ftp://ftp.cs.columbia.edu/pub/archives/pkg/LPRng</ulink> (US) </member>
  338 <member><ulink URL="ftp://ftp.cise.ufl.edu/pub/mirrors/LPRng">ftp://ftp.cise.ufl.edu/pub/mirrors/LPRng</ulink> (US) </member>
  339 <member><ulink URL="ftp://ftp.cs.umn.edu/pub/LPRng">ftp://ftp.cs.umn.edu/pub/LPRng</ulink> (US) </member>
  340 <member><ulink URL="ftp://uiarchive.uiuc.edu/pub/ftp/ftp.lprng.com/pub/LPRng">ftp://uiarchive.uiuc.edu/pub/ftp/ftp.lprng.com/pub/LPRng</ulink> (US) </member>
  341 <member><ulink URL="ftp://ftp.sage-au.org.au/pub/printing/spooler/lprng/">ftp://ftp.sage-au.org.au/pub/printing/spooler/lprng/</ulink> (AU) </member>
  342 <member><ulink URL="ftp://mirror.aarnet.edu.au/pub/LPRng/">ftp://mirror.aarnet.edu.au/pub/LPRng/</ulink> (AU/NZ) </member>
  343 <member><ulink URL="http://mirror.aarnet.edu.au/pub/LPRng/">http://mirror.aarnet.edu.au/pub/LPRng/</ulink> (AU/NZ) </member>
  344 <member><ulink URL="ftp://sunsite.ualberta.ca/pub/Mirror/LPRng">ftp://sunsite.ualberta.ca/pub/Mirror/LPRng</ulink> (CA) </member>
  345 <member><ulink URL="ftp://ftp.informatik.uni-hamburg.de/pub/os/unix/utils/LPRng">ftp://ftp.informatik.uni-hamburg.de/pub/os/unix/utils/LPRng</ulink> (DE) </member>
  346 <member><ulink URL="ftp://ftp.uni-paderborn.de/pub/unix/printer/LPRng">ftp://ftp.uni-paderborn.de/pub/unix/printer/LPRng</ulink> (DE) </member>
  347 <member><ulink URL="ftp://ftp.mono.org/pub/LPRng">ftp://ftp.mono.org/pub/LPRng</ulink> (UK) </member>
  348 <member><ulink URL="ftp://ftp.iona.com/pub/plp/LPRng">ftp://ftp.iona.com/pub/plp/LPRng</ulink> (IE) </member>
  349 <member><ulink URL="ftp://uabgate.uab.ericsson.se/pub/unix/LPRng">ftp://uabgate.uab.ericsson.se/pub/unix/LPRng</ulink> (SE) </member>
  350 </simplelist>
  351 </para>
  352 <!-- MIRROREND -->
  353 
  354 </sect1>
  355 
  356 <sect1>
  357 <title>Mailing List</title>
  358 
  359 <para>To join the &LPRng; mailing list, please send mail to
  360 <ulink URL="mailto: lprng-request@lprng.ie">lprng-request@lprng.ie</ulink> with the only the
  361 word <emphasis>subscribe</emphasis> in the body of the message.
  362 <anchor id="faqref"></para>
  363 
  364 </sect1>
  365 
  366 <sect1>
  367 <title>PGP Public Key</title>
  368 
  369 <para>The &LPRng; and &IFHP; distributions have MD5 checksum files
  370 which are signed with a PGP public key.
  371 Here is the key for validating the checksums:
  372 <informalexample>
  373 <screen>Type Bits/KeyID    Date       User ID
  374 pub  1024/00D95C9D 1997/01/31 Patrick A. Powell &lt;papowell@astart.com&gt;
  375                               Patrick A. Powell &lt;papowell@sdsu.edu&gt;
  376 
  377 -----BEGIN PGP PUBLIC KEY BLOCK-----
  378 Version: 2.6.3i
  379 
  380 mQCNAzLygTQAAAEEANBW5fPYjN3wSAnP9xWOUc3CvsMUxjip0cN2sY5qrdoJyIhn
  381 qbAspBopR+tGQfyp5T7C21yfWRRnfXmoJ3FVtgToAsJUYmzoSFY08eDx+rmSqCLe
  382 rdJjX8aG8jVXpGipEo9U4QsUK+OKzx3/y/OaK4cizoWqKvy1l4lEzDsA2VydAAUT
  383 tCdQYXRyaWNrIEEuIFBvd2VsbCA8cGFwb3dlbGxAYXN0YXJ0LmNvbT6JAJUDBRA0
  384 XonoiUTMOwDZXJ0BAQ2cBAC7zU9Fn3sC3x0USJ+3vjhg/qA+Gjb5Fi1dJd4solc4
  385 vJvtf0UL/1/rGipbR+A0XHpHzJUMP9ZfJzKZjaK/d0ZBNlS3i+JnypypeQiAqo9t
  386 FV0OyUCwDfWybgAORuAa2V6UJnAhvj/7TpxMmCApolaIb4yFyKunHa8aBxN+17Ro
  387 rrQlUGF0cmljayBBLiBQb3dlbGwgPHBhcG93ZWxsQHNkc3UuZWR1PokAlQMFEDLy
  388 gTSJRMw7ANlcnQEBYBYD/0zTeoiDNnI+NjaIei6+6z6oakqO70qFVx0FG3aP3kRH
  389 WlDhdtFaAuaMRh+RItHfFfcHhw5K7jiJdgKiTgGfj5Vt3OdHYkeeh/sddqgf9YnS
  390 tpj0u5NfrotPTUw39n6YTgS5/aW0PQfO9dx7jVUcGeod1TGXTe9mIhDMwDJI4J14
  391 =3Zbp
  392 -----END PGP PUBLIC KEY BLOCK-----</screen>
  393 </informalexample>
  394 </para>
  395 
  396 </sect1>
  397 </chapter>
  398 
  399 <chapter>
  400 <title>Software Installation and Configuration</title>
  401 
  402 <para>Before you do an installation
  403 please read the following instructions.
  404 You will need to:
  405 <orderedlist>
  406 
  407 <listitem>
  408 <para>Use GNU Make.  You can get it from
  409 <ulink URL="http://www.gnu.org/software/software.html">http://www.gnu.org/software/software.html</ulink>.
  410 Don't even think about trying to use another
  411 make unless you are a Wizard.  And even the Wizards use GNU Make.</para>
  412 </listitem>
  413 
  414 <listitem>
  415 <para>Use an ANSI C compiler.
  416 &IFHP; is developed and tested with the GNU C compiler.
  417 You can get it from
  418 <ulink URL="http://www.gnu.org/software/software.html">http://www.gnu.org/software/software.html</ulink>.
  419 Solaris users should consult the excellent
  420 <ulink URL="http://sunfreeware.com">http://sunfreeware.com</ulink>
  421 site for binary distributions.
  422 AIX users can use
  423 <ulink URL="http://www.bull.de/pub/">http://www.bull.de/pub/</ulink>
  424 or <ulink URL="ftp://ftp.htwk-leipzig.de">ftp://ftp.htwk-leipzig.de</ulink></para>
  425 </listitem>
  426 
  427 </orderedlist>
  428 </para>
  429 
  430 
  431 <sect1>
  432 <title>Additional Recommended Software</title>
  433 
  434 <para>The following software is recommended for use with &IFHP;.
  435 If your printer does not support PostScript, PCL, or text printing directly
  436 you will need to install GhostScript to convert from PostScript to the printer
  437 format and use a suitable text to PostScript converter.
  438 <variablelist>
  439 <varlistentry><term>Unix File Utility</term>
  440 <listitem>
  441 <para><anchor id="fileutil">
  442 The &IFHP; filter will recognize that a file
  443 is PostScript, PJL, or PCL by examining the first
  444 couple of bytes of a file and applying a simple set of rules.
  445 If you require more elaborate file type detection then you can
  446 configure &IFHP; to also use the UNIX <emphasis remap=tt>file</emphasis> utility
  447 if it is unable to determine the file type.
  448 See
  449 <ulink URL="ftp://ftp.astron.com/pub/file/">
  450 ftp://ftp.astron.com/pub/file/</ulink>
  451 or
  452 <ulink URL="ftp://ftp.lprng.com/pub/LPRng/UNIXTOOLS/file/">
  453 ftp://ftp.lprng.com/pub/LPRng/UNIXTOOLS/file/</ulink>
  454 to obtain this software.</para>
  455 
  456 
  457 </listitem>
  458 </varlistentry>
  459 
  460 <varlistentry><term>&LPRng; Print Spooler</term>
  461 
  462 <listitem>
  463 <para><ulink URL="http://www.lprng.com">http://www.lprng.com</ulink>
  464 The &IFHP; filter works best with the later versions of this software,
  465 and the two are developed as an integrated unit.</para>
  466 
  467 
  468 </listitem>
  469 </varlistentry>
  470 
  471 <varlistentry><term>GhostScript</term>
  472 
  473 <listitem>
  474 <para><anchor id="ghostscript">
  475 <ulink URL="http://www.cs.wisc.edu/~ghost/index.html">http://www.cs.wisc.edu/~ghost/index.html</ulink>
  476 or
  477 <ulink URL="http://www.ghostscript.com/">http://www.ghostscript.com</ulink>
  478 If your printer does not handle PostScript and you need to print PostScript,
  479 GhostScript is used to convert PostScript to a format usable by the printer.</para>
  480 </listitem>
  481 </varlistentry>
  482 <varlistentry><term>a2ps - Ascii Text To PostScript Converter</term>
  483 
  484 <listitem>
  485 <para><anchor id="a2ps">
  486 If your printer is a PostScript only printer or you wish to have enhanced
  487 formatting capability for documents,  then you will need a text to PostScript converter.
  488 <ulink URL="http://www-inf.enst.fr/~demaille/a2ps/">http://www-inf.enst.fr/~demaille/a2ps/</ulink>
  489 This package does a very good job of text to PostScript conversion.
  490 It also makes use of the
  491 <link linkend="fileutil">file utility</link>
  492 to determine the required conversions.</para>
  493 
  494 
  495 </listitem>
  496 </varlistentry>
  497 
  498 <varlistentry><term>enscript - GNU Enscript</term>
  499 
  500 <listitem>
  501 <para><anchor id="enscript">
  502 <ulink URL="http://www.gnu.org">http://www.gnu.org/</ulink>
  503 This package is an alternative to <literal>a2ps</literal>,
  504 but requires careful handling due to the exit codes it produces.
  505 Please see
  506 <link linkend="conversion">Wrappers For Programs</link> for details on how to use
  507 <literal>enscript</literal> with &IFHP;.</para>
  508 
  509 </listitem>
  510 </varlistentry>
  511 
  512 <varlistentry><term>textps</term>
  513 
  514 <listitem>
  515 <para><anchor id="textps">
  516 This program is included with the &IFHP; distribution
  517 and is an extremely primitive text to PostScript filter.
  518 It generates PostScript compatible with even the most ancient
  519 of PostScript printers and is useful where
  520 <literal>a2ps</literal> and <emphasis remap=tt>enscript</emphasis> are just too modern.
  521 See
  522 <ulink URL="http://www.lprng.com">http://www.lprng.com</ulink>.</para>
  523 
  524 
  525 </listitem>
  526 </varlistentry>
  527 
  528 <varlistentry><term>psutils</term>
  529 
  530 <listitem>
  531 <para><anchor id="psutils">
  532 The <literal>psutils</literal> package
  533 developed by Angus Duggan is available from
  534 <ulink URL="ftp://ftp.dcs.ed.ac.uk/pub/ajcd/">ftp://ftp.dcs.ed.ac.uk/pub/ajcd/</ulink>.
  535 These are a collection of programs for manipulation of
  536 PostScript files,
  537 and include facilities for doing page selection,
  538 page reversal, n-up printing,  and watermarking.</para>
  539 
  540 
  541 </listitem>
  542 </varlistentry>
  543 
  544 <varlistentry><term>netcat</term>
  545 
  546 <listitem>
  547 <para><anchor id="netcat">
  548 The <literal>netcat</literal> utility is extremely useful when trying to
  549 send files to a network printer and you need to monitor its
  550 activity.
  551 Developed by <email>hobbit@avian.org</email>, it is available from
  552 <ulink URL="ftp://avian.org/src/hacks/nc110.tgz">ftp://avian.org/src/hacks/nc110.tgz</ulink>.</para>
  553 
  554 </listitem>
  555 </varlistentry>
  556 </variablelist>
  557 </para>
  558 
  559 </sect1>
  560 
  561 <sect1>
  562 <title>Installation</title>
  563 
  564 <para>The installation procedure uses the <literal>configure</literal>
  565 facility to generate Makefiles.
  566 By convention,
  567 these files have the following variables that install
  568 the &IFHP; executables and configuration files
  569 in the following locations:
  570 </para>
  571 <table> <title>Configure File Location Variables</title>
  572 <tgroup cols=4 align=left>
  573 <thead>
  574 <row><entry>Configure Variable</entry><entry>Default Value</entry>
  575 <entry>Expanded Default Value</entry>
  576 <entry>Override</entry> </row>
  577 </thead>
  578 <tbody>
  579 <row><entry><literal>${prefix}</literal></entry><entry><literal>/usr/local</literal></entry><entry><literal>--prefix=PATH</literal></entry></row>
  580 <row><entry><literal>${exec_prefix}</literal></entry><entry><literal>${prefix}</literal></entry><entry><literal>/usr/local</literal></entry><entry><literal>--execprefix=PATH</literal></entry></row>
  581 <row><entry><literal>${bindir}</literal></entry><entry><literal>${exec_prefix}/bin</literal></entry><entry><literal>/usr/local/bin</literal></entry><entry><literal>--bindir=PATH</literal></entry></row>
  582 <row><entry><literal>${sbindir}</literal></entry><entry><literal>${exec_prefix}/sbin</literal></entry><entry><literal>/usr/local/sbin</literal></entry><entry><literal>--sbindir=PATH</literal></entry></row>
  583 <row><entry><literal>${libexecdir}</literal></entry><entry><literal>${exec_prefix}/libexec</literal></entry><entry><literal>/usr/local/libexec</literal></entry><entry><literal>--libexecdir=PATH</literal></entry></row>
  584 <row><entry><literal>${sysconfdir}</literal></entry><entry><literal>${prefix}/etc</literal></entry><entry><literal>/usr/local/etc</literal></entry><entry><literal>--sysconfdir=PATH</literal></entry></row>
  585 <row><entry><literal>${mandir}</literal></entry><entry><literal>${prefix}/man</literal></entry><entry><literal>/usr/local/man</literal></entry><entry><literal>--mandir=PATH</literal></entry></row>
  586 </tbody>
  587 </tgroup>
  588 </table>
  589 
  590 <para>The following files are installed as shown below:
  591 <table>
  592 <title>Executable and Configuration File Locations</title>
  593 <tgroup cols=2 align=left>
  594 <thead>
  595 <row><entry>Configure Variable</entry><entry>Files</entry></row>
  596 </thead>
  597 <tbody>
  598 <row><entry><literal>${libexecdir}/filters</literal></entry><entry><literal>lpf, ifhp</literal></entry></row>
  599 <row><entry><literal>${sysconfdir}</literal></entry><entry><literal>ifhp.conf</literal></entry></row>
  600 <row><entry><literal>${mandir}/man[1-9]</literal></entry><entry><literal>man pages</literal></entry></row>
  601 </tbody>
  602 </tgroup>
  603 </table>
  604 
  605 </para>
  606 
  607 <para>The configuration you choose should match that of the
  608 &LPRng; print spooler.  For example:
  609 <informalexample>
  610 <screen>./configure --prefix=/usr --sysconfdir=/etc \
  611   --mandir=/usr/share/man
  612 
  613 executables and files in
  614    /usr/libexec/filters         ifhp
  615    /etc                         ifhp.conf
  616    /usr/share/man/man[0-9]      ifhp.man1</screen>
  617 </informalexample>
  618 </para>
  619 
  620 <para>First,  we untar,  configure,  compile, and install the software:
  621 <informalexample>
  622 <screen><prompt>h4: {1} % </prompt><userinput>gunzip -c ifhp-&lt;version&gt;.tgz | tar xvf -</userinput>
  623 <prompt>h4: {2} % </prompt><userinput>cd ifhp-&lt;version&gt;</userinput>
  624 <prompt>h4: {3} % </prompt><userinput>./configure  [ ... configuration options ]</userinput>
  625 <prompt>h4: {4} % </prompt><userinput>make clean all</userinput>
  626 <prompt>h4: {5} % </prompt><userinput>su   # you must do the following commands as root</userinput>
  627 <prompt>h4: {6} # </prompt><userinput>make install</userinput></screen>
  628 </informalexample>
  629 </para>
  630 
  631 <para>Modify your printcap file to use &IFHP;.
  632 Your printcap usually has the following format;
  633 older version of <application/lpd/ require <emphasis remap=tt>:\</emphasis> at the end of each
  634 line of a printcap entry.
  635 The <emphasis remap=tt>:if</emphasis> and <emphasis remap=tt>:of</emphasis> filter entries are usually the ones of interest.
  636 <informalexample>
  637 <screen>lp:
  638   :lp=xxxx:sd=xxxx:....
  639   :if=/usr/local/path_to_old_filters/old_if_filter
  640   :of=/usr/local/path_to_old_filters/old_of_filter</screen>
  641 </informalexample>
  642 </para>
  643 
  644 <para>Your new printcap entry will look like the one below.
  645 The <acronym>MODEL</acronym> information is described in the next section.
  646 <informalexample>
  647 <screen>lp:
  648   :lp=xxxx:sd=xxxx:....
  649   #  see text for details about the next line
  650   :ifhp=model=MODEL,status@
  651   :filter=/usr/local/libexec/filters/ifhp
  652   # only if you are using accounting or banners
  653   #:of=/usr/local/libexec/filters/ifhp</screen>
  654 </informalexample>
  655 </para>
  656 
  657 <para>Select a suitable printer from the
  658 entries in the
  659 configuration file
  660 (<filename>/usr/local/etc/lpd.conf</filename>
  661 or
  662 <filename>/etc/lpd.conf</filename>).
  663 These are described in more detail in the next section.</para>
  664 
  665 <para>Shut down and restart your print spooler and then send a job to the printer.
  666 If this works and you do not need any further capabilities of &IFHP;
  667 such as error reporting or printer monitoring,
  668 then you are finished.</para>
  669 
  670 <para>If you want to use additional capabilities,
  671 then you should read the detailed instructions in the next couple of sections.</para>
  672 
  673 </sect1>
  674 
  675 <sect1
  676 id="modelselection">
  677 <title>Printer Models Supported
  678 </title>
  679 
  680 <para>There are over 500 different printer models,
  681 types and configurations supported by &IFHP;.
  682 If your printer is not currently supported
  683 and you have documentation about the printer then send mail to the
  684 <link linkend="maillist">&LPRng; Mailing List</link>
  685 and support will be added.</para>
  686 <para>The default printer is an HP LaserJet 4MP,
  687 which supports PostScript Level 3, PCL5, PJL,
  688 and has bidirectional communication and a functional pagecounter.
  689 </para>
  690 
  691 <para>The <filename>ifhp.conf</filename> configuration file contains
  692 configuration entries for various models of printers.
  693 Each entry has a name usually corresponding to the model of printer
  694 or its basic capabilities.
  695 For example,
  696 the HP LaserJet 4 printer has the <literal>model=hp4</literal> configuration entry.
  697 The <emphasis remap=bf>default</emphasis> printer configuration
  698 covers a wide range of network printers manufactured by Hewlett-Packard,
  699 Canon,  Epson, and others and
  700 is for a printer that has a bidirectional communications
  701 connection that allows it to report status information
  702 and the following capabilities:
  703 <orderedlist>
  704 
  705 <listitem>
  706 <para> PJL support (<literal>pjl</literal>) compatible with HP 4 family of printers</para>
  707 </listitem>
  708 
  709 <listitem>
  710 <para> PostScript (PS) support (<literal>ps</literal>).</para>
  711 </listitem>
  712 
  713 <listitem>
  714 <para> PCL support (<literal>pcl</literal>).</para>
  715 </listitem>
  716 
  717 <listitem>
  718 <para> Text files printed as PCL (<literal>text</literal>, <literal>default_language=pcl</literal>).</para>
  719 </listitem>
  720 
  721 </orderedlist>
  722 </para>
  723 
  724 <para>There is also support for
  725 <link linkend="psonly">PostScript only printers</link>
  726 (<literal>model=ps</literal>),
  727 <link linkend="phaser">Tektronics Phasers</link>
  728 (<literal>model=phaser</literal>),
  729 <link linkend="phaser">QMS</link>
  730 (<literal>model=qmsXXX</literal>)
  731 and others.
  732 The best way to determine the printers currently supported is
  733 to examine the <filename>ifhp.conf</filename> file.
  734 The following is a sample of the various entries in the
  735 configuration file.
  736 <!-- SUPPORTED START -->
  737 <table frame=all id=configentries>
  738 <title><literal/ifhp.conf/ Configuration Entries </title>
  739 <tgroup cols=2 colsep=1 rowsep=1 align=left >
  740 <thead><row><entry/Configuration/<entry/Printer Supported/</row></thead>
  741 <tbody>
  742 <row><entry><literal>default</literal></entry><entry>Generic Printer based on HP 4M Plus, PostScript, PJL, HPGL2, PCL, status, pagecount support</entry></row>
  743 <row><entry><literal>apple</literal></entry><entry>Generic PostScript printer, text to PS conversion, status, pagecount support</entry></row>
  744 <row><entry><literal>postscript</literal></entry><entry>Generic PostScript printer, text to PS conversion, status, pagecount support</entry></row>
  745 <row><entry><literal>ps</literal></entry><entry>Generic PostScript printer, text to PS conversion, status, pagecount support</entry></row>
  746 <row><entry><literal>pcl</literal></entry><entry>Generic PCL only printer, no status</entry></row>
  747 <row><entry><literal>pcl_gs</literal></entry><entry>HP LaserJet 4 PCL only printer, write only, no status</entry></row>
  748 <row><entry><literal>hpiiisi</literal></entry><entry>HP LaserJet III (PCL and PostScript Interpreter)</entry></row>
  749 <row><entry><literal>hp3si</literal></entry><entry>HP LaserJet III (PCL and PostScript Interpreter)</entry></row>
  750 <row><entry><literal>ljet3</literal></entry><entry>HP LaserJet III (PCL and PostScript Interpreter)</entry></row>
  751 <row><entry><literal>lj3</literal></entry><entry>HP LaserJet III (PCL and PostScript Interpreter)</entry></row>
  752 <row><entry><literal>hpiiisi.gs</literal></entry><entry>HP LaserJet III (PCL, PostScript via GhostScript)</entry></row>
  753 <row><entry><literal>hp3si.gs</literal></entry><entry>HP LaserJet III (PCL, PostScript via GhostScript)</entry></row>
  754 <row><entry><literal>ljet3.gs</literal></entry><entry>HP LaserJet III (PCL, PostScript via GhostScript)</entry></row>
  755 <row><entry><literal>lj3.gs</literal></entry><entry>HP LaserJet III (PCL, PostScript via GhostScript)</entry></row>
  756 <row><entry><literal>hp4</literal></entry><entry>HP LaserJet 4 Family, HP LaserJet 4 (PostScript Interpreter)</entry></row>
  757 <row><entry><literal>hp4m</literal></entry><entry>HP LaserJet 4 Family, HP LaserJet 4m (PostScript Interpreter)</entry></row>
  758 <row><entry><literal>hp4si</literal></entry><entry>HP LaserJet 4 Family, HP LaserJet 4si (PostScript Interpreter)</entry></row>
  759 <row><entry><literal>hp4simx</literal></entry><entry>HP LaserJet 4 Family, HP LaserJet 4simx (PostScript Interpreter)</entry></row>
  760 <row><entry><literal>hp4plus</literal></entry><entry>HP LaserJet 4 Family, HP LaserJet 4plus (PostScript Interpreter)</entry></row>
  761 <row><entry><literal>hp4mplus</literal></entry><entry>HP LaserJet 4 Family, HP LaserJet 4mplus (PostScript Interpreter)</entry></row>
  762 <row><entry><literal>hp4v</literal></entry><entry>HP LaserJet 4 Family, HP LaserJet 4v (PostScript Interpreter)</entry></row>
  763 <row><entry><literal>hp4mv</literal></entry><entry>HP LaserJet 4 Family, HP LaserJet 4mv (PostScript Interpreter)</entry></row>
  764 <row><entry><literal>hp4p</literal></entry><entry>HP LaserJet 4 Family, HP LaserJet 4p (PostScript Interpreter)</entry></row>
  765 <row><entry><literal>hp4mp</literal></entry><entry>HP LaserJet 4 Family, HP LaserJet 4mp (PostScript Interpreter)</entry></row>
  766 <row><entry><literal>hp4pj</literal></entry><entry>HP LaserJet 4 Family, HP LaserJet 4pj (PostScript Interpreter)</entry></row>
  767 <row><entry><literal>hpljpro</literal></entry><entry>HP LaserJet 4 Family, HP LaserJet ljpro (PostScript Interpreter)</entry></row>
  768 <row><entry><literal>hp4lc</literal></entry><entry>HP LaserJet 4 Family, HP LaserJet 4lc (PostScript Interpreter)</entry></row>
  769 <row><entry><literal>hp4mplus</literal></entry><entry>HP LaserJet 4MPlus</entry></row>
  770 <row><entry><literal>hp5l</literal></entry><entry>HP LaserJet 5 Family, Hp LaserJet 5l</entry></row>
  771 <row><entry><literal>hp6l</literal></entry><entry>HP LaserJet 6 Family, Hp LaserJet 6l</entry></row>
  772 <row><entry><literal>hp1100</literal></entry><entry>HP LaserJet 6 Family, Hp LaserJet 1100</entry></row>
  773 <row><entry><literal>hp1100</literal></entry><entry>HP LaserJet 1000 Family, Hp LaserJet 1100</entry></row>
  774 <row><entry><literal>hp4l</literal></entry><entry>Hp LaserJet 4L, PCL only</entry></row>
  775 <row><entry><literal>hp4ml</literal></entry><entry>HP LaserJet 4ml</entry></row>
  776 <row><entry><literal>hp5p</literal></entry><entry>HP LaserJet 5p</entry></row>
  777 <row><entry><literal>hp5mp</literal></entry><entry>HP LaserJet 5mp</entry></row>
  778 <row><entry><literal>hp6p</literal></entry><entry>HP LaserJet 6p</entry></row>
  779 <row><entry><literal>hp6mp</literal></entry><entry>HP LaserJet 6mp</entry></row>
  780 <row><entry><literal>hp5</literal></entry><entry>HP LaserJet 5</entry></row>
  781 <row><entry><literal>hp5si</literal></entry><entry>HP LaserJet 5si</entry></row>
  782 <row><entry><literal>hp5simx</literal></entry><entry>HP LaserJet 5simx</entry></row>
  783 <row><entry><literal>hp5m</literal></entry><entry>HP LaserJet 5m</entry></row>
  784 <row><entry><literal>hp4100</literal></entry><entry>HP LaserJet 4100</entry></row>
  785 <row><entry><literal>hp4200</literal></entry><entry>HP LaserJet 4200</entry></row>
  786 <row><entry><literal>hp4300</literal></entry><entry>HP LaserJet 4300</entry></row>
  787 <row><entry><literal>hp5simopier</literal></entry><entry>HP LaserJet 5simopier</entry></row>
  788 <row><entry><literal>hp4000</literal></entry><entry>HP LaserJet 4000</entry></row>
  789 <row><entry><literal>hpcolorlj</literal></entry><entry>HP Color LaserJet </entry></row>
  790 <row><entry><literal>hpcolorlj5</literal></entry><entry>HP Color LaserJet 5</entry></row>
  791 <row><entry><literal>hpcolorlj5m</literal></entry><entry>HP Color LaserJet 5m</entry></row>
  792 <row><entry><literal>hpdj1200</literal></entry><entry>HP DesignJet 1200 Family</entry></row>
  793 <row><entry><literal>hppjxl300</literal></entry><entry>HP PaintJet XL 300 Family</entry></row>
  794 <row><entry><literal>hpdj1600</literal></entry><entry>HP DesignJet 1600 Family</entry></row>
  795 <row><entry><literal>hpdj200</literal></entry><entry>HP DeskJet 200</entry></row>
  796 <row><entry><literal>hpdj220</literal></entry><entry>HP DeskJet 220</entry></row>
  797 <row><entry><literal>hpdj600</literal></entry><entry>HP DeskJet 600</entry></row>
  798 <row><entry><literal>hpdj650</literal></entry><entry>HP DeskJet 650</entry></row>
  799 <row><entry><literal>hpdj230</literal></entry><entry>HP DeskJet 230</entry></row>
  800 <row><entry><literal>hpdj250c</literal></entry><entry>HP DeskJet 250c</entry></row>
  801 <row><entry><literal>hpdj330</literal></entry><entry>HP DeskJet 330</entry></row>
  802 <row><entry><literal>hpdj350c</literal></entry><entry>HP DeskJet 350c</entry></row>
  803 <row><entry><literal>hpdj430</literal></entry><entry>HP DeskJet 430</entry></row>
  804 <row><entry><literal>hpdj450c</literal></entry><entry>HP DeskJet 450c</entry></row>
  805 <row><entry><literal>hpdj455ca</literal></entry><entry>HP DeskJet 455ca</entry></row>
  806 <row><entry><literal>hpdj700</literal></entry><entry>HP DeskJet 700</entry></row>
  807 <row><entry><literal>hpdj750c</literal></entry><entry>HP DeskJet 750c</entry></row>
  808 <row><entry><literal>hpdj750cplus</literal></entry><entry>HP DeskJet 750cplus</entry></row>
  809 <row><entry><literal>hpdj755cm</literal></entry><entry>HP DeskJet 755cm</entry></row>
  810 <row><entry><literal>hpdj2000cp</literal></entry><entry>HP DeskJet 2000cp</entry></row>
  811 <row><entry><literal>hp2500</literal></entry><entry>HP DesignJet 2500 - No PCL, PostScript Only</entry></row>
  812 <row><entry><literal>hp2500cm</literal></entry><entry>HP DesignJet 2500cm - No PCL, PostScript Only</entry></row>
  813 <row><entry><literal>hp2500c</literal></entry><entry>HP DesignJet 2500c - No PCL, PostScript Only</entry></row>
  814 <row><entry><literal>hp2500cm</literal></entry><entry>HP DesignJet 2500cm - PCL and PostScript</entry></row>
  815 <row><entry><literal>hpdj2500cp</literal></entry><entry>HP DesignJet 2500CP, not HP2500, HP2500c, HP2500cm</entry></row>
  816 <row><entry><literal>hp4500</literal></entry><entry>HP Color LaserJet Printer 4500</entry></row>
  817 <row><entry><literal>hp8500</literal></entry><entry>HP Color LaserJet Printer 8500</entry></row>
  818 <row><entry><literal>hp8550</literal></entry><entry>HP Color LaserJet Printer 8550</entry></row>
  819 <row><entry><literal>hp4550n</literal></entry><entry>HP 4550N</entry></row>
  820 <row><entry><literal>hp5000</literal></entry><entry>HP 5000 Model C4111A (LaserJet 5000)</entry></row>
  821 <row><entry><literal>hp8000</literal></entry><entry>HP LaserJet 8000 Series, HP8000</entry></row>
  822 <row><entry><literal>hp8100</literal></entry><entry>HP LaserJet 8000 Series, HP8100</entry></row>
  823 <row><entry><literal>hp8150</literal></entry><entry>HP LaserJet 8000 Series, HP8150</entry></row>
  824 <row><entry><literal>hp2100</literal></entry><entry>HP LaserJet 2100 Series</entry></row>
  825 <row><entry><literal>hp2200</literal></entry><entry>HP LaserJet 2200 Series</entry></row>
  826 <row><entry><literal>hp4050</literal></entry><entry>HP 4050 Series Printers</entry></row>
  827 <row><entry><literal>qms1725</literal></entry><entry>QMS 1725, uses appsocket, no status, PostScript only</entry></row>
  828 <row><entry><literal>qms2025</literal></entry><entry>QMS Laser Printer QMS 2025, appsocket, no status, PostScript and PCL</entry></row>
  829 <row><entry><literal>qms860</literal></entry><entry>QMS Laser Printer QMS 860, appsocket, no status, PostScript and PCL</entry></row>
  830 <row><entry><literal>qms2060</literal></entry><entry>QMS Laser Printer QMS 2060, appsocket, no status, PostScript and PCL</entry></row>
  831 <row><entry><literal>phaser</literal></entry><entry>Tektronics Generic Phaser Color Printer, appsocket, snmp monitoring, PostScript only</entry></row>
  832 <row><entry><literal>phaser360</literal></entry><entry>Tektronics Phaser 360 Color Printer, appsocket, snmp monitoring, PostScript only</entry></row>
  833 <row><entry><literal>phaser740</literal></entry><entry>Tektronics Phaser 740 Color Printer, appsocket, snmp monitoring, PostScript only</entry></row>
  834 <row><entry><literal>phaser750</literal></entry><entry>Tektronics Phaser 750 Color Printer, appsocket, snmp monitoring, PostScript only</entry></row>
  835 <row><entry><literal>phaser850</literal></entry><entry>Tektronics Phaser 850 Color Printer, appsocket, snmp monitoring, PostScript only</entry></row>
  836 <row><entry><literal>phaser740</literal></entry><entry>Tektronics Phaser 740 Color Printer, appsocket, snmp monitoring, PostScript and PCL</entry></row>
  837 <row><entry><literal>phaser5400</literal></entry><entry>Tektronics Phaser 5400 Color Printer, appsocket, snmp monitoring, PostScript and PCL</entry></row>
  838 <row><entry><literal>phaser7700</literal></entry><entry>Tektronics Phaser 7700 Color Printer, appsocket, snmp monitoring, PostScript and PCL</entry></row>
  839 <row><entry><literal>lexmark4039</literal></entry><entry>Lexmark 4039, Postscript only</entry></row>
  840 <row><entry><literal>lexmark_optra_e312</literal></entry><entry>Lexmark Optra e312, Postscript, PCL and PJL</entry></row>
  841 <row><entry><literal>ln15s</literal></entry><entry>Digital Laser LN15, LN17ps, Compaq Laser LN 16</entry></row>
  842 <row><entry><literal>ln16s</literal></entry><entry>Digital Laser LN15, LN17ps, Compaq Laser LN 16</entry></row>
  843 <row><entry><literal>ln17pss</literal></entry><entry>Digital Laser LN15, LN17ps, Compaq Laser LN 16</entry></row>
  844 <row><entry><literal>hpij2250s</literal></entry><entry>HP Business Inkjet 2250</entry></row>
  845 <row><entry><literal>gs_bj10</literal></entry><entry>Canon BubbleJet BJ10e </entry></row>
  846 <row><entry><literal>gs_bj10</literal></entry><entry>Canon BubbleJet BJ20 </entry></row>
  847 <row><entry><literal>gs_bj200</literal></entry><entry>Canon BubbleJet BJ200 </entry></row>
  848 <row><entry><literal>gs_bj200</literal></entry><entry>Canon BubbleJet BJC-210 B/W only </entry></row>
  849 <row><entry><literal>gs_bj200</literal></entry><entry>Canon BubbleJet BJC-240 B/W only </entry></row>
  850 <row><entry><literal>gs_bj200</literal></entry><entry>Canon BubbleJet BJC-250 B/W only </entry></row>
  851 <row><entry><literal>gs_bj200</literal></entry><entry>Canon BubbleJet BJC-70 B/W only </entry></row>
  852 <row><entry><literal>gs_bjc600</literal></entry><entry>Canon BubbleJet BJC-600 </entry></row>
  853 <row><entry><literal>gs_bjc600</literal></entry><entry>Canon BubbleJet BJC-610</entry></row>
  854 <row><entry><literal>gs_bjc600</literal></entry><entry>Canon BubbleJet BJC-50</entry></row>
  855 <row><entry><literal>gs_bjc600</literal></entry><entry>Canon BubbleJet BJC-70 </entry></row>
  856 <row><entry><literal>gs_bjc600</literal></entry><entry>Canon BubbleJet BJC-80 </entry></row>
  857 <row><entry><literal>gs_bjc600</literal></entry><entry>Canon BubbleJet BJC-210 Color only</entry></row>
  858 <row><entry><literal>gs_bjc600</literal></entry><entry>Canon BubbleJet BJC-240 Color only</entry></row>
  859 <row><entry><literal>gs_bjc600</literal></entry><entry>Canon BubbleJet BJC-250 </entry></row>
  860 <row><entry><literal>gs_bjc600</literal></entry><entry>Canon BubbleJet BJC-1000</entry></row>
  861 <row><entry><literal>gs_bjc600</literal></entry><entry>Canon BubbleJet BJC-2000</entry></row>
  862 <row><entry><literal>gs_bjc600</literal></entry><entry>Canon BubbleJet BJC-4000 </entry></row>
  863 <row><entry><literal>gs_bjc600</literal></entry><entry>Canon BubbleJet BJC-4100 B/W only</entry></row>
  864 <row><entry><literal>gs_bjc600</literal></entry><entry>Canon BubbleJet BJC-4200</entry></row>
  865 <row><entry><literal>gs_bjc600</literal></entry><entry>Canon BubbleJet BJC-4300</entry></row>
  866 <row><entry><literal>gs_bjc600</literal></entry><entry>Canon BubbleJet BJC-4550 </entry></row>
  867 <row><entry><literal>gs_bjc600</literal></entry><entry>Canon BubbleJet BJC-6000</entry></row>
  868 <row><entry><literal>gs_bjc600</literal></entry><entry>Canon MultiPASS C2500 color printer/fax/copier </entry></row>
  869 <row><entry><literal>gs_bjc800</literal></entry><entry>Canon BubbleJet BJC-800 </entry></row>
  870 <row><entry><literal>gs_bjc800</literal></entry><entry>Canon BubbleJet BJC-7000 Color. </entry></row>
  871 <row><entry><literal>gs_bjc800</literal></entry><entry>Canon BubbleJet BJC-4300 Color</entry></row>
  872 <row><entry><literal>gs_bjc800</literal></entry><entry>Canon BubbleJet BJC-4650 </entry></row>
  873 <row><entry><literal>gs_deskjet</literal></entry><entry>HP DeskJet </entry></row>
  874 <row><entry><literal>gs_deskjet</literal></entry><entry>HP DeskJet Plus </entry></row>
  875 <row><entry><literal>gs_djet500</literal></entry><entry>HP DeskJet 500 B/W</entry></row>
  876 <row><entry><literal>gs_djet500</literal></entry><entry>HP DeskJet Portable B/W</entry></row>
  877 <row><entry><literal>gs_djet500</literal></entry><entry>HP OfficeJet 590 B/W</entry></row>
  878 <row><entry><literal>gs_cdj500</literal></entry><entry>HP DeskJet 400</entry></row>
  879 <row><entry><literal>gs_cdj500</literal></entry><entry>HP DeskJet 500C </entry></row>
  880 <row><entry><literal>gs_cdj500</literal></entry><entry>HP DeskJet 540C </entry></row>
  881 <row><entry><literal>gs_cdj500</literal></entry><entry>HP DeskJet 690C</entry></row>
  882 <row><entry><literal>gs_cdj500</literal></entry><entry>HP DeskJet 693C</entry></row>
  883 <row><entry><literal>gs_cdj550</literal></entry><entry>HP DeskJet 550C </entry></row>
  884 <row><entry><literal>gs_cdj550</literal></entry><entry>HP DeskJet 560C </entry></row>
  885 <row><entry><literal>gs_cdj550</literal></entry><entry>HP DeskJet 600</entry></row>
  886 <row><entry><literal>gs_cdj550</literal></entry><entry>HP DeskJet 660C </entry></row>
  887 <row><entry><literal>gs_cdj550</literal></entry><entry>HP DeskJet 660C </entry></row>
  888 <row><entry><literal>gs_cdj550</literal></entry><entry>HP DeskJet 682C</entry></row>
  889 <row><entry><literal>gs_cdj550</literal></entry><entry>HP DeskJet 683C</entry></row>
  890 <row><entry><literal>gs_cdj550</literal></entry><entry>HP DeskJet 693C </entry></row>
  891 <row><entry><literal>gs_cdj550</literal></entry><entry>HP DeskJet 694C </entry></row>
  892 <row><entry><literal>gs_cdj550</literal></entry><entry>HP DeskJet 690C </entry></row>
  893 <row><entry><literal>gs_cdj550</literal></entry><entry>HP DeskJet 692C </entry></row>
  894 <row><entry><literal>gs_cdj550</literal></entry><entry>HP DeskJet 693C </entry></row>
  895 <row><entry><literal>gs_cdj550</literal></entry><entry>HP DeskJet 694C </entry></row>
  896 <row><entry><literal>gs_cdj550</literal></entry><entry>HP DeskJet 695C </entry></row>
  897 <row><entry><literal>gs_cdj550</literal></entry><entry>HP DeskJet 850 </entry></row>
  898 <row><entry><literal>gs_cdj550</literal></entry><entry>HP DeskJet 870Cse </entry></row>
  899 <row><entry><literal>gs_cdj550</literal></entry><entry>HP DeskJet 895Cxi</entry></row>
  900 <row><entry><literal>gs_cdj550</literal></entry><entry>HP DeskJet 970 </entry></row>
  901 <row><entry><literal>gs_cdj550</literal></entry><entry>HP OfficeJet 590 </entry></row>
  902 <row><entry><literal>gs_cdj550</literal></entry><entry>Olivetti jp450 </entry></row>
  903 <row><entry><literal>gs_cdj550</literal></entry><entry>Xerox XJ6C, PCL and Postscript using GhostScript</entry></row>
  904 <row><entry><literal>gs_cdj850</literal></entry><entry>HP DeskJet 850 </entry></row>
  905 <row><entry><literal>gs_cdj850</literal></entry><entry>HP DeskJet 855 </entry></row>
  906 <row><entry><literal>gs_cdj850</literal></entry><entry>HP DeskJet 870Cse </entry></row>
  907 <row><entry><literal>gs_cdj850</literal></entry><entry>HP DeskJet 870Cxi </entry></row>
  908 <row><entry><literal>gs_cdj850</literal></entry><entry>HP DeskJet 890C </entry></row>
  909 <row><entry><literal>gs_cdj850</literal></entry><entry>HP DeskJet 670C </entry></row>
  910 <row><entry><literal>gs_cdj850</literal></entry><entry>HP DeskJet 680 </entry></row>
  911 <row><entry><literal>gs_cdeskjet</literal></entry><entry>HP DeskJet 500C</entry></row>
  912 <row><entry><literal>gs_cdjmono</literal></entry><entry>HP DeskJet 500C </entry></row>
  913 <row><entry><literal>gs_cdjmono</literal></entry><entry>HP DeskJet 510 </entry></row>
  914 <row><entry><literal>gs_cdjmono</literal></entry><entry>HP DeskJet 520 </entry></row>
  915 <row><entry><literal>gs_cdjmono</literal></entry><entry>HP DeskJet 540C </entry></row>
  916 <row><entry><literal>gs_cdjmono</literal></entry><entry>HP DeskJet 693C </entry></row>
  917 <row><entry><literal>gs_epsonc</literal></entry><entry>Fujitsu DL-1100 </entry></row>
  918 <row><entry><literal>gs_epsonc</literal></entry><entry>Fujitsu DL-2400 </entry></row>
  919 <row><entry><literal>gs_hl7x0</literal></entry><entry>Brother HL-720 </entry></row>
  920 <row><entry><literal>gs_hl7x0</literal></entry><entry>Brother HL-730 </entry></row>
  921 <row><entry><literal>gs_laserjet</literal></entry><entry>Bull Compuprint Pagemaster 415 </entry></row>
  922 <row><entry><literal>gs_lips3</literal></entry><entry>Canon LBP4+</entry></row>
  923 <row><entry><literal>gs_lj4dith</literal></entry><entry>HP DeskJet 600 </entry></row>
  924 <row><entry><literal>gs_ljet2</literal></entry><entry>HP LaserJet II </entry></row>
  925 <row><entry><literal>gs_ljet2</literal></entry><entry>Xerox 4030 - PCL,  PostScript support using GhostScript</entry></row>
  926 <row><entry><literal>gs_ljet3</literal></entry><entry>Tandy LP800 With LaserJet III emulation. </entry></row>
  927 <row><entry><literal>gs_ljet4</literal></entry><entry>Brother HL-660 </entry></row>
  928 <row><entry><literal>gs_ljet4</literal></entry><entry>Brother HL-760 600dpi </entry></row>
  929 <row><entry><literal>gs_ljet4</literal></entry><entry>Epson EPL5700 300dpi OK</entry></row>
  930 <row><entry><literal>gs_ljet4</literal></entry><entry>HP DeskJet 600 margins wrong </entry></row>
  931 <row><entry><literal>gs_ljet4</literal></entry><entry>HP DeskJet 870Cse </entry></row>
  932 <row><entry><literal>gs_ljet4</literal></entry><entry>HP LaserJet 5 300dpi or 600dpi </entry></row>
  933 <row><entry><literal>gs_ljet4</literal></entry><entry>HP LaserJet 5L 300dpi or 600dpi</entry></row>
  934 <row><entry><literal>gs_ljet4</literal></entry><entry>HP LaserJet 6L 600dpi</entry></row>
  935 <row><entry><literal>gs_ljet4</literal></entry><entry>HP LaserJet 1100 600dpi OK. </entry></row>
  936 <row><entry><literal>gs_ljet4</literal></entry><entry>IBM Network Printer 17 </entry></row>
  937 <row><entry><literal>gs_ljet4</literal></entry><entry>IBM/Lexmark 4029 Margins wrong. </entry></row>
  938 <row><entry><literal>gs_ljet4</literal></entry><entry>Lexmark Optra E+ </entry></row>
  939 <row><entry><literal>gs_ljet4</literal></entry><entry>Lexmark Optra SC 1275 B/W only. </entry></row>
  940 <row><entry><literal>gs_ljet4</literal></entry><entry>Oki OL410ex LED printer 300dpi or 600dpi </entry></row>
  941 <row><entry><literal>gs_ljetplus</literal></entry><entry>HP LaserJet Plus </entry></row>
  942 <row><entry><literal>gs_ljetplus</literal></entry><entry>Canon Laser LBP-600 </entry></row>
  943 <row><entry><literal>gs_ljetplus</literal></entry><entry>NEC SuperScript 860 </entry></row>
  944 <row><entry><literal>gs_pjxl300</literal></entry><entry>HP PaintJet XL300 </entry></row>
  945 <row><entry><literal>gs_pjxl300</literal></entry><entry>HP DeskJet 600</entry></row>
  946 <row><entry><literal>gs_pjxl300</literal></entry><entry>HP DeskJet 1200C </entry></row>
  947 <row><entry><literal>gs_pjxl300</literal></entry><entry>HP DeskJet 1600C</entry></row>
  948 <row><entry><literal>gs_r4081</literal></entry><entry>Ricoh 4081 laser printer </entry></row>
  949 <row><entry><literal>gs_r4081</literal></entry><entry>Ricoh 6000 laser printer </entry></row>
  950 <row><entry><literal>bjc610a0.upp</literal></entry><entry>Canon BubbleJet BJC-610 (color, rendered) 360x360dpi plain paper, high speed</entry></row>
  951 <row><entry><literal>bjc610a1.upp</literal></entry><entry>Canon BubbleJet BJC-610 (color, rendered) 360x360dpi plain paper</entry></row>
  952 <row><entry><literal>bjc610a2.upp</literal></entry><entry>Canon BubbleJet BJC-610 (color, rendered) 360x360dpi coated paper</entry></row>
  953 <row><entry><literal>bjc610a3.upp</literal></entry><entry>Canon BubbleJet BJC-610 (color, rendered) 360x360dpi transparency film</entry></row>
  954 <row><entry><literal>bjc610a4.upp</literal></entry><entry>Canon BubbleJet BJC-610 (color, rendered) 360x360dpi back print film</entry></row>
  955 <row><entry><literal>bjc610a5.upp</literal></entry><entry>Canon BubbleJet BJC-610 (color, rendered) 360x360dpi fabric sheet</entry></row>
  956 <row><entry><literal>bjc610a6.upp</literal></entry><entry>Canon BubbleJet BJC-610 (color, rendered) 360x360dpi glossy paper</entry></row>
  957 <row><entry><literal>bjc610a7.upp</literal></entry><entry>Canon BubbleJet BJC-610 (color, rendered) 360x360dpi high gloss film</entry></row>
  958 <row><entry><literal>bjc610a8.upp</literal></entry><entry>Canon BubbleJet BJC-610 (color, rendered) 360x360dpi high resolution paper</entry></row>
  959 <row><entry><literal>bjc610b1.upp</literal></entry><entry>Canon BubbleJet BJC-610 (color, rendered) 720x720dpi plain paper</entry></row>
  960 <row><entry><literal>bjc610b2.upp</literal></entry><entry>Canon BubbleJet BJC-610 (color, rendered) 720x720dpi coated paper</entry></row>
  961 <row><entry><literal>bjc610b3.upp</literal></entry><entry>Canon BubbleJet BJC-610 (color, rendered) 720x720dpi transparency film</entry></row>
  962 <row><entry><literal>bjc610b4.upp</literal></entry><entry>Canon BubbleJet BJC-610 (color, rendered) 720x720dpi back print film</entry></row>
  963 <row><entry><literal>bjc610b6.upp</literal></entry><entry>Canon BubbleJet BJC-610 (color, rendered) 720x720dpi glossy paper</entry></row>
  964 <row><entry><literal>bjc610b7.upp</literal></entry><entry>Canon BubbleJet BJC-610 (color, rendered) 720x720dpi high-gloss paper</entry></row>
  965 <row><entry><literal>bjc610b8.upp</literal></entry><entry>Canon BubbleJet BJC-610 (color, rendered) 720x720dpi high resolution paper</entry></row>
  966 <row><entry><literal>cdj550.upp</literal></entry><entry>HP DeskJet 550C 300x300dpi 32-bit CMYK</entry></row>
  967 <row><entry><literal>necp2x.upp</literal></entry><entry>NEC P2X 360x360dpi 8-bit (Floyd-Steinberg)</entry></row>
  968 <row><entry><literal>stcany.upp</literal></entry><entry>Epson Stylus Color (Any) 360x360dpi 4-bit, PostScript halftoning</entry></row>
  969 <row><entry><literal>stc.upp</literal></entry><entry>Epson Stylus (Original) and Stylus Pro Color 360x360dpi 32-bit CMYK, 15-pin </entry></row>
  970 <row><entry><literal>stc_l.upp</literal></entry><entry>Epson Stylus (Original) and Stylus Pro Color 360x360dpi 4-bit, PostScript halftoning, weaved noWeave</entry></row>
  971 <row><entry><literal>stc_h.upp</literal></entry><entry>Epson Stylus (Original) and Stylus Pro Color 720x720dpi 32-bit CMYK, 15-pin Weave</entry></row>
  972 <row><entry><literal>stc2.upp</literal></entry><entry>Epson Stylus (Original) and Stylus Pro Color 360x360dpi 32-bit CMYK, 20-pin, Epson Stylus Color II(s)</entry></row>
  973 <row><entry><literal>stc2_h.upp</literal></entry><entry>Epson Stylus (Original) and Stylus Pro Color 720x720dpi 32-bit CMYK, 20-pin, Epson Stylus Color II </entry></row>
  974 <row><entry><literal>stc2s_h.upp</literal></entry><entry>Epson Stylus (Original) and Stylus Pro Color 720x720dpi 32-bit CMYK, 20-pin, Epson Stylus Color IIs</entry></row>
  975 <row><entry><literal>stc500p.upp</literal></entry><entry>Epson Stylus Color 500 360x360dpi 32-bit CMYK, noWeave, plain paper</entry></row>
  976 <row><entry><literal>stc500ph.upp</literal></entry><entry>Epson Stylus Color 500 720x720dpi 32-bit CMYK, noWeave, plain paper</entry></row>
  977 <row><entry><literal>stc600pl.upp</literal></entry><entry>Epson Stylus Color 600, 360x360dpi, 32/90-inch weaving 32-bit CMYK, 32-pin, plain paper</entry></row>
  978 <row><entry><literal>stc600p.upp</literal></entry><entry>Epson Stylus Color 600, 720x720dpi, 32/90-inch weaving 32-bit CMYK, 32-pin, plain paper</entry></row>
  979 <row><entry><literal>stc600ih.upp</literal></entry><entry>Epson Stylus Color 600, 1440x720dpi, 32/90-inch weaving 32-bit CMYK, 30-pin, inkjet paper</entry></row>
  980 <row><entry><literal>stc800pl.upp</literal></entry><entry>Epson Stylus Color 800, 64/180-inch weaving 360x360dpi 32-bit CMYK, 64-pin, plain paper</entry></row>
  981 <row><entry><literal>stc800p.upp</literal></entry><entry>Epson Stylus Color 800, 64/180-inch weaving 720x720dpi 32-bit CMYK, 64-pin, plain paper </entry></row>
  982 <row><entry><literal>stc800ih.upp</literal></entry><entry>Epson Stylus Color 800, 64/180-inch weaving 1440x720dpi 32-bit CMYK, 62-pin, inkjet paper</entry></row>
  983 <row><entry><literal>stc1520h.upp</literal></entry><entry>Epson Stylus Color 800, 64/180-inch weaving 1440x720dpi 32-bit CMYK, 62-pin, inkjet paper</entry></row>
  984 <row><entry><literal>imagerunner550</literal></entry><entry>Canon imageRUNNER 550/600 iR600-550-60 </entry></row>
  985 <row><entry><literal>imagerunner600</literal></entry><entry>Canon imageRUNNER 550/600 iR600-550-60 </entry></row>
  986 <row><entry><literal>hpdj800ps</literal></entry><entry>HP DesignJet 800ps</entry></row>
  987 <row><entry><literal>panther</literal></entry><entry>Sharp Generic Panther Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
  988 <row><entry><literal>ar-160</literal></entry><entry>Sharp %, Panther Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
  989 <row><entry><literal>ar-161</literal></entry><entry>Sharp %, Panther Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
  990 <row><entry><literal>ar-162</literal></entry><entry>Sharp %, Panther Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
  991 <row><entry><literal>ar-162s</literal></entry><entry>Sharp %, Panther Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
  992 <row><entry><literal>ar-163</literal></entry><entry>Sharp %, Panther Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
  993 <row><entry><literal>ar-164</literal></entry><entry>Sharp %, Panther Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
  994 <row><entry><literal>ar-200</literal></entry><entry>Sharp %, Panther Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
  995 <row><entry><literal>ar-200s</literal></entry><entry>Sharp %, Panther Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
  996 <row><entry><literal>ar-201</literal></entry><entry>Sharp %, Panther Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
  997 <row><entry><literal>ar-205</literal></entry><entry>Sharp %, Panther Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
  998 <row><entry><literal>ar-206</literal></entry><entry>Sharp %, Panther Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
  999 <row><entry><literal>ar-207</literal></entry><entry>Sharp %, Panther Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
 1000 <row><entry><literal>ar-f201</literal></entry><entry>Sharp %, Panther Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
 1001 <row><entry><literal>cougar</literal></entry><entry>Sharp Generic Cougar Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
 1002 <row><entry><literal>ar-335</literal></entry><entry>Sharp %, Cougar Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
 1003 <row><entry><literal>ar-336</literal></entry><entry>Sharp %, Cougar Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
 1004 <row><entry><literal>ar-337</literal></entry><entry>Sharp %, Cougar Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
 1005 <row><entry><literal>ar-s337</literal></entry><entry>Sharp %, Cougar Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
 1006 <row><entry><literal>ar-405</literal></entry><entry>Sharp %, Cougar Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
 1007 <row><entry><literal>ar-407</literal></entry><entry>Sharp %, Cougar Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
 1008 <row><entry><literal>ar-505</literal></entry><entry>Sharp %, Cougar Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
 1009 <row><entry><literal>ar-s505</literal></entry><entry>Sharp %, Cougar Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
 1010 <row><entry><literal>ar-507</literal></entry><entry>Sharp %, Cougar Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
 1011 <row><entry><literal>ar-s507</literal></entry><entry>Sharp %, Cougar Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
 1012 <row><entry><literal>ar-250</literal></entry><entry>Sharp %, Cougar Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
 1013 <row><entry><literal>ar-280</literal></entry><entry>Sharp %, Cougar Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
 1014 <row><entry><literal>ar-281</literal></entry><entry>Sharp %, Cougar Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
 1015 <row><entry><literal>ar-285</literal></entry><entry>Sharp %, Cougar Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
 1016 <row><entry><literal>ar-286</literal></entry><entry>Sharp %, Cougar Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
 1017 <row><entry><literal>leopard</literal></entry><entry>Sharp Generic Leopard Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
 1018 <row><entry><literal>ar-235</literal></entry><entry>Sharp %s, Leopard Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
 1019 <row><entry><literal>ar-275</literal></entry><entry>Sharp %s, Leopard Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
 1020 <row><entry><literal>ar-n275</literal></entry><entry>Sharp %s, Leopard Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
 1021 <row><entry><literal>ar-m208</literal></entry><entry>Sharp %s, Leopard Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
 1022 <row><entry><literal>tiger</literal></entry><entry>Sharp Generic Tiger Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
 1023 <row><entry><literal>ar-p350</literal></entry><entry>Sharp %, Tiger Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
 1024 <row><entry><literal>ar-m350</literal></entry><entry>Sharp %, Tiger Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
 1025 <row><entry><literal>ar-m350u</literal></entry><entry>Sharp %, Tiger Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
 1026 <row><entry><literal>ar-m350n</literal></entry><entry>Sharp %, Tiger Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
 1027 <row><entry><literal>ar-p450</literal></entry><entry>Sharp %, Tiger Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
 1028 <row><entry><literal>ar-m450</literal></entry><entry>Sharp %, Tiger Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
 1029 <row><entry><literal>ar-m450u</literal></entry><entry>Sharp %, Tiger Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
 1030 <row><entry><literal>ar-m450n</literal></entry><entry>Sharp %, Tiger Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
 1031 <row><entry><literal>toshiba650</literal></entry><entry>Sharp Generic Toshiba650 Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
 1032 <row><entry><literal>ar-650</literal></entry><entry>Sharp %, Toshiba650 Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
 1033 <row><entry><literal>ar-800</literal></entry><entry>Sharp %, Toshiba650 Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
 1034 <row><entry><literal>fiery651</literal></entry><entry>Sharp Generic Fiery651 Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
 1035 <row><entry><literal>ar-651</literal></entry><entry>Sharp %, Fiery651 Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
 1036 <row><entry><literal>ar-810</literal></entry><entry>Sharp %, Fiery651 Family, PS and PCL, uses SNMP for status and pagecount</entry></row>
 1037 </tbody>
 1038 </tgroup>
 1039 </table>
 1040 <!-- SUPPORTED END -->
 1041 </para>
 1042 
 1043 <para>
 1044 If your printer is not in this this list
 1045 then you can use the following guidelines.
 1046 If you have a PostScript only printer
 1047 you should use the <literal>ps</literal> model.
 1048 If you have a PCL only printer,
 1049 then <literal>pcl</literal> is recommended.
 1050 If you want to process PostScript files on your PCL only printer
 1051 then install GhostScript
 1052 and use <symbol>pcl_ps</symbol> entry
 1053 and select the GhostScript driver suitable for your printer.
 1054 </para>
 1055 
 1056 <para>The other model entries are used when specific printer
 1057 functionality or features are needed.
 1058 For example,
 1059 if you want to do accounting or use <emphasis remap=it>landscape</emphasis> mode,
 1060 then you should check for your specific printer model in the
 1061 configuration file.</para>
 1062 
 1063 </sect1>
 1064 </chapter>
 1065 
 1066 <chapter>
 1067 <title>Recommended -Z options for Users</title>
 1068 
 1069 <para>Due to the general nature of the &IFHP; filter,
 1070 there is no standard set of <option>-Z</option> user options because there
 1071 is no standard set of user facilities.
 1072 However,
 1073 the following are recommended for
 1074 use by implementors of new configurations or printer support.</para>
 1075 
 1076 
 1077 <sect1>
 1078 <title>Input Tray Selection</title>
 1079 
 1080 <para>If a printer supports an input tray selection
 1081 mechanism,
 1082 then the following options are recommended for use.
 1083 Local conditions or printer type may require addition
 1084 options.
 1085 <variablelist>
 1086 <varlistentry><term><literal>inupper, inlower, intray1, intray2, ..., manual, envelope</literal></term>
 1087 <listitem>
 1088 <para>The input tray selection options should start with the <literal>in</literal> prefix
 1089 and correspond to the various trays, if possible.
 1090 The <literal>manual</literal> and <literal>envelope</literal>
 1091 options are included to select manual feed or envelope feed.
 1092 There is a possible source of conflict here as there
 1093 may be an envelope feeder as well as an envelope media.
 1094 This is a printer specific dependency.</para>
 1095 
 1096 </listitem>
 1097 </varlistentry>
 1098 
 1099 <varlistentry><term><literal>source=name</literal></term>
 1100 
 1101 <listitem>
 1102 <para>The <literal>key=value</literal>
 1103 form allows users to use options such as <literal>-Zsource=inbin1</literal>,
 1104 which may be useful for systems that have an unusual or nonstandard
 1105 input selection mechanism.</para>
 1106 
 1107 </listitem>
 1108 </varlistentry>
 1109 </variablelist>
 1110 </para>
 1111 
 1112 </sect1>
 1113 
 1114 <sect1>
 1115 <title>Output Bin Selection</title>
 1116 
 1117 <para>If a printer has an output bin selection mechanism
 1118 or some other finishing mechanism,
 1119 then the following are recommended for use.</para>
 1120 
 1121 <para>
 1122 <variablelist>
 1123 <varlistentry><term><literal>outupper, outlower, outbin1, ...</literal></term>
 1124 <listitem>
 1125 <para>The output bin selection should start with the <literal>out</literal> prefix.</para>
 1126 
 1127 </listitem>
 1128 </varlistentry>
 1129 
 1130 <varlistentry><term><literal>outbin=name</literal></term>
 1131 
 1132 <listitem>
 1133 <para>The <literal>outbin=name</literal>
 1134 form allow users to use options such as <literal>-Zoutbin=stapler</literal>,
 1135 which may be useful for systems that have an unusual or nonstandard
 1136 output selection mechanism.</para>
 1137 
 1138 </listitem>
 1139 </varlistentry>
 1140 </variablelist>
 1141 </para>
 1142 
 1143 </sect1>
 1144 
 1145 <sect1>
 1146 <title>Media Size (Paper) Selection</title>
 1147 
 1148 <para>The paper size selection facilities usually are quite printer
 1149 dependent,
 1150 and the input tray selection and paper size selection mechanisms
 1151 may interact in strange and mysterious ways.</para>
 1152 
 1153 <para>
 1154 <variablelist>
 1155 <varlistentry><term><literal>letter, legal, ledger, oversize, a0, a1, ...</literal></term>
 1156 <listitem>
 1157 <para>These are standard paper size names.</para>
 1158 
 1159 </listitem>
 1160 </varlistentry>
 1161 
 1162 <varlistentry><term><literal>11x17, tabloid</literal></term>
 1163 
 1164 <listitem>
 1165 <para>These are usually aliases for ledger,
 1166 but depending on local conditions can select different types of paper.</para>
 1167 
 1168 </listitem>
 1169 </varlistentry>
 1170 
 1171 <varlistentry><term><literal>paper=name</literal></term>
 1172 
 1173 <listitem>
 1174 <para>The <literal>paper=name</literal>
 1175 form allow users to use options such as <literal>-Zpaper=b3</literal>,
 1176 which may be useful for systems that have an unusual or nonstandard
 1177 input media selection mechanism.</para>
 1178 
 1179 </listitem>
 1180 </varlistentry>
 1181 </variablelist>
 1182 </para>
 1183 
 1184 </sect1>
 1185 
 1186 <sect1>
 1187 <title>Media Type Selection</title>
 1188 
 1189 <para>Media Type is not the same as paper size,
 1190 and corresponds to the name assigned to a particular media.
 1191 Of course,
 1192 the issue is complicated by the fact that some media have
 1193 standard sizes as well.
 1194 Again,
 1195 the input tray selection,
 1196 media size,
 1197 and media type selection will interact in confusing and
 1198 mysterious ways,
 1199 depending on the whim of the printer firmware implementors.</para>
 1200 
 1201 <para>You will also notice that there is no general
 1202 <literal>mediatype=name</literal>
 1203 selection mechanism.
 1204 This is due to the extremely different way that the media names
 1205 must be passed for PostScript,
 1206 PJL, and PCL.</para>
 1207 
 1208 <para>
 1209 <variablelist>
 1210 <varlistentry><term><literal>plain, preprinted, letterhead, transparency, glossy, prepunched, labels</literal></term>
 1211 <listitem>
 1212 <para>These are commonly used media type names gleaned from various PostScript Printer
 1213 Description Files,
 1214 Microsoft printer drivers,
 1215 and arcane lore of the Printer Working Group.
 1216 Note that these are not accepted terms in the paper industry
 1217 for any of these type of media.
 1218 You are warned.</para>
 1219 
 1220 </listitem>
 1221 </varlistentry>
 1222 </variablelist>
 1223 </para>
 1224 
 1225 </sect1>
 1226 
 1227 <sect1>
 1228 <title>Duplex and Simplex</title>
 1229 
 1230 <para>Duplex printing is when impressions are placed on both sides
 1231 of a sheet of media.
 1232 Due to a general lack of conventions,
 1233 the orientation of each of the impressions varies from vendor
 1234 to vendor,
 1235 and has changed over the years.</para>
 1236 
 1237 <para>
 1238 <variablelist>
 1239 <varlistentry><term><literal>duplex, lduplex</literal></term>
 1240 <listitem>
 1241 <para>Print on both sides using the default orientation.
 1242 The <literal>lduplex</literal> is an alias for <literal>duplex</literal></para>
 1243 
 1244 </listitem>
 1245 </varlistentry>
 1246 
 1247 <varlistentry><term><literal>duplexshort, sduplex</literal></term>
 1248 
 1249 <listitem>
 1250 <para>Print on both sides but reverse the orientation of one page.
 1251 The <literal>sduplex</literal> is an alias for <literal>duplexshort</literal>
 1252 Which page is reversed is at the whim of the firmware implementors and
 1253 conventions for the printer.</para>
 1254 
 1255 </listitem>
 1256 </varlistentry>
 1257 
 1258 <varlistentry><term><literal>simplex</literal></term>
 1259 
 1260 <listitem>
 1261 <para>Print on a single side of a page</para>
 1262 
 1263 </listitem>
 1264 </varlistentry>
 1265 
 1266 <varlistentry><term><literal>tumble, shortedge</literal></term>
 1267 
 1268 <listitem>
 1269 <para>This is use to print a single page on one side of the media,
 1270 but using the (nonstandard) orientation for the <literal>duplexshort</literal>.
 1271 This is usually done when a single impression must be generated
 1272 on the alternative side of the media,
 1273 rather than the default side.
 1274 Again,
 1275 this is dependent on the whims and whimsies of the printer
 1276 firmware implementors,
 1277 and may have some unexpected side effects.</para>
 1278 
 1279 </listitem>
 1280 </varlistentry>
 1281 </variablelist>
 1282 </para>
 1283 
 1284 </sect1>
 1285 
 1286 <sect1>
 1287 <title>Copies</title>
 1288 
 1289 <para>This option has been provided to effectively allow the printer to
 1290 make multiple copies of a single page or job.
 1291 This option tends to be misimplemented on almost all known printers,
 1292 and it is strongly recommended that users do not use it.
 1293 However,
 1294 for completeness,
 1295 compatibility,
 1296 and implementor consideration,
 1297 this is included,
 1298 even against the better judgement of the implementors of the &IFHP;
 1299 software.
 1300 <variablelist>
 1301 <varlistentry><term><literal>copies=nnn</literal></term>
 1302 <listitem>
 1303 <para>Attempt to make <literal>nnn</literal> copies of each impression.
 1304 This usually fails with catastrophic problems unless you have
 1305 a system that supports all of the various options required,
 1306 has enough memory to handle rasterization,
 1307 you do not have a paper outage,
 1308 and the printer does not stop with operator intervention.
 1309 You have been warned.</para>
 1310 
 1311 </listitem>
 1312 </varlistentry>
 1313 </variablelist>
 1314 </para>
 1315 
 1316 </sect1>
 1317 </chapter>
 1318 
 1319 <chapter>
 1320 <title>Printer Capabilities, Configurations, and Printcaps</title>
 1321 
 1322 <para>One of the major difficulties with printer software
 1323 is dealing with the wide range of different printer hardware configurations
 1324 and printer connections.
 1325 This section outlines the printer communication methods,
 1326 the types of print job languages,
 1327 and the effects of these on printing software and the &IFHP;
 1328 filter.</para>
 1329 
 1330 
 1331 <sect1>
 1332 <title>Printer Configurations</title>
 1333 
 1334 <para>A printer consists of a hardware print engine which marks the output page
 1335 and delivers it,
 1336 a set of control hardware that takes a <emphasis remap=it>print job</emphasis>
 1337 in a well defined format and operates the hardware to produce output
 1338 according to information in the <emphasis remap=it>print job</emphasis>,
 1339 and a communication channel from the computer to the control hardware.
 1340 The control hardware is sometimes called a <emphasis remap=it>print engine</emphasis>.
 1341 In most modern computers the control hardware may consist of multiple microprocessors,
 1342 each with their own firmware,
 1343 and each performing a specific printing task.
 1344 For example,
 1345 one may control the paper feed path,
 1346 one may do rasterization,
 1347 and one may handle communications with the outside world.</para>
 1348 
 1349 <para>In order to set up printing correctly,
 1350 it is necessary to know the following information about your printer.
 1351 <orderedlist>
 1352 
 1353 <listitem>
 1354 <para>The capabilities of the hardware.
 1355 This is dependent on the model of printer,
 1356 and may be such things as the page feed,
 1357 output and input tray selection,
 1358 numbers of columns and/or rows of output available on the output device.
 1359 This information is readily available from most manufacturers.</para>
 1360 </listitem>
 1361 
 1362 <listitem>
 1363 <para>The <emphasis remap=it>print job language</emphasis>
 1364 recognized by the control hardware.
 1365 This is the special set of codes,
 1366 commands, and formats recognized by the control hardware.</para>
 1367 </listitem>
 1368 
 1369 <listitem>
 1370 <para>The protocol used to send jobs to the printer and obtain status
 1371 about the printing activity.</para>
 1372 </listitem>
 1373 
 1374 </orderedlist>
 1375 </para>
 1376 
 1377 <para>Usually the capabilities of a modern printer are very well known
 1378 and documented,
 1379 and the &IFHP; filter and most print spooling software has
 1380 little difficulty working with them.</para>
 1381 
 1382 <para>The following checklist will help you in setting up your printer.
 1383 The various options that you will need to know about are indicated
 1384 where appropriate.
 1385 <orderedlist>
 1386 
 1387 <listitem>
 1388 <para>Printer Model (<literal>model=???</literal>)
 1389 What is the exact printer model?
 1390 Check the serial number or other identification to get this information.
 1391 You should check the <filename>ifhp.conf</filename>
 1392 configuration file to see if your printer is already supported.</para>
 1393 </listitem>
 1394 
 1395 <listitem>
 1396 <para>Print Languages Supported By Your Printer
 1397 <orderedlist>
 1398 
 1399 <listitem>
 1400 <para>PJL? (<literal>pjl</literal> or <literal>pjl@</literal>)
 1401 The Printer Job Language (PJL) is a high level language supported by many Hewlett-Packard
 1402 printers that allows some print system configuration to be performed.
 1403 Due to historical developments,
 1404 not all printers support all PJL language facilities,
 1405 and some support them in different ways than other printers.
 1406 The &IFHP; filter can use the PJL support for a printer if it is available.</para>
 1407 </listitem>
 1408 
 1409 <listitem>
 1410 <para>PostScript (and what version)?  (<literal>ps</literal> or <literal>ps@</literal>)
 1411 PostScript is the most common print job language in use.
 1412 If your printer supports PostScript,
 1413 then you will have a relatively trouble free time with it.
 1414 One problem is that it requires a fairly substantial amount of
 1415 memory and computational support,
 1416 and is usually not found on the low end (less than $500) printers.</para>
 1417 </listitem>
 1418 
 1419 <listitem>
 1420 <para>PCL? (<literal>pcl</literal> or <literal>pcl@</literal>)
 1421 PCL is another Print Language supported by
 1422 many vendors, including Hewlett-Packard,
 1423 Lexmark, and others.
 1424 It is essentially text with escape sequences to tell the print engine
 1425 to place markings on a page at specific places in a specific font.
 1426 It is the second most common format used with modern printers.</para>
 1427 </listitem>
 1428 
 1429 <listitem>
 1430 <para>Text? (<literal>text</literal> or <literal>text@</literal>)
 1431 Text is really just PCL without any control sequences.
 1432 However, it is easy to have &IFHP; convert ordinary text into PCL
 1433 by prefixing the appropriate PCL control codes.
 1434 You may also need to use the <literal>crlf</literal> option to force
 1435 <acronym>CR</acronym> to <literal>CR-LF</literal> translation.
 1436 If you have a simple text printer then you may want to use the much
 1437 easier to configure <application>lpf</application> filter from the &LPRng; distribution
 1438 (<ulink URL="http://www.lprng.com">http://www.lprng.com</ulink>).</para>
 1439 </listitem>
 1440 
 1441 <listitem>
 1442 <para>Vendor Specific
 1443 There is a growing trend to have very proprietary Print Languages
 1444 for very low end  (less than $300) printers.
 1445 These printers usually require all of their jobs to be preformated by
 1446 software running on the host and to have the job delivered to them
 1447 in a specific manner.
 1448 If you have one of these printers,
 1449 you will need to get a rasterizing program that produces the correct format.
 1450 Check to see if
 1451 <link linkend="ghostscript">GhostScript</link>,
 1452 supports your printer.
 1453 If it does then you can use <literal>GhostScript</literal> to translate
 1454 PostScript to your printer's required format.</para>
 1455 </listitem>
 1456 
 1457 </orderedlist>
 1458 </para>
 1459 </listitem>
 1460 
 1461 <listitem>
 1462 <para>Memory Size.
 1463 If you are going to be sending large print jobs or ones with a large
 1464 amount of graphics to the printer, you will need a substantial amount
 1465 of memory to deal with rasterization.
 1466 Most high resolution Laser Copier based printers require a minimum of
 1467 16 megabytes for adequate performance,
 1468 and if you are printing complex PostScript or PDF documents you
 1469 may want at least 32 megabytes.
 1470 Color printers require substantially more and 64 megabytes is not uncommon.</para>
 1471 </listitem>
 1472 
 1473 <listitem>
 1474 <para>Communications.
 1475 The connection between your printer
 1476 and the host computer.
 1477 <orderedlist>
 1478 
 1479 <listitem>
 1480 <para>Network Connection
 1481 This is the most reliable and high speed way to connect a printer
 1482 to a system.
 1483 This is especially true if a printer must be accessible to multiple
 1484 users and is located at a distance from the user.</para>
 1485 </listitem>
 1486 
 1487 <listitem>
 1488 <para>Parallel Port (<literal>status@</literal>)
 1489 The parallel port is a <emphasis>unidirectional</emphasis> communications channel
 1490 and does not do full duplex bidirectional communications.
 1491 Some operating system support bidirectional communications,
 1492 but they do so by requiring write operations to alternate with read operations.
 1493 </para>
 1494 </listitem>
 1495 
 1496 <listitem>
 1497 <para>Serial Ports
 1498 This is the very worst way to communicate at high speed with a printer.
 1499 Serial ports usually have a high error rate,
 1500 suffer from data overruns,
 1501 and have a severe impact on system performance.
 1502 You will need to configure your printer speed,
 1503 format (bits per character, parity, stop bit),
 1504 and flow control method,
 1505 and then do the same for the host.
 1506 This can be an endless source of frustration for the novice user.</para>
 1507 </listitem>
 1508 
 1509 <listitem>
 1510 <para>Print Server Box
 1511 Many older printers do not directly support a network connection
 1512 and have an external <emphasis remap=it>print server box</emphasis> attached to either their
 1513 serial or parallel ports.
 1514 If you have the printer connected to a parallel port,
 1515 then you will still most likely only have unidirectional communication
 1516 and no status information will be available from the printer.</para>
 1517 </listitem>
 1518 
 1519 </orderedlist>
 1520 </para>
 1521 </listitem>
 1522 
 1523 </orderedlist>
 1524 </para>
 1525 
 1526 </sect1>
 1527 
 1528 <sect1
 1529 id="networkprotocols">
 1530 <title>Network Communication Protocols
 1531 </title>
 1532 
 1533 <para>The most high speed and reliable connection to your printer is using a
 1534 network connection.
 1535 The following protocols are usually used to communicate with a network printer:
 1536 RFC1179 (TCP/IP printing),
 1537 Socket Protocol (TCP/IP),
 1538 AppSocket Protocol (TCP/IP),
 1539 Novell Print Protocol (IPX),
 1540 SMB Print Protocol (TCP/IP),
 1541 and AppleTalk Print Protocol (TCP/IP).</para>
 1542 
 1543 <para>It is highly recommended that you use TCP/IP networking to communications to
 1544 talk to your printer,
 1545 and that you do not enable any other protocol on your printer.
 1546 If you have two different systems trying to connect to the same printer
 1547 using different protocols,
 1548 a wide range of vendor's hardware will lock up and may require a power up reset
 1549 to recover.
 1550 Documented evidence for this behavior includes a wide range of
 1551 printers, including those from Hewlett-Packard, LexMark, IBM and other vendors.</para>
 1552 
 1553 <para>Only the TCP/IP based network job transfer protocols are discussed in
 1554 this document.
 1555 For details on using other protocols,
 1556 please consult the consult the
 1557 <ulink URL="http://www.lprng.com">&LPRng;</ulink>
 1558 documentation.</para>
 1559 
 1560 </sect1>
 1561 
 1562 <sect1
 1563 id="rfc1179pc">
 1564 <title>RFC1179 (BSD or TCP/IP) Job Transfer Printcap Entry
 1565 </title>
 1566 
 1567 <para>RFC1179 is used to transfer print jobs between
 1568 a client (user) and a print spooler,
 1569 or between two print spoolers.
 1570 Jobs are transferred as a set of files,
 1571 and the only information exchanged during the transfer process is the
 1572 success or failure of the transfer.
 1573 In order to get status about the actual job printing,
 1574 a separate query status (<application>lpq</application>) is sent to the print spooler.</para>
 1575 
 1576 <para>Many,
 1577 if not all,
 1578 printers with a network interface that supports the TCP/IP protocol support
 1579 the RFC1179 protocol for job transfer.
 1580 However,
 1581 their support for print job status is usually minimal to non-existent.
 1582 If you want to send a job to a printer using the RFC1179 protocol,
 1583 please be aware of the following problems.</para>
 1584 
 1585 <para>Normally a print spooler (System 5 lp, BSD lpd, &LPRng;)
 1586 does not modify a print job when forwarding it to another print spooler.
 1587 This means that your print job will normally pass from the originating
 1588 <application>lp</application>
 1589 or <application remap=tt>lpr</application> program to the destination printer with no changes.
 1590 This can have disastrous results if the job
 1591 <emphasis remap=bf>requires</emphasis>
 1592 filter processing.</para>
 1593 
 1594 <para>If you are using the &LPRng; print spooler,
 1595 job transfers using <literal>RFC1179</literal>
 1596 is specified by using <literal>:lp=spoolqueue@host</literal>
 1597 or <literal>:rp=spoolqueue:rm=host</literal> printcap entries.
 1598 For example:
 1599 <informalexample>
 1600 <screen>raw:
 1601   :lp=raw@host
 1602   :sh:sf:mx=0
 1603   :sd=/var/spool/lp
 1604 cooked:
 1605   :rp=cooked:rm=host
 1606   :sh:sf:mx=0
 1607   :sd=/var/spool/lp
 1608   :filter=/usr/local/libexec/filters/ifhp</screen>
 1609 </informalexample>
 1610 </para>
 1611 
 1612 <para>The
 1613 <literal/raw/
 1614 queue does not have a filter
 1615 and jobs sent to the
 1616 <literal/raw/
 1617 are transfered intact from the
 1618 <literal/raw/ queue to the destination
 1619 <literal/raw/
 1620 printer on the
 1621 <literal/host/
 1622 server.
 1623 </para>
 1624 
 1625 <para>
 1626 Jobs sent to the
 1627 <literal/cooked/
 1628 queue will be processed by the program specified by the
 1629 <literal/filter/
 1630 option.
 1631 For each data file in the job,
 1632 the
 1633 <application/lpd/ print spooler will open a temporary file
 1634 to hold the filter output,
 1635 and then run the filter program with
 1636 its <acronym>STDIN</acronym> set to the job's data file file
 1637 and the <acronym>STDOUT</acronym> set to the temporary file.
 1638 The filter <acronym>STDERR</acronym> will be recorded in
 1639 an error log.
 1640 </para>
 1641 
 1642 <para>When a job is created
 1643 a job format may specified (default is <literal>f</literal>),
 1644 and an filter can be specified to process job files with this format.
 1645 The <literal>:i</literal>&lt;<emphasis remap=it>format</emphasis>&gt;
 1646 option specifies the filter program for use.
 1647 For example,
 1648 you can specify a different filter for the <literal/n/ format as shown
 1649 below.
 1650 The
 1651 <literal/translate_format/ option specifies the resulting
 1652 format for the processed files,
 1653 and uses a format similar to the
 1654 UNIX <literal>try</literal>(1) program.
 1655 In the example,
 1656 it specifies that the output of the
 1657 filter for the
 1658 <literal/n/
 1659 format be renamed as
 1660 <literal/f/.
 1661 <informalexample>
 1662 <screen>
 1663 cooked:
 1664   :rp=cooked:rm=host
 1665   :sh:sf:mx=0
 1666   :sd=/var/spool/lp
 1667   # default filter
 1668   :filter=/usr/local/libexec/filters/ifhp
 1669   # n filter
 1670   :nf=/usr/local/libexec/filters/nfilter
 1671   :translate_format=nf</screen>
 1672 </informalexample>
 1673 </para>
 1674 
 1675 <para>There is a final option that is used
 1676 when rather than having a set of job files forwarded to a printer,
 1677 a single job file is desireable.
 1678 This is usually the case when sending a job to a host or printer
 1679 that has a defective
 1680 RFC1179 spooler implementation,
 1681 and drops or misprints jobs with multiple files in them.
 1682 The
 1683 <literal/lpd_bounce/
 1684 option causes the output of all the filters to be
 1685 put into a single file, and the
 1686 output is then forwarded to the destination.
 1687 You can also use the
 1688 <literal/bq_format/ option to specify the format of the
 1689 job:
 1690 <informalexample>
 1691 <screen>
 1692 cooked:
 1693   :rp=cooked:rm=host
 1694   :sh:sf:mx=0
 1695   :sd=/var/spool/lp
 1696   # default filter
 1697   :filter=/usr/local/libexec/filters/ifhp
 1698   :lpd_bounce
 1699   # output has l (literal) or binary output
 1700   :bq_format=l</screen>
 1701 </informalexample>
 1702 </para>
 1703 
 1704 <para>
 1705 The <command>lpr -l</command> or <command>lpr -b</command>
 1706 flag is used to specify the special <literal>literal</literal>
 1707 or <literal/l/ job format.
 1708 Job that have the <literal>l</literal> format
 1709 usually have only the most perfunctory processing
 1710 done by the filter.
 1711 </para>
 1712 
 1713 </sect1>
 1714 
 1715 <sect1
 1716 id="socketpc">
 1717 <title>Socket Protocol (TCP/IP) Operation Printcap Entry
 1718 </title>
 1719 
 1720 <para>Many printers with a network interface provide
 1721 a TCP/IP port that is a direct connection to the
 1722 internal <emphasis remap=it>print engine</emphasis>.
 1723 If a TCP/IP connection is made to this port
 1724 and a file is sent over this connection,
 1725 then the print engine will process the file.
 1726 More importantly,
 1727 the connection is bidirectional,
 1728 and the printer will report errors and status conditions
 1729 over the connection.
 1730 PJL and PostScript status request commands can be sent to the printer
 1731 and the printer will respond with information.</para>
 1732 
 1733 <para>The &IFHP; filter makes extensive use of this protocol,
 1734 and provides support for status and error reporting.
 1735 In cooperation with the &LPRng; print spooler,
 1736 it will provide a detailed description of the actual print job progress
 1737 and any error conditions that arise.</para>
 1738 
 1739 <para>To use a Socket connection with &LPRng;,
 1740 you use the <literal>:lp=host%port</literal> printcap entry shown below.
 1741 The <application/lpd/ print spooler will open a connection to the
 1742 TCP/IP <literal>port</literal> on <emphasis remap=tt>host</emphasis>
 1743 and passes the (bidirectional) connection to the &IFHP; filter
 1744 on file descriptor 1 (<acronym>STDOUT</acronym>) and the file to be printed on
 1745 file descriptor 0 (<acronym>STDIN</acronym>).
 1746 Errors and status information are reported by the &IFHP; filter
 1747 on file descriptor 2 (<acronym>STDOUT</acronym>) and placed in the error status log by the
 1748 <application/lpd/ print spooler.</para>
 1749 
 1750 <para>The connection made by the <application/lpd/ server
 1751 to the printer is <emphasis>persistent</emphasis> over the entire job;
 1752 all file transfers for the same job are made over the same
 1753 connection.
 1754 This is important as it prevents other printer users
 1755 from <emphasis>hijacking</emphasis> the printer in the middle of print a job
 1756 and getting your job outputs mixed together.</para>
 1757 
 1758 <para>The following is a typical printcap entry using the socket protocol.
 1759 <informalexample>
 1760 <screen>raw:
 1761   :lp=host%9100
 1762   :sh:sf:mx=0
 1763   :sd=/var/spool/lp
 1764   :filter=/usr/local/libexec/filters/ifhp</screen>
 1765 </informalexample>
 1766 </para>
 1767 
 1768 </sect1>
 1769 
 1770 <sect1
 1771 id="appsocketpc">
 1772 <title>Appsocket Protocol (TCP/IP) Operation
 1773 </title>
 1774 
 1775 <para>The Tektronics Phaser Series printers and QMS printers use the
 1776 <emphasis remap=it>Appsocket</emphasis> protocol when sending a job to the printer.
 1777 This protocol uses two ports: a TCP/IP <emphasis remap=it>listening</emphasis> port  which
 1778 accepts TCP/IP connections and a UDP <emphasis remap=it>SNMP query</emphasis> port that
 1779 is used to obtain status information.
 1780 </para>
 1781 
 1782 <para>The Appsocket protocol is (briefly):
 1783 <orderedlist>
 1784 
 1785 <listitem>
 1786 <para>The Simple Network Management Protocol (SNMP) is a UDP protocol.
 1787 A SNMP Query packet containing a request for information is sent to the
 1788 printers SNMP Agent port (port 161), and a reply containing the requested information
 1789 is returned.
 1790 </para>
 1791 </listitem>
 1792 
 1793 <listitem>
 1794 <para> To send a job to the printer,  a TCP/IP connection is opened to the TCP/IP port
 1795 and job data is sent.
 1796 Only a single job can be sent at a time - a EOJ in the job, i.e.-
 1797 CTRL-D for PostScript or ESC E for PCL
 1798 will cause the printer to terminate reading from the TCP/IP port,
 1799 and after job processing has finished,
 1800 to close the TCP/IP connection.
 1801 All input after the EOJ may be ignored by the printer and not processed.</para>
 1802 </listitem>
 1803 
 1804 <listitem>
 1805 <para>While processing the job,
 1806 if <emphasis remap=it>bidirectional</emphasis> support is available
 1807 and has been enabled
 1808 the printer will return job status or information until all of the print job
 1809 which is has received has been processed.
 1810 This support is usually not enabled by default and must be enabled
 1811 by using a specialized administration interface or configuration tool.</para>
 1812 </listitem>
 1813 
 1814 <listitem>
 1815 <para>Unfortunately,
 1816 some printers will also close the connection when the EOJ has been received.
 1817 These printers are virtually useless when trying to get error or status information
 1818 about a job.</para>
 1819 </listitem>
 1820 
 1821 <listitem>
 1822 <para>Even more annoying is the behavior of some printers
 1823 that insist on the network connection remaining open until the job
 1824 has been processed.
 1825 The device sending the job to the printer must do a <emphasis>shutdown</emphasis>
 1826 on the sending direction of the network connection,
 1827 and then read status information from the receiving direction until the printer
 1828 terminates the connection.
 1829 Unfortunately,
 1830 some printers <emphasis>do not</emphasis> terminate the connection,
 1831 and the the user must close the connection after a suitable timeout.
 1832 </para>
 1833 </listitem>
 1834 
 1835 <listitem>
 1836 <para>There are also printers that insist on the network connection being closed
 1837 before they will start processing small jobs.
 1838 The device sending the job to the printer must do a <emphasis>close</emphasis>
 1839 rather than a shutdown.
 1840 </para>
 1841 </listitem>
 1842 
 1843 <listitem>
 1844 <para>While processing the job,
 1845 the printer will ignore any connection requests,
 1846 and only until the job has been processed
 1847 will the printer accept connections.</para>
 1848 </listitem>
 1849 
 1850 <listitem>
 1851 <para>During job processing,  status and error indications can be obtained by sending
 1852 a query to the UDP port.
 1853 However,  the error conditions and other information are not very precise as the
 1854 status may change dramatically during job processing.</para>
 1855 </listitem>
 1856 
 1857 <listitem>
 1858 <para>
 1859 a query to the UDP port.
 1860 However,  the error conditions and other information are not very precise as the
 1861 status may change dramatically during job processing.
 1862 </para>
 1863 </listitem>
 1864 
 1865 </orderedlist>
 1866 </para>
 1867 
 1868 <para>The Appsocket protocol does not use a <emphasis>persistent</emphasis> connection.
 1869 If two people are sending jobs to the printer simultaneously it is very likely
 1870 that the jobs will get intermixed.</para>
 1871 
 1872 <para>The <literal>appsocket</literal> option causes the &IFHP; filter
 1873 to open and close a TCP/IP connection to the printer.
 1874 In order to reopen the device, &IFHP; needs the device name.
 1875 It gets this from the
 1876 <literal/PRINTCAP_ENTRY/
 1877 environment variable
 1878 which has the device information,
 1879 or by using the TCP/IP address of the initial end of the connection.
 1880 </para>
 1881 <para>
 1882 The <literal>close_appsocket</literal> option causes the &IFHP; filter
 1883 to close the connection after sending a job or part of a job.
 1884 This is necessary with printers that will not start printing small jobs
 1885 until a sufficient number of pages has been received.
 1886 </para>
 1887 <para>
 1888 The following is a sample printcap entry for this printer:
 1889 <informalexample>
 1890 <screen># Phaser Setup
 1891 #  Appsocket
 1892 lp:server  
 1893   :<literal>lp=10.0.0.1%9100</literal>  
 1894   :sd=<emphasis remap=it>spooldir</emphasis>  
 1895   :...  
 1896   :ifhp=model=ps,appsocket
 1897   #path to ifhp filter  
 1898   :filter=/.../ifhp</screen>
 1899 </informalexample>
 1900 </para>
 1901 
 1902 <para>For your convenience,
 1903 the <literal>model=phaser</literal>
 1904 entry is suitable for use with the appsocket protocol.</para>
 1905 
 1906 </sect1>
 1907 
 1908 <sect1 id="snmp">
 1909 <title>Using SNMP For Status Information</title>
 1910 <itemizedlist>
 1911 <listitem><para><literal/snmp_monitor/ FLAG <emphasis/use snmp for status/</para></listitem>
 1912 <listitem><para><literal/snmp_program=/ <emphasis>path to snmp_printer_status</emphasis></para></listitem>
 1913 <listitem><para><literal/snmp_program_cfg=/ <emphasis>snmp_printer_status configuration file</emphasis></para></listitem>
 1914 <listitem><para><literal/snmp_model=/<emphasis/snmp model information/</para></listitem>
 1915 <listitem><para><literal/snmp_sync_status=/<emphasis/sync indicators/</para></listitem>
 1916 <listitem><para><literal/snmp_end_status=/<emphasis/end of job indicators/</para></listitem>
 1917 <listitem><para><literal/snmp_end_status=/<emphasis/end of job indicators/</para></listitem>
 1918 </itemizedlist>
 1919 
 1920 <para>
 1921 The &IFHP; filter can be configured to use the SNMP helper program
 1922 <literal/snmp_printer_status/
 1923 to obtain SNMP status.
 1924 This program is supplied as part of the &IFHP; distribution.
 1925 <para>
 1926 
 1927 <para>
 1928 The <literal/snmp_monitor/ flag is used to enable the use of the <literal/snmp_printer_status/ program.
 1929 The <literal/snmp_program/ specifies the program path and command line to invoke it.
 1930 The <literal/snmp_program_conf/ specifies the path to the
 1931 configuration file,
 1932 <literal/snmp_printer_stastus.conf/.
 1933 The configuration file contains information about the operation of the program
 1934 as well as the SNMP Object Identifiers (OIDs) for the status information.
 1935 </para>
 1936 
 1937 <para>
 1938 Since different printers may not support all of the standard Printer MIB Oids,
 1939 the <literal/snmp_printer_status.conf/ can identify the options on a per-printer model basis,
 1940 and the appropriate ones can be selected using the <literal/snmp_model/ option.
 1941 </para>
 1942 
 1943 <para>
 1944 The <literal/snmp_printer_status/ program returns status information on it STDOUT and errors on its
 1945 STDERR.
 1946 The status information has the format:
 1947 <informalexample><screen>PRINTERNAME=HP LaserJet 2200
 1948 DEVICEID=HP LaserJet
 1949 STATUS=Ready
 1950 DEVICESTATUS=running
 1951 PRINTERSTATUS=idle
 1952 PAGECOUNT=30</screen></informalexample>
 1953 Consult the
 1954 <literal/snmp_printer_status/ program and
 1955 <literal/snmp_printer_status.conf/
 1956 files for details of how the status is obtained.
 1957 </para>
 1958 
 1959 <para>
 1960 When using <literal/snmp/ to detect idle or end conditions,
 1961 the <literal/snmp_sync_status/ and
 1962 the <literal/snmp_end_status/ values are used.
 1963 If the retured status matches a field in the
 1964 <literal/snmp_sync_status/ list, then a idle printer condtion is assumed.
 1965 If the retured status matches a field in the
 1966 <literal/snmp_end_status/ list, then an end of job condtion is assumed.
 1967 For example:
 1968 <informalexample><screen>snmp_end_status=ready idle
 1969 snmp_sync_status=ready power_save_mode</screen></informalexample>
 1970 </para>
 1971 
 1972 <para>
 1973 When using SNMP to obtain status, it may be of little benefit to use other methods to obtain
 1974 sync, pagecount, or end of job (waitend).
 1975 Also, if a connection is open to the printer then the printer may never indicate
 1976 <literal/idle/
 1977 or non-printing status.
 1978 This problem can be avoided by using the
 1979 <literal/appsocket/ protocol.
 1980 If you use this, then you should also set the
 1981 <literal/sync/,
 1982 <literal/waitend/,
 1983 and
 1984 <literal/pagecount/
 1985 values to <literal/snmp/ as well.
 1986 For example:
 1987 <informalexample><screen>[ printer ]
 1988 snmp_monitor
 1989 appsocket
 1990 sync=snmp
 1991 waitend=snmp
 1992 pagecount=snmp</screen></informalexample>
 1993 This will cause the &IFHP; to perform the operations but not to send any query strings to the
 1994 printer.
 1995 </para>
 1996 
 1997 </sect1>
 1998 
 1999 <sect1>
 2000 <title>Common Print Server Boxes Configuration Information</title>
 2001 
 2002 <para>The following is a list of print server manufacturers,
 2003 models,
 2004 and with hints on how to access these boxes with various protocols.</para>
 2005 
 2006 <para>
 2007 <table frame=all id=networkprintservers>
 2008 <title>Network Print Servers</title>
 2009 <tgroup cols=4 colsep=1 rowsep=1 align=left >
 2010 <thead>
 2011 <row><entry>Manufacturer</entry><entry>Model</entry><entry>RFC1179 Port Name (rp=XXX)</entry><entry>Send to TCP port</entry></row>
 2012 </thead>
 2013 <tbody>
 2014 <row><entry><ulink URL="http://www.digprod.com/">Digital Products Inc.</ulink></entry><entry>NETPrint Print Server</entry><entry><literal/PORT/<emphasis/n/, where <emphasis remap=it>n</emphasis> is port on server</entry><entry>- Unknown if supported -</entry></row>
 2015 <row><entry morerows=3><ulink URL="http://www.efi.com/">Electronics For Imaging Inc.</ulink></entry><entry>Fiery RIP i series</entry><entry><literal>normalq</literal> or <emphasis remap=tt>urgentq</emphasis></entry><entry>- Unknown if supported -</entry></row>
 2016 <row><entry>Fiery RIP XJ series</entry><entry><literal>xjprint</literal></entry><entry>- Unknown if supported -</entry></row>
 2017 <row><entry>Fiery RIP XJ+ and SI series</entry><entry><symbol>print_</symbol><emphasis remap=it>Model</emphasis>, e.g. <symbol>print_DocuColor</symbol></entry><entry>- Unknown if supported -</entry></row>
 2018 <row><entry>Fiery models ZX2100, ZX3300, X2, X2e</entry><entry><literal>print</literal></entry><entry>- Unknown if supported -</entry></row>
 2019 <row><entry><ulink URL="http://www.emulex.com/">Emulex Corp.</ulink></entry><entry>NETJet/NETQue print server</entry><entry><acronym>PASSTHRU</acronym></entry><entry>- Unknown if supported -</entry></row>
 2020 <row><entry><ulink URL="http://www.extendsys.com/">Extended Systems Inc.</ulink></entry><entry>ExtendNet Print Server</entry><entry><emphasis remap=tt>Printer<replaceable>n</replaceable></emphasis>, where <emphasis remap=it>n</emphasis> is port on server</entry><entry>- Unknown if supported -</entry></row>
 2021 <row><entry morerows=1><ulink URL="http://www.hp.com/">Hewlett-Packard</ulink></entry><entry>JetDirect interface card</entry><entry><literal>raw</literal></entry><entry>9100</entry></row>
 2022 <row><entry>JetDirect Print Server</entry>
 2023 <entry>Port1=<literal>raw1</literal>,
 2024 Port2=<literal>raw2</literal>, ...
 2025 </entry>
 2026 <entry>
 2027 Port1=9100,
 2028 Port2=9101, ...
 2029 </entry></row>
 2030 <row><entry><ulink URL="http://www.i-data.com/">I-Data</ulink></entry><entry>Easycom 10 Printserver</entry><entry><literal>par1</literal> (parallel port 1)</entry><entry>- Unknown if supported -</entry></row>
 2031 <row><entry></entry><entry>Easycom 100 Printserver</entry><entry><literal>LPDPRT1</literal></entry><entry>- Unknown if supported -</entry></row>
 2032 <row><entry><ulink URL="http://www.printers.ibm.com/">IBM</ulink></entry><entry>Network Printer 12, 17, 24, and 24PS</entry><entry><acronym>PASS</acronym></entry><entry>- Unknown if supported -</entry></row>
 2033 <row><entry><ulink URL="http://www.lantronix.com/">Lantronix</ulink></entry><entry>EPS1, EPS2</entry><entry><literal>EPS_XXXX_S1 (serial) port 1, EPS_XXXX_P1 (parallel) port 2</literal>, etc.</entry><entry>3001 (port 1), 3002 (port 2), etc.</entry></row>
 2034 <row><entry><ulink URL="http://www.qms.com/">QMS</ulink></entry><entry>Various Models</entry><entry><acronym>RAW</acronym></entry><entry>35 (Appsocket)</entry></row>
 2035 <row><entry><ulink URL="http://www.tek.com/color_printers/">Tektronix</ulink> (Now <ulink URL="http://www.tektronix.xerox.com">Xerox</ulink>)</entry><entry>Tektronix printer network cards</entry><entry><acronym>PS</acronym> (PostScript), <acronym>PCL</acronym> (PCL), or <acronym>AUTO</acronym>(Auto-selection between PS, PCL, or HPGL). Not reliable.</entry><entry>9100 (Appsocket on some models)</entry></row>
 2036 <row><entry><ulink URL="http://www.rosel.com">Rose Electronics</ulink></entry><entry>Microserve Print Servers</entry><entry>lp</entry><entry>9100</entry></row>
 2037 <row><entry morerows=5><ulink URL="http://www.xerox.com/">Xerox</ulink></entry><entry>Models 4505, 4510, 4517, 4520</entry><entry><acronym>PASSTHRU</acronym></entry><entry>2501 (Appsocket on some models)</entry></row>
 2038 <row><entry>Model 4512</entry><entry><literal>PORT1</literal></entry><entry>10001 (programmable)</entry></row>
 2039 <row><entry>Model N17</entry><entry><acronym>RAW</acronym></entry><entry>9100</entry></row>
 2040 <row><entry>Models N24 and N32</entry><entry><acronym>RAW</acronym></entry><entry>2000</entry></row>
 2041 <row><entry>Models 4900, 4915, 4925, C55</entry><entry><acronym>PS</acronym></entry><entry>2000</entry></row>
 2042 <row><entry>Document Centre DC220/230</entry><entry><literal>lp</literal></entry><entry>- Unknown if supported -</entry></row>
 2043 </tbody>
 2044 </tgroup>
 2045 </table>
 2046 </para>
 2047 
 2048 <para>All company, brand, and product names are properties of their respective owners.</para>
 2049 
 2050 </sect1>
 2051 
 2052 <sect1>
 2053 <title>Timeout Problems Sending A Job</title>
 2054 
 2055 <para>The &IFHP; filter may need to run a program
 2056 such as <literal>ghostscript</literal> to do format conversion.
 2057 For large files this can take quite a bit of time and
 2058 most network printers have a
 2059 <emphasis remap=it>connection timeout</emphasis>.
 2060 If no data is received for this time the printer will
 2061 close the connection.
 2062 By default this timeout is fairly short: 30 or 90 seconds on most printers.</para>
 2063 
 2064 <para>If you are sending large jobs to the printer using the
 2065 <literal>socket</literal> protocol and are getting timeout
 2066 problems due to conversion timeouts,
 2067 then there are two solutions: a) use the Appsocket protocol,
 2068 which will open and close the connection for each file,
 2069 and only send data when the converted file is available,
 2070 or b)
 2071 do your conversions first and then spool the converted job to be sent
 2072 directly to the printer.
 2073 The second method requires an &LPRng; bounce queue.
 2074 <informalexample>
 2075 <screen># Method a) Appsocket
 2076 lp:server 
 2077   :lp=10.0.0.1%9100
 2078   :sd=<emphasis remap=it>spooldir</emphasis> 
 2079   :... 
 2080   :ifhp=model=printer,appsocket
 2081   #path to ifhp filter 
 2082   :filter=/.../ifhp 
 2083 
 2084 # Method b) Bounce Queue
 2085 #  this queue does the conversion if required
 2086 lp:server
 2087   :lpd_bounce 
 2088   :lp=real@localhost
 2089   :sd=<emphasis remap=it>spooldir</emphasis> 
 2090   :... 
 2091   :ifhp=model=printer
 2092   #path to ifhp filter 
 2093   :filter=/.../ifhp 
 2094 # this queue does transmission
 2095 real:server 
 2096   :lp=10.0.0.1%9100
 2097   :sd=<emphasis remap=it>spooldir</emphasis> 
 2098   :ifhp=model=printer
 2099   #path to ifhp filter 
 2100   :filter=/.../ifhp  </screen>
 2101 </informalexample>
 2102 </para>
 2103 
 2104 <para>For method a),
 2105 the Appsocket protocol is used and the &IFHP; filter will be invoked before sending a job.
 2106 For method b),
 2107 you use two queues:  a <emphasis remap=it>bounce</emphasis> queue that does the format conversion
 2108 and then sends the job to the real queue,
 2109 and the real queue that actually talks to the printer.</para>
 2110 
 2111 </sect1>
 2112 
 2113 <sect1 id="rwtimeout">
 2114 <title>Printers With Lockup Problems </title>
 2115 
 2116 <para>
 2117 Due to firmware problems in some PostScript and PCL printers,
 2118 they will occasionally lock up and refuse to accept new connections
 2119 or continue with job processing.
 2120 This is extremely difficult to diagnose,
 2121 as the printer appears to be functional but will simply not
 2122 accept any addition data or respond to a command.
 2123 </para>
 2124 <para>
 2125 Unfortunately,  this is also the condition when these printers are turned offline.
 2126 </para>
 2127 
 2128 <para>
 2129 The <literal/send_job_rw_timeout/ option is used to set a maximum timeout for
 2130 network and/or communication operations.
 2131 This value can be set to the maximum expected completion time of the print job.
 2132 When this time is exceeded, the IFHP filter will exit with a
 2133 <literal/JTIMEOUT/ error.
 2134 </para>
 2135 </sect1>
 2136 
 2137 <sect1>
 2138 <title>PS, PCL, PJL Printer with TPC/IP Network Interface</title>
 2139 
 2140 <para>The most common TCP/IP protocols used for transferring
 2141 jobs to network printers are
 2142 <link linkend="rfc1179pc">RFC 1179</link>,
 2143 a direct TCP/IP
 2144 <link linkend="socketpc">socket</link>,
 2145 connection to the print engine,
 2146 and the very odd
 2147 <link linkend="appsocketpc">Appsocket</link> protocol described
 2148 in previous sections.
 2149 Here is a reprise of the various printcaps and methods
 2150 to use them.
 2151 <informalexample>
 2152 <screen># printer setup  
 2153 #  force clients (lpr, lpq, to use server)  
 2154 lp:lp=lp@serverhost  
 2155 # server information  
 2156 lp:server  
 2157   :sd=<emphasis remap=it>spooldir</emphasis>  
 2158   :...  
 2159 
 2160   # No filtering, transfer using RFC1179, use:
 2161   :lp=queue@10.1.1.1
 2162   #    or 
 2163   :rp=queue:rm=10.1.1.1
 2164 
 2165   # Filtering and then transfer using RFC1179, use:
 2166   :lpd_bounce:lp=queue@10.1.1.1
 2167   #    or 
 2168   :lpd_bounce:rp=queue:rm=10.1.1.1
 2169   :ifhp=model=<emphasis remap=it>name</emphasis>
 2170   :filter=/.../ifhp  
 2171 
 2172   # Filter, transfer using socket, use:
 2173   :lp=10.1.1.1%9100 
 2174   :ifhp=model=<emphasis remap=it>name</emphasis>
 2175   :filter=/.../ifhp  
 2176 
 2177   # Filter, transfer using Appsocket, use:
 2178   :lp=10.1.1.1%9100 
 2179   :ifhp=model=<emphasis remap=it>name</emphasis>,appsocket
 2180   :filter=/.../ifhp  </screen>
 2181 </informalexample>
 2182 </para>
 2183 
 2184 <para>If your printer is a parallel port printer
 2185 connected to an <emphasis>external</emphasis> Network Print Spooler such as an HP JetDirect box,
 2186 then while the network connection to the Network Print Spooler is
 2187 bidirectional
 2188 the connection from the Network Print Spooler to the printer
 2189 may be unidirectional
 2190 and no status information will be returned from the Network Print Spooler.
 2191 In this case you <emphasis>must</emphasis> add the <literal>status@</literal>
 2192 option to tell &IFHP; not to expect status:
 2193 <informalexample>
 2194 <screen># Filter, transfer using socket
 2195   :lp=10.1.1.1%9100 
 2196   :ifhp=model=<emphasis remap=it>name</emphasis>,status@
 2197   :filter=/.../ifhp </screen>
 2198 </informalexample>
 2199 </para>
 2200 
 2201 </sect1>
 2202 
 2203 <sect1>
 2204 <title>PS, PCL, PJL Printer with Parallel Port Connection</title>
 2205 
 2206 <para>If your printer is connected to a
 2207 <emphasis/bidirectional/
 2208 parallel port you may be able to read status from the printer.
 2209 First,
 2210 determine if your printer has bidirectional IO capability
 2211 and if your operating system  has support for it.
 2212 If it does not,
 2213 then do not  use the
 2214 <literal>:rw</literal> (open connection read-write) option
 2215 to open the printer device in read write mode.
 2216 <informalexample>
 2217 <screen># printer setup  
 2218 #  force clients (lpr, lpq, to use server)  
 2219 lp:lp=lp@serverhost  
 2220 # server information  
 2221 lp:server  
 2222   # do now open read write
 2223   :rw@
 2224   :sd=<emphasis remap=it>spooldir</emphasis>  
 2225   :...  
 2226   # parallel port 
 2227   :lp=/dev/lpt
 2228   #path to ifhp filter  
 2229   :filter=/.../ifhp  </screen>
 2230 </informalexample>
 2231 </para>
 2232 <para>
 2233 If,
 2234 on the other hand,
 2235 your operating system reports that the parallel port
 2236 is bidirectional and is able to read the printer model
 2237 information,
 2238 then you can try opening the parallel port read-write
 2239 and seeing if the &IFHP; filter can read status information:
 2240 <informalexample>
 2241 <screen># printer setup  
 2242 #  force clients (lpr, lpq, to use server)  
 2243 lp:lp=lp@serverhost  
 2244 # server information  
 2245 lp:server  
 2246   # open read write
 2247   :rw
 2248   :sd=<emphasis remap=it>spooldir</emphasis>  
 2249   :...  
 2250   # parallel port 
 2251   :lp=/dev/lpt
 2252   #path to ifhp filter  
 2253   :filter=/.../ifhp  </screen>
 2254 </informalexample>
 2255 </para>
 2256 
 2257 </sect1>
 2258 
 2259 <sect1>
 2260 <title>PS, PCL, PJL Printer with Serial Port</title>
 2261 
 2262 <para>It is strongly advised that serial ports not be used
 2263 for high speed data transfers.
 2264 The main problem is trying to configure them in such as way
 2265 that they do not lose characters due to data overruns or parity errors.
 2266 LPRng is strongly deprecating support for serial port printers.</para>
 2267 
 2268 <para>The &LPRng; print spooler will open and set the serial
 2269 line characteristics,
 2270 and pass the open connection to the
 2271 &IFHP; filter.
 2272 The
 2273 <literal>tty</literal> connection must pass all 8 bits with no parity,
 2274 and should use hardware flow control if at all possible.
 2275 Unfortunately,
 2276 the various <literal>stty</literal>
 2277 options needed to do this vary from system to system.
 2278 Also, you may discover that your serial connection does not
 2279 support hardware flow control.
 2280 If this is the case,
 2281 then you will have to use software flow control
 2282 which is rather unreliable for high speed (over 9600) serial
 2283 lines due to the timing latencies involved.
 2284 <informalexample>
 2285 <screen># printer setup  
 2286 #  force clients (lpr, lpq, to use server)  
 2287 lp:lp=lp@serverhost  
 2288 # server information  
 2289 lp:server  
 2290   :sd=<emphasis remap=it>spooldir</emphasis>  
 2291   :...  
 2292   # serial port 
 2293   :lp=<filename>/dev/ttyxxx</filename> 
 2294   :stty=38400 -echo -crmod -raw -oddp -evenp \ 
 2295      ixon pass8 -ixany cbreak crtscts 
 2296   #path to ifhp filter  
 2297   :filter=/.../ifhp  </screen>
 2298 </informalexample>
 2299 </para>
 2300 
 2301 </sect1>
 2302 
 2303 <sect1
 2304 id="psonly">
 2305 <title>PostScript Only Printer
 2306 </title>
 2307 
 2308 <para>The <literal>model=ps</literal> entry supports PostScript only printers.
 2309 <informalexample>
 2310 <screen># printer setup  
 2311 #  force clients (lpr, lpq, to use server)
 2312 lp:lp=lp@serverhost 
 2313 # server information  
 2314 lp:server  
 2315   :sd=<emphasis remap=it>spooldir</emphasis> 
 2316   :...  
 2317   :ifhp=model=ps 
 2318   #path to ifhp filter  
 2319   :filter=/.../ifhp  </screen>
 2320 </informalexample>
 2321 </para>
 2322 
 2323 <para>If you have a <emphasis/unidirectional/ or <emphasis/write only/ (no status information)
 2324 connection such as a parallel port you should use:
 2325 <informalexample>
 2326 <screen>:ifhp=model=ps,status@</screen>
 2327 </informalexample>
 2328 </para>
 2329 
 2330 <para>
 2331 <anchor id="ps-eoj">
 2332 <anchor id="ps-eoj-at-start">
 2333 <anchor id="ps-eoj-at-end">
 2334 <anchor id="pcl-eoj-at-start">
 2335 Many PostScript printers recognize
 2336 the PostScript EOJ marker (Control-D or <literal>\004</literal>)
 2337 as an end of PostScript job indication
 2338 and will perform page eject and other suitable actions.
 2339 Unfortunately,
 2340 strictly according to PostScript documentation
 2341 this character is only allowed in the Serial Port Data Stream,
 2342 and there are some printers that treat it as an error.
 2343 In addition,
 2344 the Control-T character is recognized as a printer status solicitation,
 2345 and some printers do not return status or recognize it as an error.
 2346 </para>
 2347 <para>
 2348 If your printer does not handle PostScript EOJ (Control-D)
 2349 at all,
 2350 set <literal>ps_eoj@</literal>
 2351 to suppress generation of extra Control-D characters by &IFHP;.
 2352 If your printer requires a Control-D at the end of the job but
 2353 fails when they occur at the start of the job,
 2354 set
 2355 <literal>ps_eoj_at_start@</literal>.
 2356 If
 2357 the printer requires a Control-D at the start but not at the end,
 2358 set
 2359 <literal>ps_eoj_at_start@</literal>.
 2360 </para>
 2361 <para>
 2362 PCL based printers are not nearly as fussy.
 2363 However,
 2364 you may discover that some of them do not correctly handle
 2365 a PCL EOJ at the start of a job
 2366 in spite of all examples and documention.
 2367 Use the
 2368 <literal>pcl_eoj_at_start@</literal>
 2369 to suppress adding a
 2370 PCL EOJ (Esc E)
 2371 command string to the start of a PCL job file.
 2372 <informalexample>
 2373 <screen>:ifhp=model=ps,ps_eoj@</screen>
 2374 </informalexample>
 2375 </para>
 2376 
 2377 <para>See the section on
 2378 <link linkend="fileconversion">File Conversion Support</link>
 2379 for ways to print text and other files on a PostScript printer.
 2380 </para>
 2381 
 2382 </sect1>
 2383 
 2384 <sect1>
 2385 <title>GhostScript</title>
 2386 
 2387 <para>Generating a raster image from a PostScript or PCL file in
 2388 a timely manner requires a high speed processor and substantial amounts
 2389 of memory.
 2390 Many of the low cost printers require the user's system to do the raster
 2391 conversion
 2392 and the raster file is then transferred to the printer.
 2393 The file format is usually a subset of PCL.</para>
 2394 
 2395 <para>The
 2396 <link linkend="ghostscript">GhostScript</link>
 2397 program can process PostScript files and produce raster output for a
 2398 wide range of devices.
 2399 The
 2400 <literal>ghostscript</literal>
 2401 <literal>pcl_gs</literal>
 2402 printer configurations is used
 2403 with these printers.
 2404 See
 2405 <link linkend="ghostscriptconfig">GhostScript Printer</link>
 2406 for details.</para>
 2407 
 2408 </sect1>
 2409 
 2410 <sect1
 2411 id="phaser">
 2412 <title>Tektronics Phaser, QMS, and Appsocket Protocol
 2413 </title>
 2414 
 2415 <para>The Tektronics Phaser, QMS Network Printers,
 2416 and a few others use the
 2417 <link linkend="appsocketpc">Appsocket</link> protocol described
 2418 in a previous section.
 2419 The Tektronics (<literal>model=phaser</literal>) configuration entry
 2420 has the required options for these printers:
 2421 <informalexample>
 2422 <screen>[ phaser qms ]
 2423 appsocket
 2424 ps
 2425 pjl@
 2426 pcl</screen>
 2427 </informalexample>
 2428 </para>
 2429 
 2430 <para>The following shows a typical printcap entry:
 2431 <informalexample>
 2432 <screen>#  force clients (lpr, lpq, to use server)
 2433 lp:lp=lp@serverhost 
 2434 # server information  
 2435 lp:server  
 2436   :sd=<emphasis remap=it>spooldir</emphasis> 
 2437   :lp=10.1.1.1%35 
 2438   :...  
 2439   :ifhp=model=phaser
 2440   #path to ifhp filter  
 2441   :filter=/.../ifhp  </screen>
 2442 </informalexample>
 2443 </para>
 2444 
 2445 </sect1>
 2446 </chapter>
 2447 
 2448 <chapter
 2449 id="options">
 2450 <title>Options and Arguments
 2451 </title>
 2452 <itemizedlist>
 2453 <listitem><para><literal/model=/<emphasis/Model Information/</para></listitem>
 2454 <listitem><para><literal/model_from_option=/<emphasis/Option with model information/</para></listitem>
 2455 </itemizedlist>
 2456 
 2457 <para>The &IFHP; filter is designed to work with the &LPRng; print spooler
 2458 and expects to be passed the standard set of filter options.
 2459 These have the form:
 2460 <informalexample>
 2461 <screen>/.../ifhp [-c] [-X option]* accountingfile
 2462 Example:
 2463 /.../ifhp -n root -H hostname -P printer -s statusfile acct
 2464 # - X is any letter except T</screen>
 2465 </informalexample>
 2466 </para>
 2467 
 2468 <para>All of the option letters except <literal>T</literal> are reserved by the &LPRng;
 2469 program to pass information to the filter.
 2470 For details about the options,  please consult the &LPRng; documentation.</para>
 2471 
 2472 
 2473 <sect1>
 2474 <title>Command Line Options</title>
 2475 
 2476 <para>The most important options that &LPRng; passes and that &IFHP; uses are:
 2477 <variablelist>
 2478 <varlistentry><term>-s statusfile</term>
 2479 <listitem>
 2480 <para>The file where &IFHP; status information is placed.</para>
 2481 
 2482 </listitem>
 2483 </varlistentry>
 2484 
 2485 <varlistentry><term>-Z useroptions</term>
 2486 
 2487 <listitem>
 2488 <para>The <command>lpr -Z</command> options passed by the user, and are discussed in
 2489 the
 2490 <link linkend="options">options</link>
 2491 section.</para>
 2492 
 2493 </listitem>
 2494 </varlistentry>
 2495 
 2496 <varlistentry><term>-T options</term>
 2497 
 2498 <listitem>
 2499 <para>These are usually options specified in the printcap entry
 2500 and are discussed in
 2501 the
 2502 <link linkend="options">options</link> section.</para>
 2503 </listitem>
 2504 </varlistentry>
 2505 <varlistentry><term>accountingfile</term>
 2506 <listitem>
 2507 <para>The file where accounting information is written.</para>
 2508 </listitem>
 2509 </varlistentry>
 2510 </variablelist>
 2511 </para>
 2512 
 2513 <para>
 2514 <informalexample>
 2515 <screen>Examples:
 2516 ifhp "-Tmodel=ps,status@" "-Za4,landscape"</screen>
 2517 </informalexample>
 2518 </para>
 2519 
 2520 <para>Since commas are used to separate options,
 2521 whitespace is used to separate multiple values
 2522 for a particular option.
 2523 You will need to quote this on a command line. For example:
 2524 <informalexample>
 2525 <screen>ifhp "-Tfont=elite greek1 dingbat"</screen>
 2526 </informalexample>
 2527 </para>
 2528 
 2529 <para>The &IFHP; program first checks to see if the
 2530 <acronym>PRINTCAP</acronym> environment variable is defined.
 2531 By convention, &LPRng; will place the printer printcap entry in this
 2532 variable when it starts the &IFHP; filter.
 2533 The printcap <literal>:ifhp=options</literal> value is extracted and used
 2534 as the default <option>-T</option> options.
 2535 After getting the options from the printcap,
 2536 the <option>-Toptions</option> command line options are appended to the list of <option>-T</option>
 2537 options.
 2538 The single letter command line options are also made available to
 2539 the &IFHP; programs as shown below:
 2540 <informalexample>
 2541 <screen>PRINTCAP=lp:ifhp=model=this,status@:...
 2542 
 2543 ifhp -n root -h localhost -Tmodel=that,debug=1
 2544 
 2545 Concatenated -T options:  model=this,status@,n=root,h=localhost,model=that,debug=1
 2546 Resulting    -T options:  status@,n=root,h=localhost,model=that,debug=1</screen>
 2547 </informalexample>
 2548 </para>
 2549 
 2550 <para>The <option>-T</option> option list is scanned from left to right,
 2551 and later option values override earlier ones.
 2552 The <option>-T</option> option values have priority over values that are obtained
 2553 from the configuration file and cannot be overridden.
 2554 There are several options that have important effects on the operation
 2555 of the &IFHP; filter.</para>
 2556 
 2557 </sect1>
 2558 
 2559 <sect1
 2560 id="config">
 2561 <title>General Configuration Options - config, trace, debug</title>
 2562 <itemizedlist>
 2563 <listitem><para><literal/config=/<emphasis/Configuration file location/</para></listitem>
 2564 <listitem><para><literal/debug=/<emphasis/Debug options/</para></listitem>
 2565 <listitem><para><literal/trace/ FLAG <emphasis/trace on <acronym/STDERR//</para></listitem>
 2566 </itemizedlist>
 2567 
 2568 <para>These options are used to control the global operation
 2569 of the &IFHP; filter,
 2570 and are only available from the <option>-T</option> command line options.
 2571 <variablelist>
 2572 <varlistentry><term>config=pathname</term>
 2573 <listitem>
 2574 <para>The <literal>config</literal> option specifies the location of the <filename>ifhp.conf</filename> file.
 2575 This overrides the default location.
 2576 The pathname can be a file name, list of filenames separated by spaces,
 2577 or a filter.
 2578 For example:
 2579 <informalexample>
 2580 <screen>ifhp '-Tconfig=/usr/local/etc/ifhp.conf'
 2581 ifhp '-Tconfig=|/usr/local/bin/getconfig'</screen>
 2582 </informalexample>
 2583 </para>
 2584 
 2585 <para>The second example uses the <literal>getconfig</literal> program
 2586 to obtain configuration information.
 2587 The configuration information is read from the program's STDOUT.
 2588 There program is invoked with no command line  options
 2589 and is passed the environment variables that were provided
 2590 to &IFHP;.
 2591 </para>
 2592 
 2593 
 2594 </listitem>
 2595 </varlistentry>
 2596 
 2597 <varlistentry><term>model=MODEL</term>
 2598 
 2599 <listitem>
 2600 <para>The <literal>model</literal> option selects the portion of the &IFHP; configuration
 2601 that will set values of configuration parameters.
 2602 This is discussed in detail in the next section.</para>
 2603 
 2604 
 2605 </listitem>
 2606 </varlistentry>
 2607 
 2608 <varlistentry><term>trace</term>
 2609 
 2610 <listitem>
 2611 <para>As &IFHP; processes the print job,  it produces tracing and error message
 2612 information.
 2613 By default this is written to the status file specified by the <option>-s</option>
 2614 command line option.
 2615 The <literal>trace</literal> option will cause this information to be written to
 2616 <acronym>STDERR</acronym> (file descriptor 2).
 2617 This is usually used in debugging.</para>
 2618 
 2619 
 2620 </listitem>
 2621 </varlistentry>
 2622 
 2623 <varlistentry><term>debug=n</term>
 2624 
 2625 <listitem>
 2626 <para>This option sets the debugging level to <literal>n</literal>, where <emphasis remap=tt>n</emphasis> is an integer number.
 2627 Level 0 turns debugging off, level 1 produces a small amount of verbosity
 2628 and increasing levels produce more verbose information.</para>
 2629 
 2630 </listitem>
 2631 </varlistentry>
 2632 </variablelist>
 2633 </para>
 2634 
 2635 </sect1>
 2636 
 2637 <sect1
 2638 id="statusfile">
 2639 <title>Status Messages
 2640 </title>
 2641 
 2642 <itemizedlist>
 2643 <listitem><para><literal/statusfile=/<emphasis/statusfile/</para></listitem>
 2644 <listitem><para><literal/statusfile_max=/<emphasis/maximum status file size/</para></listitem>
 2645 <listitem><para><literal/statusfile_min=/<emphasis/minimum status file size/</para></listitem>
 2646 <listitem><para><literal/summaryfile=/<emphasis/one line summary file/</para></listitem>
 2647 </itemizedlist>
 2648 
 2649 <para>
 2650 <variablelist>
 2651 <varlistentry><term>statusfile=pathname or -s pathname</term>
 2652 <listitem>
 2653 <para>The status file pathname is set by the command line
 2654 <option>-s pathname</option>,
 2655 or if it is not present then the
 2656 <literal>statusfile=pathname</literal>
 2657 configuration option.
 2658 The file must exist and will not be created.</para>
 2659 
 2660 
 2661 </listitem>
 2662 </varlistentry>
 2663 
 2664 <varlistentry><term>statusfile_max=n</term>
 2665 
 2666 <listitem>
 2667 <para>If the status file is larger than
 2668 <symbol>statusfile_max</symbol> K bytes (default 8K),
 2669 then it is truncated to
 2670 <literal>statusfile_min=min</literal>
 2671 K bytes.</para>
 2672 
 2673 
 2674 </listitem>
 2675 </varlistentry>
 2676 
 2677 <varlistentry><term>statusfile_min=n</term>
 2678 
 2679 <listitem>
 2680 <para>The minimum size in Kbytes of the status file after truncation
 2681 (default 1K).</para>
 2682 
 2683 </listitem>
 2684 </varlistentry>
 2685 </variablelist>
 2686 </para>
 2687 
 2688 </sect1>
 2689 
 2690 <sect1
 2691 id="status">
 2692 <title>Printer Status Available - status
 2693 </title>
 2694 <itemizedlist>
 2695 <listitem><para><literal/status/ FLAG <emphasis/status available from device/</para></listitem>
 2696 </itemizedlist>
 2697 
 2698 <para>The <literal>status</literal> option indicates that there is a bidirectional
 2699 connection to the printer,
 2700 and that status can be obtained from the connection.
 2701 During initialization
 2702 the &IFHP; filter will test the printer connection and determine if
 2703 it supports reading.
 2704 If it does not then &IFHP; will set <literal>status@</literal>.</para>
 2705 
 2706 </sect1>
 2707 
 2708 <sect1>
 2709 <title>Monitoring Options - sync, waitend, pagecount</title>
 2710 
 2711 <para>The <literal>sync</literal>, <literal>waitend</literal>, and <literal>pagecount</literal>
 2712 options are ignored if no status is available from the printer.
 2713 The <literal>sync</literal> option specifies the method to use to
 2714 determine if the printer is ready and operational.
 2715 The <literal>waitend</literal> option specifies the method used to determine
 2716 when a print job is finished.
 2717 The <literal>pagecount</literal> option specifies the method used to obtain pagecount
 2718 or status information.
 2719 <variablelist>
 2720 <varlistentry><term>sync@, waitend@, pagecount@ </term>
 2721 <listitem>
 2722 <para>This form of the tag indicates that the particular facility is disabled.</para>
 2723 
 2724 
 2725 </listitem>
 2726 </varlistentry>
 2727 
 2728 <varlistentry><term>sync=pjl</term>
 2729 
 2730 <listitem>
 2731 <para>PJL is used to determine if the printer is ready.
 2732 This can be done by sending a PJL JOB or PJL ECHO
 2733 command to the printer and waiting for return status.</para>
 2734 
 2735 
 2736 </listitem>
 2737 </varlistentry>
 2738 
 2739 <varlistentry><term>sync=ps</term>
 2740 
 2741 <listitem>
 2742 <para>A small PostScript job which causes a status report to be returned
 2743 is sent to the printer.</para>
 2744 
 2745 
 2746 </listitem>
 2747 </varlistentry>
 2748 
 2749 <varlistentry><term>waitend=pjl, waitend=ps</term>
 2750 
 2751 <listitem>
 2752 <para>This is similar to the <literal>sync</literal> operation,
 2753 but is done at the end of a job in order to determine if the
 2754 printer is busy.</para>
 2755 
 2756 
 2757 </listitem>
 2758 </varlistentry>
 2759 
 2760 <varlistentry><term>pagecount=pjl</term>
 2761 
 2762 <listitem>
 2763 <para>Many PJL capable printers support reporting total page usage by
 2764 means of PJL.
 2765 This option causes a PJL command to be sent requesting the
 2766 total page usage by the printer.</para>
 2767 
 2768 
 2769 </listitem>
 2770 </varlistentry>
 2771 
 2772 <varlistentry><term>pagecount=ps</term>
 2773 
 2774 <listitem>
 2775 <para>A small PostScript job which causes a status report to be returned
 2776 is sent to the printer.</para>
 2777 
 2778 </listitem>
 2779 </varlistentry>
 2780 </variablelist>
 2781 </para>
 2782 
 2783 </sect1>
 2784 
 2785 <sect1>
 2786 <title>User -Z Option Support</title>
 2787 
 2788 <para>The &IFHP; filter provides a simple way for users to request
 2789 a particular printer facility or option.
 2790 The <literal>lpr -Zkey=value</literal> command causes the <application/lpd/
 2791 print spooler to pass the <option>-Z</option> options on the &IFHP; command line.</para>
 2792 
 2793 <para>The &IFHP; filter implements these options by first determining if they
 2794 are allowed,
 2795 and then using them to select a set of strings that are sent to the printer.
 2796 Since some options are implement by sending PJL strings to the printer,
 2797 some by PostScript,
 2798 and some by PCL commands,
 2799 the method of specifying and generating them is a bit involved.</para>
 2800 
 2801 <para>The following facility is used to control the names and types of user
 2802 options.
 2803 <variablelist>
 2804 <varlistentry><term>pjl_user_opts=[ ... ]</term>
 2805 <listitem>
 2806 <para>This tag specifies the list of user options that are implemented by
 2807 sending PJL strings to the printer.
 2808 This is available only if the printer is PJL capable.</para>
 2809 
 2810 </listitem>
 2811 </varlistentry>
 2812 
 2813 <varlistentry><term>pcl_user_opts=[ ... ]</term>
 2814 
 2815 <listitem>
 2816 <para>This tag specifies the list of user options that are implemented by
 2817 sending PCL strings to the printer.
 2818 This is available only if the printer is PCL capable.</para>
 2819 
 2820 </listitem>
 2821 </varlistentry>
 2822 
 2823 <varlistentry><term>ps_user_opts=[ ... ]</term>
 2824 
 2825 <listitem>
 2826 <para>This tag specifies the list of user options that are implemented by
 2827 sending PostScript strings to the printer.
 2828 This is available only if the printer is PostScript capable.</para>
 2829 
 2830 </listitem>
 2831 </varlistentry>
 2832 </variablelist>
 2833 </para>
 2834 
 2835 <para>For each option,
 2836 the actual string or set of strings is specified as follows.
 2837 <variablelist>
 2838 <varlistentry><term>pjl_<emphasis remap=it>key</emphasis>= ...</term>
 2839 <listitem>
 2840 <para>The value of the PJL user option <literal>key</literal>.
 2841 This value can be one or more lines;
 2842 the lines are checked for correct PJL format and sent to the printer
 2843 before any language specific information.</para>
 2844 
 2845 </listitem>
 2846 </varlistentry>
 2847 
 2848 <varlistentry><term>ps_<emphasis remap=it>key</emphasis>= ... </term>
 2849 
 2850 <listitem>
 2851 <para>The value of the PostScript user option <literal>key</literal>.
 2852 This value can be one or more lines;
 2853 leading and trailing whitespace is removed and the lines are
 2854 placed before the first lines of a PostScript job file.</para>
 2855 
 2856 </listitem>
 2857 </varlistentry>
 2858 
 2859 <varlistentry><term>pcl_<emphasis remap=it>key</emphasis>= ... </term>
 2860 
 2861 <listitem>
 2862 <para>The value of the PCL user option <literal>key</literal>.
 2863 This value can be one or more lines;
 2864 whitespace and new lines are removed and the
 2865 characters are placed before the first characters of a PCL job file.</para>
 2866 
 2867 </listitem>
 2868 </varlistentry>
 2869 </variablelist>
 2870 </para>
 2871 
 2872 <para>The following user options are predefined in the default
 2873 <filename>ifhp.conf</filename> file and are recommended for use.
 2874 <variablelist>
 2875 <varlistentry><term>a3, a4, a5 </term>
 2876 <listitem>
 2877 <para>Use a3, a4, or a5 paper</para>
 2878 
 2879 </listitem>
 2880 </varlistentry>
 2881 
 2882 <varlistentry><term>copies=N</term>
 2883 
 2884 <listitem>
 2885 <para>Print N copies of a page or job</para>
 2886 
 2887 </listitem>
 2888 </varlistentry>
 2889 
 2890 <varlistentry><term>duplex</term>
 2891 
 2892 <listitem>
 2893 <para>Use duplex printing,  tumble on.
 2894 Pages will come out so that the margins are at opposite ends
 2895 of a page.</para>
 2896 
 2897 </listitem>
 2898 </varlistentry>
 2899 
 2900 <varlistentry><term>duplexshort</term>
 2901 
 2902 <listitem>
 2903 <para>Use duplex printing,  tumble off.
 2904 Pages will come out so that the margins are at the same
 2905 ends of a page.</para>
 2906 
 2907 </listitem>
 2908 </varlistentry>
 2909 
 2910 <varlistentry><term>envelope</term>
 2911 
 2912 <listitem>
 2913 <para>Select envelope media</para>
 2914 
 2915 </listitem>
 2916 </varlistentry>
 2917 
 2918 <varlistentry><term>inlower</term>
 2919 
 2920 <listitem>
 2921 <para>Select media from lower input bin.</para>
 2922 
 2923 </listitem>
 2924 </varlistentry>
 2925 
 2926 <varlistentry><term>inupper</term>
 2927 
 2928 <listitem>
 2929 <para>Select media from upper input bin.</para>
 2930 
 2931 </listitem>
 2932 </varlistentry>
 2933 
 2934 <varlistentry><term>landscape</term>
 2935 
 2936 <listitem>
 2937 <para>Use Landscape orientation</para>
 2938 
 2939 </listitem>
 2940 </varlistentry>
 2941 
 2942 <varlistentry><term>lduplex</term>
 2943 
 2944 <listitem>
 2945 <para>Alias for duplex</para>
 2946 
 2947 </listitem>
 2948 </varlistentry>
 2949 
 2950 <varlistentry><term>ledger</term>
 2951 
 2952 <listitem>
 2953 <para>Select ledger size (11x15 inches) media</para>
 2954 
 2955 </listitem>
 2956 </varlistentry>
 2957 
 2958 <varlistentry><term>legal</term>
 2959 
 2960 <listitem>
 2961 <para>Select legal size (8.5x15 inches) media</para>
 2962 
 2963 </listitem>
 2964 </varlistentry>
 2965 
 2966 <varlistentry><term>letter</term>
 2967 
 2968 <listitem>
 2969 <para>Select letter size (8.5x11 inches) media</para>
 2970 
 2971 </listitem>
 2972 </varlistentry>
 2973 
 2974 <varlistentry><term>manual</term>
 2975 
 2976 <listitem>
 2977 <para>Select media from manual feed</para>
 2978 
 2979 </listitem>
 2980 </varlistentry>
 2981 
 2982 <varlistentry><term>mediaselect=N</term>
 2983 
 2984 <listitem>
 2985 <para>Select media number N</para>
 2986 
 2987 </listitem>
 2988 </varlistentry>
 2989 
 2990 <varlistentry><term>outlower</term>
 2991 
 2992 <listitem>
 2993 <para>Put output in lower tray or bin</para>
 2994 
 2995 </listitem>
 2996 </varlistentry>
 2997 
 2998 <varlistentry><term>outupper</term>
 2999 
 3000 <listitem>
 3001 <para>Put output in upper tray or bin</para>
 3002 
 3003 </listitem>
 3004 </varlistentry>
 3005 
 3006 <varlistentry><term>oversize</term>
 3007 
 3008 <listitem>
 3009 <para>Select oversize media</para>
 3010 
 3011 </listitem>
 3012 </varlistentry>
 3013 
 3014 <varlistentry><term>portrait</term>
 3015 
 3016 <listitem>
 3017 <para>Use Portrait orientation</para>
 3018 
 3019 </listitem>
 3020 </varlistentry>
 3021 
 3022 <varlistentry><term>sduplex</term>
 3023 
 3024 <listitem>
 3025 <para>Alias for duplexshort.  Print on a single side of the media. </para>
 3026 
 3027 </listitem>
 3028 </varlistentry>
 3029 
 3030 <varlistentry><term>simplex</term>
 3031 
 3032 <listitem>
 3033 <para>Print on the single side of the media. </para>
 3034 
 3035 </listitem>
 3036 </varlistentry>
 3037 
 3038 <varlistentry><term>transparency</term>
 3039 
 3040 <listitem>
 3041 <para>Select transparency media</para>
 3042 
 3043 </listitem>
 3044 </varlistentry>
 3045 </variablelist>
 3046 </para>
 3047 
 3048 </sect1>
 3049 
 3050 <sect1>
 3051 <title>Adding User Options</title>
 3052 
 3053 <para>The following shows how to add a PJL option to an <filename>ifhp.conf</filename>
 3054 file.
 3055 By convention,
 3056 the configuration is added to the end of the <filename>ifhp.conf</filename> file.
 3057 <informalexample>
 3058 <screen>[ newprinter ]
 3059 pjl_user_opts += [ screen ]
 3060 pjl_screen = PJL SCREEN = ON
 3061 
 3062 ps_user_opts += [ fuzzy ]
 3063 ps_fuzzy = &lt;&lt;/Fuzzy (\%s{fuzzy})&gt;&gt; setpagedevice
 3064 </screen>
 3065 </informalexample>
 3066 </para>
 3067 
 3068 <para>In the first example we define the <literal>screen</literal> option.
 3069 The <command>lpr -Zscreen</command> option will cause the PJL command
 3070 <literal>PJL SCREEN = ON</literal> to be put into the output to the printer.</para>
 3071 
 3072 <para>Similarly,
 3073 <literal>lpr -Zfuzzy=5</literal> will cause the PostScript command
 3074 <literal> &lt;&lt;/Fuzzy (\%s{fuzzy})&gt;&gt; setpagedevice </literal>
 3075 to be processed and the resulting
 3076 <literal> &lt;&lt;/Fuzzy (5)&gt;&gt; setpagedevice </literal>
 3077 command to be sent to the printer.</para>
 3078 
 3079 </sect1>
 3080 
 3081 <sect1>
 3082 <title>Initialization and Setup Control</title>
 3083 
 3084 <para>Several options are used during
 3085 the processing steps discussed in
 3086 <link linkend="details">Filter Operation Details</link>
 3087 to control what setup is done for the printer.
 3088 <variablelist>
 3089 <varlistentry><term>pjl_init = [ ... ]</term>
 3090 <listitem>
 3091 <para>If PJL is enabled on this printer,
 3092 options in this list are expanded and the resulting values
 3093 are sent to the printer.
 3094 After this,
 3095 the -Z options are expanded and any options which
 3096 are listed in the <symbol>pjl_user_opts</symbol> are processed.</para>
 3097 
 3098 
 3099 </listitem>
 3100 </varlistentry>
 3101 
 3102 <varlistentry><term>ps_init = [ ... ]</term>
 3103 
 3104 <listitem>
 3105 <para>If PostScript is enabled on this printer and a PostScript file
 3106 is being processed,
 3107 then the
 3108 options in this list are expanded and the resulting values
 3109 are sent to the printer.
 3110 After this,
 3111 the -Z options are expanded and any options which
 3112 are listed in the <symbol>ps_user_opts</symbol> are processed.</para>
 3113 
 3114 
 3115 </listitem>
 3116 </varlistentry>
 3117 
 3118 <varlistentry><term>pcl_init = [ ... ]</term>
 3119 
 3120 <listitem>
 3121 <para>If PCL is enabled on this printer and a PCL file
 3122 is being processed,
 3123 then the
 3124 options in this list are expanded and the resulting values
 3125 are sent to the printer.
 3126 After this,
 3127 the -Z options are expanded and any options which
 3128 are listed in the <symbol>pcl_user_opts</symbol> are processed.</para>
 3129 
 3130 </listitem>
 3131 </varlistentry>
 3132 </variablelist>
 3133 </para>
 3134 
 3135 <para>These initialization options are very useful in order to set up
 3136 information controlling the default format or options for a
 3137 print job.
 3138 For example:
 3139 <informalexample>
 3140 <screen>pcl_init = [ normalpage ]
 3141 pcl_normalpage=[ letter crlf linewrap
 3142   portrait clearmargins fixed pitch=10 courier ]</screen>
 3143 </informalexample>
 3144 </para>
 3145 
 3146 <para>When processing a PCL job, <literal>normalpage</literal> is expanded by searching first
 3147 for <literal>normalpage</literal> and then for <symbol>pcl_normalpage</symbol>;
 3148 this in turn results in the expansion of the list of values.
 3149 For example,
 3150 <symbol>pcl_crlf</symbol> is usually defined as <literal>pcl_crlf=\033&amp;k2G</literal>,
 3151 which is the PCL command to translate a New Line (<literal>\015</literal>) character
 3152 as a Carriage Return/New Line.
 3153 The other entries have similar definitions that produce the
 3154 desired effects.</para>
 3155 
 3156 </sect1>
 3157 </chapter>
 3158 
 3159 <chapter>
 3160 <title>Configuration File</title>
 3161 
 3162 <para>This section will cover the <filename>ifhp.conf</filename> file and the various options
 3163 and configuration methods used to control the operation of the &IFHP;
 3164 filter.</para>
 3165 
 3166 
 3167 <sect1>
 3168 <title>Configuration File Entries</title>
 3169 
 3170 <para>The &IFHP; filter uses a simple text based configuration file,
 3171 usually <filename>/usr/local/etc/ifhp.conf</filename> or <filename>/etc/ifhp.conf</filename>
 3172 to get a set of configuration values which control its operation.
 3173 The following sample configuration file segment shows how information
 3174 is specified.
 3175 <informalexample>
 3176 <screen># comment line - first non-blank character is a #
 3177 #---- DEFAULTS ----
 3178 # we first have the default section
 3179 #   - a flag option whose value is 1
 3180 on_flag
 3181 #   - a flag option whose value is 0
 3182 off_flag@
 3183 #   - a flag option whose value is a string (single line)
 3184 #     its value will be 'this is a string'
 3185 strval = this is a string
 3186 #   - a flag option whose value is multiple lines
 3187 #     each additional line starts with whitespace
 3188 #     value is 'this\nis1\na\nstring'
 3189 longstrval = this
 3190  is\061
 3191  a
 3192  string
 3193 #   - and a list that gets expanded -
 3194 #     '[ this ] [ is a\nlist ]' -&gt; [ this is a list ]
 3195 longlist = [ this ] [ is a
 3196  list ]
 3197 #    we can extend a string.
 3198 #    strval will  now be 'this is a string added'
 3199 strval += added
 3200 #    and we can expand a list
 3201 #     '[ this ] [ is a\nlist ] [ more ]' -&gt; [ this is a list more ]
 3202 longlist += [ more ]
 3203 
 3204 # a printer specific section
 3205 # ---- PRINTER ----
 3206 [ hp hp4* ]
 3207 # this match model=hp, model=hp4, model=hp4x
 3208 # override the default
 3209 onflag@
 3210 include /usr/local/etc/ifhp.conf.local
 3211 
 3212 [ entry1 ]
 3213 value
 3214 [ entry2 ]
 3215 tc=entry1</screen>
 3216 </informalexample>
 3217 </para>
 3218 
 3219 </sect1>
 3220 
 3221 <sect1>
 3222 <title>Comments</title>
 3223 
 3224 <para>Comments are lines whose first non-whitespace character is <literal>#</literal>.
 3225 Use <literal>\#</literal> if the first non-whitespace character must be <emphasis remap=tt>#</emphasis>.</para>
 3226 
 3227 </sect1>
 3228 
 3229 <sect1>
 3230 <title>Option Setting</title>
 3231 
 3232 <para>
 3233 <informalexample>
 3234 <screen>Syntax             Equivalent To
 3235 option                     option=1
 3236 option@                    option=0
 3237 option=val
 3238 option=[ v1 v2  ... ]      value contains all whitespace
 3239 option=[ v1                up to the next option entry
 3240  v2                        blank lines and comments
 3241  v3                        are not included
 3242  ]
 3243 option=v1
 3244  v2
 3245  v3</screen>
 3246 </informalexample>
 3247 </para>
 3248 
 3249 <para>If an option's default value is the empty string (<literal>''</literal>).
 3250 The &IFHP; program uses the Perl language convention that this
 3251 value is equivalent to 0 when used in a numerical context or
 3252 the empty string when used in a string context.</para>
 3253 
 3254 <para>In general when a string is used in an integer context it is converted
 3255 to a the appropriate numerical type using the standard Perl/C
 3256 numerical representation and conversion methods.</para>
 3257 
 3258 <para>The <literal>flag</literal> syntax sets the value of <emphasis remap=tt>flag</emphasis> to the string <literal>'1'</literal>,
 3259 that is, the string with a 1 value, and <literal>flag@</literal> sets it to <literal>'0'</literal>. </para>
 3260 
 3261 <para>The <literal>option = value</literal> syntax sets the option value to a string.
 3262 The string can extend across multiple lines.
 3263 A line starting with a space has its value appended to the
 3264 previous option with a new line (<literal>\n</literal>) separator.</para>
 3265 
 3266 <para>As shown in the example,
 3267 the <literal>+=</literal> operator is used to append to a string value.
 3268 The <literal>[ option option ...]</literal> syntax is used to specify that the
 3269 value is a list.
 3270 Lists are used to specify a list of options which can be flags or string
 3271 values.
 3272 Lists have the property of
 3273 <emphasis>recursive evaluation</emphasis>
 3274 which means that the individual list items will be further processed during
 3275 printing.
 3276 This is discussed later in detail.</para>
 3277 
 3278 <para>The <literal>include</literal> facility is currently deprecated,
 3279 and may not be implemented in future releases.
 3280 It will cause the specified file to be read and processed at
 3281 that point in the configuration file.</para>
 3282 
 3283 </sect1>
 3284 
 3285 <sect1>
 3286 <title>Option Use</title>
 3287 
 3288 <para>Options and their values are used to control printer operation.
 3289 There are two types of options:
 3290 those with a predefined or
 3291 <emphasis>builtin</emphasis>
 3292 meaning to the
 3293 &IFHP;
 3294 filter and those which
 3295 have their values sent to the printer when appropriate.
 3296 The builtin options are listed
 3297 and their use is explained
 3298 in later sections.</para>
 3299 
 3300 </sect1>
 3301 
 3302 <sect1>
 3303 <title>List Expansion</title>
 3304 
 3305 <para>The
 3306 &IFHP;
 3307 filter configures a printer by sending the values of options to the printer
 3308 or performing built-in operations.
 3309 An option can have a flag, string, or list value.</para>
 3310 
 3311 <para>A LIST value has the form <literal>[ v1 v2 ... ]</literal>.
 3312 When a list value is to be sent to the printer
 3313 each of <literal>v1</literal>, <emphasis remap=tt>v2</emphasis>, etc. is expanded in turn
 3314 and the corresponding string value or builtin action is carried out.
 3315 If the string value of a term is itself a list,
 3316 the list will be expanded in turn.
 3317 Recursive list evaluation will result in an error.
 3318 The following is an example of list expansion:
 3319 <informalexample>
 3320 <screen>t1=[ p1 p2 ]
 3321 p1=this is
 3322 p2=[ p3 p4 ]
 3323 p3=a
 3324 p4=test</screen>
 3325 </informalexample>
 3326 </para>
 3327 
 3328 <para>The option <literal>t1</literal> is expanded by expanding <emphasis remap=tt>p1</emphasis> and then <emphasis remap=tt>p2</emphasis>;
 3329 The expansion of <literal>p1</literal> produces
 3330 <literal>"this is"</literal>,
 3331 and <literal>p2</literal> produces
 3332 <literal>[p3 p4]</literal>.
 3333 This list is then expanded to produce
 3334 <literal>"a"</literal>
 3335 and
 3336 <literal>"test"</literal>.</para>
 3337 
 3338 <para>Some LIST options are used in
 3339 printer language specific contexts
 3340 and their values are processed appropriately.
 3341 For example,
 3342 pjl_init=[...] specifies a set of
 3343 initialization operations for PJL printers,
 3344 and pcl_init=[...] is used to specify the initialization
 3345 needed for PCL printing.
 3346 The expansion of the LIST entries is done in the language
 3347 specific context.
 3348 For PJL this requires that the output be well formed PJL commands,
 3349 and for PCL that all whitespace be removed.</para>
 3350 
 3351 <para>The context dependent expansion is required because sometimes it
 3352 is necessary to do operations both using PJL and PCL or PJL and PS
 3353 combinations to ensure correct printer operation.
 3354 During expansion the language name and an underscore
 3355 is prefixed to the list entry name and this is used as the option name during expansion.
 3356 If the prefixed name is not found then the unprefixed name will be used.
 3357 For example,  suppose that we have:
 3358 <informalexample>
 3359 <screen>pjl_init=[ initstr test ]
 3360 pcl_init=[ initstr ]
 3361 pjl_initstr=@PJL ECHO YES
 3362 pcl_initstr=\033(*0V
 3363 test=DONE</screen>
 3364 </informalexample>
 3365 </para>
 3366 
 3367 <para>When PJL initialization is being done and we want string values
 3368 for the <symbol>pjl_init</symbol> LIST, we expand  <literal>initstr</literal> and <literal>test</literal>
 3369 in the <symbol>pjl_</symbol> context.
 3370 First a defined <symbol>pjl_initstr</symbol> value will be looked for and then
 3371 a defined <literal>initstr</literal> value.
 3372 Since there is a value of <symbol>pjl_initstr</symbol> it will be used.</para>
 3373 
 3374 <para>Similarly we will check for <symbol>pjl_test</symbol> and <literal>test</literal> values.
 3375 Since <symbol>pjl_test</symbol> does not have a defined value
 3376 the <literal>test</literal> value <acronym>DONE</acronym> will be used.</para>
 3377 
 3378 <para>When PCL initialization is being done and we want string values
 3379 for the <symbol>pcl_init</symbol> LIST, then we expand  <literal>initstr</literal>
 3380 in a similar way, resulting in <literal>\033(*0V</literal>.</para>
 3381 
 3382 <para>We can use the list entry
 3383 <literal>[ option=value ]</literal>
 3384 to temporarily specify the value of a variable
 3385 which is then used during language specific expansion.
 3386 For example,
 3387 suppose that we have the following set of definitions:
 3388 <informalexample>
 3389 <screen>pjl_init=[ initstr=testing ]
 3390 pjl_initstr=@PJL INIT=\%s%lcub;initstr%rcub;XQ</screen>
 3391 </informalexample>
 3392 </para>
 3393 
 3394 <para>As discussed in the next section,
 3395 the <literal>\%s%lcub;initstr%rcub;</literal> will cause the value for the <emphasis remap=tt>initstr</emphasis> value to
 3396 be substituted into the <symbol>pjl_initstr</symbol> string.
 3397 How this is done is discussed in the section on
 3398 <link linkend="stringescape">String Escape Sequences</link>.</para>
 3399 
 3400 </sect1>
 3401 
 3402 <sect1
 3403 id="stringescape">
 3404 <title>String Escape Sequences
 3405 </title>
 3406 
 3407 <para>String values have a syntax similar to PERL or C.
 3408 The <literal>\</literal> (escape) character indicates the start of an escape sequence string.
 3409 This has the syntax:
 3410 <variablelist>
 3411 <varlistentry><term>Standard Character Replacement</term>
 3412 <listitem>
 3413 <para><literal>\f</literal>,
 3414 <literal>\r</literal>,
 3415 <literal>\n</literal>,
 3416 and
 3417 <literal>\t</literal>
 3418 are replaced in turn by the ASCII characters FF, CR, NL,
 3419 and HT whose values are 014, 015, 012, and 011 respectively.</para>
 3420 
 3421 </listitem>
 3422 </varlistentry>
 3423 
 3424 <varlistentry><term>Octal Character Replacement</term>
 3425 
 3426 <listitem>
 3427 <para><literal>\nnn</literal>,
 3428 where nnn is 3 octal digits, is replaced by the corresponding character
 3429 with the specified value.</para>
 3430 
 3431 </listitem>
 3432 </varlistentry>
 3433 
 3434 <varlistentry><term>Option Value Replacement</term>
 3435 
 3436 <listitem>
 3437 <para><literal>\%format{option}  OR  \%format[option]</literal></para>
 3438 
 3439 <para>The value of the option will be determined and replaced by a formatted string.
 3440 The option value is determined by the following algorithm.
 3441 <orderedlist>
 3442 
 3443 <listitem>
 3444 <para>When expanding a list value, the
 3445 <literal>option=word</literal>
 3446 will push the
 3447 <literal>option=word</literal>
 3448 combination onto an evaluation stack,
 3449 and then the <literal>option</literal> value is expanded in the
 3450 current language context.</para>
 3451 </listitem>
 3452 
 3453 <listitem>
 3454 <para>When starting a search for
 3455 <literal>{option}</literal>
 3456 in a language context <symbol>lang_</symbol>,
 3457 the stack of list values is searched in oldest to newest order for a match
 3458 for <symbol>lang_option</symbol> and then for <literal>option</literal>.
 3459 The first one found is used as the option value.</para>
 3460 </listitem>
 3461 
 3462 <listitem>
 3463 <para>After searching the evaluation stack for
 3464 <literal>{option}</literal>
 3465 and finding no match, the <option>-Z</option> command line option values
 3466 are searched for a matching entry.</para>
 3467 </listitem>
 3468 
 3469 <listitem>
 3470 <para>If none is found, then the <option>-T</option> command line option values
 3471 and next the printer configuration will then be searched for
 3472 <symbol>lang_option</symbol> and then for <literal>option</literal>.
 3473 If no match is found,  then the empty string will be the result
 3474 if a string is wanted, or the value 0 if a number is wanted.</para>
 3475 </listitem>
 3476 
 3477 <listitem>
 3478 <para>If the result of this lookup is a list,
 3479 then the list will be expanded in turn,
 3480 and the concatenating values of the expansion will be used.</para>
 3481 </listitem>
 3482 
 3483 <listitem>
 3484 <para>When starting a search for
 3485 <literal>[option]</literal>
 3486 the
 3487 <option>-T</option> command line options will be searched first
 3488 and next the printer configuration will be searched for
 3489 <symbol>lang_option</symbol> and then for <literal>option</literal>.
 3490 If no match is found,  then the empty string will be the result
 3491 if a string is wanted, or the value 0 if a number is wanted.</para>
 3492 </listitem>
 3493 
 3494 <listitem>
 3495 <para>***help*** If the result of this lookup is a list
 3496 If no match was found,
 3497 then the search rules for
 3498 <literal>{option}</literal>
 3499 will be used,
 3500 and the list expansion will be done as described above.
 3501 If no match was found a null (empty string) value will be used.</para>
 3502 </listitem>
 3503 
 3504 </orderedlist>
 3505 </para>
 3506 
 3507 </listitem>
 3508 </varlistentry>
 3509 
 3510 <varlistentry><term>Option Value Format</term>
 3511 
 3512 <listitem>
 3513 <para>
 3514 <informalexample>
 3515 <screen>   %[-][0][length[.precision]][format]
 3516    %d{1}   =&gt;  '1'       %s{1}   =&gt; '1'
 3517    %3d{1}  =&gt;  '  1'     %3s{1}  =&gt; '  1'
 3518    %03d{1} =&gt;  '0001'    %-3s{1} =&gt; '1  '
 3519    %4.2f{1} =&gt; '1.00'
 3520  Special Case Conversion:
 3521    %s{ThisWord} =&gt; 'ThisWord'
 3522    %U{ThisWord} =&gt; 'THISWORD'
 3523    %M{ThisWord} =&gt; 'Thisword'
 3524    %L{ThisWord} =&gt; 'thisword'
 3525 </screen>
 3526 </informalexample>
 3527 
 3528 The format specifies how the value is to appear,
 3529 and is similar to the printf format usage.</para>
 3530 
 3531 <para>Depending on the format type,
 3532 a value will be converted and used appropriately.
 3533 The empty string or null value (<literal>''</literal>) will be treated as a <emphasis remap=tt>'0'</emphasis>
 3534 value when used in an numeric context.</para>
 3535 
 3536 <para>The default format is %d, ie, \%{val} would be \%d{val}.
 3537 The numerical formats supported are: %d, %o, %x, %X, %e, %f, and %g;
 3538 The %s format use the string value of the result.</para>
 3539 
 3540 <para>The
 3541 <literal/U/,
 3542 <literal/M/,
 3543 and
 3544 <literal/L/ have the same behavior as the <literal/s/ format,
 3545 but the string value is then uppercased,
 3546 lowercased  and the first letter uppercased,
 3547 and lowercased respectively.
 3548 This allows various programs that have fussy requirement about the
 3549 case of their options to be handled correctly.
 3550 </para>
 3551 
 3552 </listitem>
 3553 </varlistentry>
 3554 </variablelist>
 3555 </para>
 3556 
 3557 </sect1>
 3558 
 3559 <sect1>
 3560 <title>Language Context and Value Expansion</title>
 3561 
 3562 <para>The &IFHP; filter sends initialization and configuration commands to the
 3563 printer.
 3564 Depending on the type of language of a print file (i.e. - PostScript or PCL),
 3565 different command formats would need to be used to implement different options.
 3566 For example,  to implement a <emphasis>landscape</emphasis> option for a PJL aware printer
 3567 you would need to send the PJL command <literal>@PJL SET ORIENTATION=LANDSCAPE</literal>.
 3568 For a PostScript printer you would need to send a very strange string
 3569 which would depend on the actual printer mode.</para>
 3570 
 3571 <para>Our language context also includes various checks for
 3572 language specific dependencies.
 3573 This section refers to material that is discussed in depth in later
 3574 sections of this document,
 3575 and on first reading may be a little confusing.
 3576 However,
 3577 if you are not aware of some of these restrictions then much of the information
 3578 in the configuration files may be very confusing.</para>
 3579 
 3580 
 3581 <sect2>
 3582 <title>PJL Language</title>
 3583 
 3584 <para>A PJL command has the form
 3585 <literal>@PJL OPCODE ...</literal>,
 3586 and PJL commands must be sent as a block before any other commands.
 3587 In order to assist with this,
 3588 the &IFHP; filter provides the following assistance.
 3589 When expanding a list value,
 3590 each list entry is expected to form a well formatted PJL command.
 3591 <orderedlist>
 3592 
 3593 <listitem>
 3594 <para>Before sending any PJL command to the printer,
 3595 the PJL Universal Exit Command
 3596 (<literal>\033%-12345X</literal>)
 3597 string is sent to the printer.
 3598 This is automatically done if <literal>pjl</literal> is enabled for the printer.</para>
 3599 </listitem>
 3600 
 3601 <listitem>
 3602 <para>The list item is expanded,
 3603 and all value substitutions are done.
 3604 Leading and trailing whitespace is removed,
 3605 all characters are converted to uppercase,
 3606 and a new line (<literal>\n</literal>) value is appended to the command.</para>
 3607 </listitem>
 3608 
 3609 <listitem>
 3610 <para>Because not all printers support all PJL commands,
 3611 the &IFHP; filter performs uses the
 3612 <symbol>pjl_only</symbol>
 3613 and
 3614 <symbol>pjl_except</symbol>
 3615 configuration lists to ensure that the options are allowed by the printer.
 3616 The OPCODE must appear in the
 3617 <symbol>pjl_only</symbol>
 3618 list and not in the
 3619 <symbol>pjl_except</symbol>
 3620 list.
 3621 For example:
 3622 <informalexample>
 3623 <screen>pjl_only = [ JOB SET STATUS ]
 3624 pjl_except = [ STATUS ]</screen>
 3625 </informalexample>
 3626 
 3627 </para>
 3628 
 3629 <para>The <symbol>pjl_only</symbol> indicates that the printer supports the PJL JOB, SET, and STATUS
 3630 commands,  but the <symbol>pjl_except</symbol> list removes the STATUS from this list.
 3631 This means that only the
 3632 JOB and SET commands will be allowed.</para>
 3633 </listitem>
 3634 
 3635 <listitem>
 3636 <para>If the command is a <acronym>SET</acronym> command,
 3637 then the PJL variable must appear in the <symbol>pjl_vars_set</symbol>  list
 3638 and not in the <symbol>pjl_vars_except</symbol> list.
 3639 <informalexample>
 3640 <screen>pjl_vars_set = [ PAPER SIZE ORIENTATION ]
 3641 pjl_vars_except = [ PAPER ]
 3642 
 3643 @PJL SET SIZE=A4
 3644 @PJL SET PAPER=LETTER</screen>
 3645 </informalexample>
 3646 
 3647 </para>
 3648 
 3649 <para>In the above example, the <literal>SIZE=A4</literal> command would be allowed
 3650 and sent while the
 3651 <literal>PAPER=LETTER</literal> command would be rejected and not sent.</para>
 3652 </listitem>
 3653 
 3654 </orderedlist>
 3655 </para>
 3656 
 3657 </sect2>
 3658 
 3659 <sect2>
 3660 <title>PCL Language</title>
 3661 
 3662 <para>When sending PCL initialization strings to a printer,
 3663 it is essential to send nothing that could cause a printable character to
 3664 be sent before the actual file contents.
 3665 Such output could cause the location and positioning of text to be altered
 3666 in unexpected ways.
 3667 To avoid this,
 3668 the following steps are taken when expanding a list in a PCL language context.
 3669 <orderedlist>
 3670 
 3671 <listitem>
 3672 <para>Before any PCL string is sent to the printer,
 3673 the PCL End of Job
 3674 (<literal>\033E</literal>) string is sent to the printer.</para>
 3675 </listitem>
 3676 
 3677 <listitem>
 3678 <para>All whitespace (blanks, tabs, etc) are removed from the string value.</para>
 3679 </listitem>
 3680 
 3681 <listitem>
 3682 <para>Next, all escaped values are substituted.
 3683 At this point you can
 3684 <emphasis>force</emphasis>
 3685 printable strings containing whitespace into the output by using the
 3686 <literal>\nnn</literal>
 3687 escape mechanism.</para>
 3688 </listitem>
 3689 
 3690 <listitem>
 3691 <para>All list values are concatenated and then sent to the printer.</para>
 3692 </listitem>
 3693 
 3694 </orderedlist>
 3695 </para>
 3696 
 3697 </sect2>
 3698 
 3699 <sect2>
 3700 <title>PostScript Language</title>
 3701 
 3702 <para>The PostScript language processing is very minimal,
 3703 as there are few problems sending PostScript to a printer.
 3704 <orderedlist>
 3705 
 3706 <listitem>
 3707 <para>Before sending any PostScript initialization strings,
 3708 the PostScript End of Job indicator
 3709 (<literal>\004</literal> or Control-D) is sent.</para>
 3710 </listitem>
 3711 
 3712 <listitem>
 3713 <para>Strings are then expanded and the escape sequences are substituted.</para>
 3714 </listitem>
 3715 
 3716 <listitem>
 3717 <para>Individual strings have a newline
 3718 (<literal>\n</literal>) appended to them before being sent to the printer.</para>
 3719 </listitem>
 3720 
 3721 </orderedlist>
 3722 </para>
 3723 
 3724 </sect2>
 3725 </sect1>
 3726 
 3727 <sect1>
 3728 <title>Printer Entries</title>
 3729 
 3730 <para>The <filename>ifhp.conf</filename> file is divided into printer entries by <literal>[ pattern pattern ...]</literal>
 3731 lines.
 3732 Each pattern is glob matched against the <literal>model</literal> option value,
 3733 and if the match is successful then the options on the following lines
 3734 until the next
 3735 printer entry header
 3736 are appended to the specific printer configuration entry.</para>
 3737 
 3738 <para>By convention,
 3739 each configuration file is assumed to start with the header
 3740 <literal>[ default ]</literal>,
 3741 and the initial set of lines are used to
 3742 set default values for the various &IFHP; options.</para>
 3743 
 3744 <para>The algorithm for scanning the configuration files first
 3745 sets the <literal>model</literal> value to <emphasis remap=tt>default</emphasis>,
 3746 and extracts the default information.
 3747 It then sets the <literal>model</literal> value to the user specified value,
 3748 and rescans the configuration file information.</para>
 3749 
 3750 <para>If users need to add or modify the <filename>ifhp.conf</filename> file,
 3751 then they should add their entries to the end of the file,
 3752 and override any default options by specific values in their new entry.
 3753 To aid with system configuration and maintenance,
 3754 the distributed <filename>ifhp.conf</filename> file has the following text at the end of the file:
 3755 <informalexample>
 3756 <screen>##### This is the end of the standard ifhp.conf file.
 3757 ##### Add your local files after this
 3758 ##### If you want to override some entries, simply change the names to
 3759 ##### something different, i.e. hp4 hp4.old
 3760 ##### Here is a script to do this and then append your local file to the
 3761 ##### end of the ifhp.conf file:
 3762 #####
 3763 ##### #!/bin/sh
 3764 ##### for i in $* ; do
 3765 #####   perl -spi.bak -e 's/ $i / $i.orig /g' ifhp.conf
 3766 ##### done
 3767 #####
 3768 ##### sed -n -e '1,/XXX END XXX/p' ifhp.conf &gt;ifhp.conf.new
 3769 ##### sed '1,/XXX END XXX/d' ifhp.old &gt;&gt; ifhp.conf.new
 3770 #####
 3771 ##### You can probably improve on this.
 3772 #####
 3773 #### XXX END XXX #####
 3774 
 3775 # user adds new default values here for all printer entries
 3776 [ default ]
 3777 # set default value
 3778 pcl_option= \033test
 3779 
 3780 [ mypcl_printer ]
 3781 # override default value
 3782 pcl_option=
 3783 </screen>
 3784 </informalexample>
 3785 </para>
 3786 
 3787 </sect1>
 3788 
 3789 <sect1>
 3790 <title>Include Facility</title>
 3791 <para>
 3792 The <literal>include filename</literal>
 3793 facility is similar to the standard compiler
 3794 file inclusion facility.
 3795 The specified file or list of files separated by commas or whitespace
 3796 will be substituted for the indicated line.
 3797 </para>
 3798 </sect1>
 3799 
 3800 <sect1>
 3801 <title>tc Entry Inclusion Facility</title>
 3802 <para>
 3803 The <literal>tc=entry</literal> facilty is similar to the printcap <literal>tc</literal>
 3804 facility used in the &LPRng; software other places.
 3805 The specified entry or list of entries separated by commas or whitespace
 3806 will be substituted for the indicated line.
 3807 </para>
 3808 </sect1>
 3809 </chapter>
 3810 
 3811 <chapter
 3812 id="details">
 3813 <title>Filter Operation Details
 3814 
 3815 </title>
 3816 
 3817 <para>The
 3818 &IFHP;
 3819 filter operates by first reading a configuration file
 3820 to determine the type of printer it is working with,
 3821 and then proceeds to carry out operations requested by the values of
 3822 option variables passed on the command line or found in the configuration
 3823 files.
 3824 In normal operation,
 3825 input is read from
 3826 <acronym>STDIN</acronym>
 3827 (file descriptor 0)
 3828 and results written to
 3829 <acronym>STDOUT</acronym> (file descriptor 1).
 3830 Status reports are written to
 3831 a status file or optionally to
 3832 <acronym>STDERR</acronym> (file descriptor 2),
 3833 together with any error messages or diagnostics.</para>
 3834 
 3835 <para>In addition to normal operation
 3836 the filter can run in the
 3837 <acronym>OF</acronym> mode and act as a printer initializer and job terminator.
 3838 This is discussed in detail in the &LPRng; documentation.
 3839 When in the OF mode
 3840 the two character sequence <literal>"\031\001"</literal> to the filter.
 3841 will cause the filter to suspend itself by sending itself a <acronym>SIGSUSP</acronym>
 3842 signal.
 3843 The print spooler will detect this and then
 3844 send job files to the same output device.
 3845 After the files have been transferred the
 3846 the filter will be restarted with a SIGCONT signal.</para>
 3847 
 3848 
 3849 <sect1>
 3850 <title>Filter Pseudo-Code</title>
 3851 
 3852 <para>The details of the filter operations are
 3853 described in the following
 3854 <emphasis>pseudo-code</emphasis>.
 3855 The sections marked with <literal>###</literal> are discussed later in this document
 3856 in detail.</para>
 3857 
 3858 <para><filename>///</filename> See:
 3859 <link linkend="setup">Options, Initialization and Setup</link>
 3860 <informalexample>
 3861 <screen>###+++ Initialization and Setup
 3862 // get ifhp information from PRINTCAP_ENTRY environment variable
 3863 if( PRINTCAP_ENTRY environment variable has a value ){
 3864     split printcap information into printcap fields
 3865     if( :ifhp=options,options is present in printcap ){
 3866         split the options list and place in the Toptions list
 3867     }
 3868 }
 3869 Add the -T command line options to the Toptions list
 3870 Add the -Z command line options to the Zoptions list
 3871 foreach option in -Toptions do
 3872     if( option = "debug=level" ){
 3873         set Debuglevel = level;
 3874     }
 3875     if( option = "trace" ){
 3876         output error and trace on STDERR
 3877     }
 3878     if( option = "config=pathlist" ){
 3879         set configuration pathlist = pathlist;
 3880     }
 3881     if( option = "model=name" and model not set ){
 3882         set model = name;
 3883     }
 3884 }
 3885 Read the configuration files from the config file list
 3886 Prepend each file with a [ default ] header
 3887 
 3888 Scan the configuration files for [ default ] entries;
 3889   later entry values will override earlier ones.
 3890 
 3891 Repeat the scan, but this time search for [ model ] entries
 3892   matching the specified model.
 3893 
 3894 Put the command line options and -T options into configuration
 3895   information, effectively overriding the information from the
 3896   configuration files.
 3897 
 3898 if( appsocket ) {
 3899    Get the :lp=... entry from the PRINTCAP_ENTRY environment variable
 3900    if( no information ) {
 3901        use the getpeername() to get the TCP/IP address of the current
 3902        connection.
 3903    }
 3904    if( no informtion AND no dev=... parameter ) {
 3905        error!
 3906    }
 3907    close connection to printer and set -Tdev= device or IP Address
 3908 }
 3909 
 3910 // open a connection to the printer if required
 3911 // usually only done when appsocket protocol is used
 3912 if( device specified using -Tdev=device ){
 3913     close(1)
 3914     // if device is host%port, we open TCP/IP connection
 3915     fd = open(device);
 3916     // Note - status  opens RW
 3917     //        status@ opens WO
 3918     dup fd to 1; close fd;
 3919 }
 3920 
 3921 ###---</screen>
 3922 </informalexample>
 3923 
 3924 <filename>///</filename> See:
 3925 <link linkend="syncpage">Synchronization and Pagecount</link>
 3926 <informalexample>
 3927 <screen>###+++ Synchronization and Pagecount
 3928 if( status returned by printer and sync requested ){
 3929     do{
 3930         send command and wait for timeout;
 3931     } while( no response );
 3932     if( appsocket ){
 3933         close and reopen TCP/IP connection;
 3934     }
 3935 }
 3936 
 3937 
 3938 if( status and pagecount requested ){
 3939     // pagecount has the form pagecount@ (none),
 3940     //   pagecount=ps, pagecount=pjl, ...
 3941     if( pagecount=language has value ) do {
 3942         if( pagecount TRUE ){
 3943             set pagecount= pjl or ps depending on availability
 3944         }
 3945         if( pagecount = pjl and PJL INFO available ){
 3946            send PJL INFO PAGECOUNT command to printer
 3947         } else if( pagecount = ps ){
 3948            send PS program to printer
 3949         } else {
 3950             terminate with error;
 3951         }
 3952     } while( no pagecount response );
 3953     if( appsocket ){
 3954         close and reopen TCP/IP connection;
 3955     }
 3956 }
 3957 ###---</screen>
 3958 </informalexample>
 3959 
 3960 <filename>///</filename> See:
 3961 <link linkend="pjlinit">PJL Initialization</link>
 3962 <informalexample>
 3963 <screen>### PJL INITIALIZATION
 3964 if( PJL enabled ){
 3965     language = "pjl_"
 3966     foreach option in pjl_init=[...] {
 3967        expand the option using the language value
 3968        #+++ PJL OPTION ACTIONS +++
 3969        if( option in pjl_vars_set=[ ... ]
 3970          and option not in pjl_vars_except
 3971          expand "@PJL SET OPTION=\%{option}"
 3972          output = expanded string value
 3973        } else {
 3974          if( option value is a string ){
 3975            output = expanded string value;
 3976          }
 3977        }
 3978        // output has the form @PJL COMMAND ....
 3979        if( COMMAND is in pjl_only=[ ... ]
 3980            and not in pjl_except=[ ... ] ){
 3981            send output to printer
 3982        }
 3983        #--- end PJL OPTION ACTIONS
 3984     }
 3985     if( !OF_mode ){
 3986          foreach option in -Toption=value {
 3987             if( option in pjl_user_opts ){
 3988                 #+++ USER PJL OPTIONS
 3989                 // join 'pjl_' and the option name
 3990                 expand 'pjl_' . option
 3991                 // perform PJL actions as above
 3992                     #+++ PJL OPTION ACTIONS +++
 3993                     ....
 3994                     #-- PJL OPTION ACTIONS +++
 3995                 #--- USER PJL OPTIONS
 3996             }
 3997          }
 3998          foreach option in -Zoption=value {
 3999             if( option in pjl_user_opts ){
 4000                 // perform USER PJL actions as above
 4001                 #+++ USER PJL OPTIONS
 4002                 #--- USER PJL OPTIONS
 4003             }
 4004          }
 4005     }
 4006 }
 4007 
 4008 ###--- PJL INITIALIZATION</screen>
 4009 </informalexample>
 4010 
 4011 <filename>///</filename> See:
 4012 <link linkend="conversion">File Conversion Support</link>
 4013 <informalexample>
 4014 <screen>// language is set to the type of job language
 4015 // - PS, PCL, TEXT, RAW, UNKNOWN
 4016 //  the first part of the job file is read and the filter takes
 4017 //  a (wimpy) guess at the job file based only on the first couple
 4018 //  of characters;  language is  be PJL, PS, or TEXT, or RAW
 4019 //  This is the same algorithm as the UNIX FILE utility
 4020 
 4021 language = default_language (from configuration);
 4022 if( command line -c (binary) option present ){
 4023     language = RAW;
 4024 } else if( -Zlanguage=xxx option present ){
 4025     language=xxx
 4026 } else if( forceconversion set ){
 4027     use UNIX file utility to get file type
 4028 } else if( file is PS file ){
 4029     language=PS
 4030     if( file starts with PS EOJ (CTRL-D)
 4031         and ps_eoj_at_start is clear ){
 4032         remove the PS EOJ
 4033     } else {
 4034         send a PS EOJ first
 4035     }
 4036 } else if( file is PCL file ){
 4037     language=PCL
 4038     if( file starts with PCL EOJ (ESC E)
 4039         and pcl_eoj_at_start is clear ){
 4040         remove the PCL EOJ
 4041     }
 4042 }
 4043 if( file conversion table specified then ){
 4044     look up file type in conversion table;
 4045     if( conversion program specified ){
 4046         run input through conversion program
 4047     }
 4048     set file type to output type
 4049 }
 4050 
 4051 
 4052 if( language = TEXT and PCL allowed ){
 4053     language = PCL;
 4054 }
 4055 
 4056 if( language not recognized by printer ){
 4057     exit with error;
 4058 }
 4059 
 4060 if( PJL ENTER supported ){
 4061     use PJL ENTER command to select language;
 4062     send nullpad NULLS to force full buffer condition
 4063 }</screen>
 4064 </informalexample>
 4065 
 4066 <filename>///</filename> See:
 4067 <link linkend="languageinit">Language Specific Initialization</link>
 4068 <anchor id="pcl-user-opts">
 4069 <anchor id="ps-user-opts">
 4070 <informalexample>
 4071 <screen>// LANGUAGE SPECIFIC INITIALIZATIONS
 4072 if( language = PCL ){
 4073     foreach option in pcl_init {
 4074         ###+++ expansion
 4075         do expansion similar to PJL OPTION actions
 4076             using "pcl_" prefix for option lookup;
 4077         ###---
 4078     }
 4079     if( not in OF_MODE ){
 4080         foreach option in -Toption do {
 4081             if( option in pcl_user_vars=[ ... ] ){
 4082             ###+++ expansion as above
 4083             ###---
 4084         }
 4085         foreach option in -Zoption do {
 4086             if( option in pcl_user_opts=[ ... ] ){
 4087             ###+++ expansion as above
 4088             ###---
 4089         }
 4090     }
 4091     remove whitespace and expand string results;
 4092 } else if( language = PS ){
 4093     ###+++ language specific actions as above,
 4094       using the ps_ prefix for lookup
 4095       allow only user option in the ps_user_opts list
 4096     expand string results but do not remove whitespace
 4097 }</screen>
 4098 </informalexample>
 4099 
 4100 <filename>///</filename> See:
 4101 <link linkend="filetransfer">File Transfer and Error Status Monitoring</link>
 4102 <informalexample>
 4103 <screen>Transfer job to printer, reading error and other information
 4104   back from the printer if enabled
 4105 
 4106 if( language = PCL ){
 4107     send PCL End of Job
 4108 } else if( language = PS ){
 4109     send PS End of Job
 4110 }
 4111 
 4112 
 4113 // job termination
 4114 
 4115 ###+++ Synchronization and Pagecount as above
 4116 finished = 0
 4117 while( waitend and not finished ){
 4118     // timeouts and retries are done here
 4119     if( time taken is too long ){
 4120         give up and report an error
 4121     }
 4122     if( waitend with PJL ){
 4123         wait for end of job using UINFO;
 4124     } else if( waitend with PS ){
 4125         send PostScript echo program to printer
 4126         if end_ctrl_t then add ^T
 4127     }
 4128     wait for response
 4129     if( response has end of job indication ) {
 4130         finished = 1;
 4131     }
 4132 }
 4133 if( pagecount ){
 4134     if( appsocket ){
 4135         close and reopen connection;
 4136     }
 4137     get pagecount using previously described algorithm
 4138 }
 4139 
 4140 ###---
 4141 
 4142 exit</screen>
 4143 </informalexample>
 4144 </para>
 4145 
 4146 </sect1>
 4147 
 4148 <sect1
 4149 id="setup">
 4150 <title>Options, Initialization and Setup
 4151 </title>
 4152 
 4153 <para>During the setup step,
 4154 the &IFHP; system will extract command line options
 4155 and scan configuration files for printer entries.
 4156 These operations are covered in detail in other sections.</para>
 4157 
 4158 </sect1>
 4159 
 4160 <sect1
 4161 id="languages">
 4162 <title>Languages Supported- pjl, pcl, ps, and text
 4163 </title>
 4164 <itemizedlist>
 4165 <listitem><para><literal/pjl/ FLAG <emphasis/PJL Supported/</para></listitem>
 4166 <listitem><para><literal/pcl/ FLAG <emphasis/PCL Supported/</para></listitem>
 4167 <listitem><para><literal/ps/ FLAG <emphasis/PostScript Supported/</para></listitem>
 4168 <listitem><para><literal/text/ FLAG <emphasis/Text Supported/</para></listitem>
 4169 </itemizedlist>
 4170 
 4171 <para>These flags set the languages that are recognized or processed by
 4172 the filter.</para>
 4173 
 4174 
 4175 <sect2
 4176 id="pjl-job">
 4177 <title>pjl_job FLAG
 4178 </title>
 4179 <itemizedlist>
 4180 <listitem><para><literal/pjl_job/ FLAG <emphasis/Send PJL Job and EOJ/</para></listitem>
 4181 </itemizedlist>
 4182 
 4183 <para>If PJL is enabled and the <literal/pjl_job/ flag is SET
 4184 a PJL JOB and PJL EOJ command will be generated
 4185 and sent to the printer at the job start and end respectively.
 4186 The <literal/JOB/ command has the form:
 4187 <informalexample>
 4188 <screen>@PJL JOB NAME = "..." [ START = nnn ] [ END = mmm ]</screen>
 4189 </informalexample>
 4190 
 4191 The START and END values can be specified by
 4192 <literal>-Zstartpage=nnn</literal>
 4193 and
 4194 <literal>-Zendpage=mmm</literal>
 4195 command line options.
 4196 The EOJ command has must match the JOB command.
 4197 <informalexample>
 4198 <screen>@PJL EOJ NAME = "..." [ START = nnn ] [ END = nnn ]</screen>
 4199 </informalexample>
 4200 </para>
 4201 
 4202 </sect2>
 4203 
 4204 <sect2
 4205 id="pjl-enter">
 4206 <title>pjl_enter FLAG
 4207 </title>
 4208 <itemizedlist>
 4209 <listitem><para><literal/pjl_enter/ FLAG <emphasis/Send PJL ENTER /</para></listitem>
 4210 </itemizedlist>
 4211 
 4212 <para>If PJL is enabled and the <literal/pjl_enter/ flag is SET,
 4213 a PJL ENTER LANGUAGE = xx command will be generated
 4214 when PCL or PS files are sent to the printer.
 4215 <informalexample>
 4216 <screen>@PJL ENTER LANGUAGE = PCL
 4217 @PJL ENTER LANGUAGE = POSTSCRIPT</screen>
 4218 </informalexample>
 4219 </para>
 4220 
 4221 </sect2>
 4222 
 4223 <sect2
 4224 id="remove-pjl-at-start">
 4225 <title>remove_pjl_at_start FLAG
 4226 </title>
 4227 <itemizedlist>
 4228 <listitem><para><literal/remove_pjl_at_start/ FLAG <emphasis/Remove PJL code from begining of job/</para></listitem>
 4229 </itemizedlist>
 4230 
 4231 <para>Some printer drivers will prepend PJL code to the begining of print jobs.  If the <literal/remove_pjl_at_start/ flag is SET,
 4232 &IFHP; will remove this PJL code.</para>
 4233 
 4234 </sect2>
 4235 
 4236 <sect2
 4237 id="nullpad">
 4238 <title>nullpad STRING
 4239 </title>
 4240 <itemizedlist>
 4241 <listitem><para><literal/nullpad=/ ephasis/null character count/</para></listitem>
 4242 </itemizedlist>
 4243 
 4244 <para>Some older model HP printers require receiving a large number of
 4245 NULL (0) characters to force commands in the input buffer to be read.
 4246 This can be done using the
 4247 <literal>nullpad</literal> option.
 4248 In practice,
 4249 this has turned out to be largely irrelevant
 4250 as most newer printers and network interface printers
 4251 do not have this problem.
 4252 </para>
 4253 
 4254 </sect2>
 4255 
 4256 <sect2
 4257 id="pjl-console">
 4258 <title>pjl_console FLAG
 4259 </title>
 4260 <itemizedlist>
 4261 <listitem><para><literal/pjl_console/ FLAG <emphasis/printer console messages/</para></listitem>
 4262 </itemizedlist>
 4263 
 4264 <para>When this flag is set and PJL is available
 4265 and the PJL
 4266 <acronym>RDYMSG</acronym>
 4267 command is supported,
 4268 then a short message will be put on the console.</para>
 4269 
 4270 </sect2>
 4271 
 4272 <sect2
 4273 id="remove-ctrl">
 4274 <title>remove_ctrl STRING
 4275 </title>
 4276 <itemizedlist>
 4277 <listitem><para><literal/remove_ctrl=/<emphasis/remove control characters /</para></listitem>
 4278 </itemizedlist>
 4279 
 4280 <para>The
 4281 <symbol>remove_ctrl</symbol> string option species a list of (control) characters
 4282 that will be removed from PostScript jobs.
 4283 This solves the problem of jobs with embedded Control-T or Control-C
 4284 characters causing abnormal printer operation.
 4285 For example:
 4286 <informalexample>
 4287 <screen>remove_ctrl=CT</screen>
 4288 </informalexample>
 4289 
 4290 would cause Control-C and Control-T characters to be removed.</para>
 4291 
 4292 </sect2>
 4293 
 4294 <sect2
 4295 id="tbcp">
 4296 <title>tbcp FLAG
 4297 </title>
 4298 <itemizedlist>
 4299 <listitem><para><literal/tbcp/ FLAG <emphasis/Use TBCP protocol/</para></listitem>
 4300 </itemizedlist>
 4301 
 4302 <para>The
 4303 <literal>tbcp</literal>
 4304 flag can be specified as a user option as well as a
 4305 configuration file option.
 4306 If the file type is PostScript and this flag is set
 4307 then the file is transferred using the Transparent Binary Communication
 4308 Protocol.
 4309 (See the Adobe PostScript Language Reference Manual for details on
 4310 the protocol.)</para>
 4311 
 4312 <para>At the start of the PostScript job,
 4313 the sequence <literal>\001</literal> <emphasis remap=tt>M</emphasis> is sent.
 4314 Afterwards,  all control characters in the set
 4315 <literal>0x01, 0x03, 0x04, 0x05,
 4316 0x11, 0x13, 0x14, 0x1C,</literal>
 4317 are replaced by the two character sequence <literal>\001</literal>
 4318 <literal>X+'@'</literal> or
 4319 <literal>X+'\100'</literal> or
 4320 is sent.
 4321 For example:
 4322 <informalexample>
 4323 <screen>C\001\003   -&gt;  \001\115\103\001\101\001\103 or \001MC\001A\001C</screen>
 4324 </informalexample>
 4325 </para>
 4326 
 4327 </sect2>
 4328 </sect1>
 4329 
 4330 <sect1
 4331 id="syncpage">
 4332 <title>Synchronization and Pagecounts
 4333 </title>
 4334 
 4335 <itemizedlist>
 4336 <listitem><para><literal/accounting=/ <emphasis/accounting program/</para></listitem>
 4337 <listitem><para><literal/accounting_info=/ <emphasis/accounting information/</para></listitem>
 4338 <listitem><para><literal/pagecount/ FLAG or Option <emphasis/pagecounter available /</para></listitem>
 4339 <listitem><para><literal/pagecount_interval=/ <emphasis/get pagecounter interval /</para></listitem>
 4340 <listitem><para><literal/pagecount_timeout=/ <emphasis/get pagecounter timeout /</para></listitem>
 4341 <listitem><para><literal/pagecount_start=/ <emphasis/get pagecounter at job start /</para></listitem>
 4342 <listitem><para><literal/pagecount_end=/ <emphasis/get pagecounter at job end /</para></listitem>
 4343 <listitem><para><literal/pagecount_ps_code=/ <emphasis/PostScript to get pagecounter /</para></listitem>
 4344 <listitem><para><literal/sync/ FLAG or Option <emphasis/sync required /</para></listitem>
 4345 <listitem><para><literal/sync_interval=/ <emphasis/do sync at interval /</para></listitem>
 4346 <listitem><para><literal/sync_timeout=/ <emphasis/sync timeout /</para></listitem>
 4347 <listitem><para><literal/wait_for_banner/ FLAG <emphasis/wait for banner page /</para></listitem>
 4348 </itemizedlist>
 4349 
 4350 <para>Many printers are able to provide status information back to the
 4351 filter.
 4352 It is assumed that in these circumstances file descriptor 1
 4353 (FD1)
 4354 is
 4355 <emphasis>bidirectional</emphasis>
 4356 and status information can be read from it.
 4357 When the
 4358 <literal>status</literal>
 4359 option is TRUE,
 4360 FD1 is readable and is a device or communications socket,
 4361 then the filter assumes that it can read FD1.
 4362 </para>
 4363 
 4364 <para>Synchronization is usually done in order to ensure that a previously
 4365 spooled job or printer action has completed correctly,
 4366 and the printer is ready to accept a new job.
 4367 It is usually carried out by sending a request to the printer to
 4368 echo a string back to the filter.
 4369 Clearly,
 4370 if the printer cannot provide status or echo values back,
 4371 then synchronization is impossible.</para>
 4372 
 4373 <para>The value of the
 4374 <literal>sync</literal> option determines if a PJL ECHO command or simple PostScript
 4375 program is used.
 4376 The PostScript program has the form:
 4377 <informalexample>
 4378 <screen>\004%!PS-Adobe-2.0
 4379 ( %%[ echo: <acronym>TODSTR</acronym> ]%% ) print () = flush
 4380 \004</screen>
 4381 </informalexample>
 4382 where <acronym>TODSTR</acronym> is replaced with the current Time of Day.</para>
 4383 
 4384 <para>To control obtaining synchronization,
 4385 the
 4386 <literal>sync_interval=nnn</literal>
 4387 and
 4388 <literal>sync_timeout=nnn</literal>
 4389 options are used.
 4390 The PJL or PS command is repeated at
 4391 <literal>sync_interval=nnn</literal>
 4392 second intervals; if nnn is 0, then it is sent only once.
 4393 If synchronization is not obtained within
 4394 <literal>sync_timeout=nnn</literal>
 4395 seconds, then the filter exits with an error status.
 4396 A 0 value or
 4397 <literal>sync_timeout@</literal>
 4398 disables timeouts.</para>
 4399 
 4400 <para>
 4401 When the &IFHP; filter is operating in OF mode and the
 4402 <literal/wait_for_banner/ option is true,
 4403 the filter will wait until it determines that the banner page
 4404 has been completely printed before carrying out other filter functions.
 4405 </para>
 4406 
 4407 <para>Pagecounts are used to do accounting and report the number of pages
 4408 used for a job.
 4409 Most printers have a hardware based pagecounter mechanism whose value
 4410 can be read by the appropriate PJL command or PostScript program.
 4411 For example, if the PJL INFO command
 4412 <informalexample>
 4413 <screen>@PJL INFO PAGECOUNT</screen>
 4414 </informalexample>
 4415 is supported by a printer,
 4416 the printer will return a status message containing the current pagecounter
 4417 value.
 4418 Printers that support PostScript may also be able to access the pagecounter
 4419 value using a PostScript program.
 4420 The exact details of the PostScript program vary from vendor to vendor and
 4421 the
 4422 <literal>pagecount_ps_code=...</literal>
 4423 option specifies the PostScript program to use.
 4424 For example:
 4425 <informalexample>
 4426 <screen>pagecount_ps_code=
 4427   /p {print} def ( %%[ pagecount: ) p
 4428   statusdict begin pagecount end 20 string cvs p
 4429   ( ]%% ) p () = flush</screen>
 4430 </informalexample>
 4431 </para>
 4432 
 4433 
 4434 <para>The <application/lpd/ print server and the &IFHP; filter must act
 4435 in coordination to do reliable pagecounting.
 4436 The following options are used by the &IFHP; filter to
 4437 assist with this:
 4438 <informaltable frame=all id=pagecountoptions>
 4439 <tgroup cols=2 colsep=1 rowsep=1 align=left >
 4440 <thead><row><entry>Option</entry><entry>Purpose</entry></row></thead>
 4441 <tbody>
 4442 <row><entry><literal/accounting=/.../</entry><entry> accounting program</entry></row>
 4443 <row><entry><literal/accounting_info=AnPR/</entry><entry> accounting information</entry></row>
 4444 <row><entry><literal/pagecount@/</entry><entry> do not get pagecounter value</entry></row>
 4445 <row><entry><literal/pagecount/</entry><entry> get pagecounter using either PJL or PostScript if available on the printer (default)</entry></row>
 4446 <row><entry><literal/pagecount=pjl/</entry><entry> get pagecounter using PJL</entry></row>
 4447 <row><entry><literal/pagecount=ps/</entry><entry> get pagecounter using PostScript</entry></row>
 4448 <row><entry><literal/pagecount_start/</entry><entry> get pagecounter at job start (default)</entry></row>
 4449 <row><entry><literal/pagecount_end/</entry><entry> get pagecounter at job end (default)</entry></row>
 4450 <row><entry><literal/pagecount_poll=N/</entry><entry> if nonzero, poll printer and conclude pagecounter value is nonzero when identical N times (default 1)</entry></row>
 4451 <row><entry><literal/pagecount_interval/</entry><entry> if polling more than once,  then leave this interval (in seconds) between polls.</entry></row>
 4452 <row><entry><literal/of_options=.../</entry><entry> Use these option values when running in OF Mode</entry></row>
 4453 </tbody>
 4454 </tgroup>
 4455 </informaltable>
 4456 </para>
 4457 <para>The following options are used in the &LPRng; printcap entry
 4458 to assist with getting the pagecounter values:
 4459 <informalexample>
 4460 <screen>lp:
 4461   # run at job start
 4462   :as=/.../accounting_at_start
 4463   # run at job end
 4464   :ae=/.../accounting_at_end
 4465   # -a filter option value or last command line argument
 4466   :af=/.../acct
 4467   # default filter
 4468   :filter=/.../ifhp
 4469   # of filter - run before and after job, can be suspended
 4470   # desperation flag for desperate situations
 4471   #:suspend_of_filter@
 4472   :of=/.../ifhp
 4473   #options
 4474   :ifhp=...,of_options=pagecount waitend</screen>
 4475 </informalexample>
 4476 </para>
 4477 
 4478 <para>The <literal>:as</literal> program is run at the start of a print job,
 4479 and is used to determine if the user has sufficient resourses to print
 4480 a job.
 4481 The <literal>:ae</literal> program is run at the end of a print job and is used to
 4482 collect the accounting statistics.
 4483 The &IFHP; filter will write accounting information to the
 4484 accounting file specified by the command line <option>-a</option> option,
 4485 or the last command line argument.
 4486 When both the <literal>:of</literal> filter and normal filters are used
 4487 together,  the accounting information will be nested as shown.
 4488 <informalexample>
 4489 <screen>Normal Mode:
 4490   start                     '-qProcessID' '-pPagecounter' \
 4491      '-tStartTime' '-Pprinter' '-Hhost' '-nuser' '-Raccntinfo'
 4492   end '-bPages' '-Telapsed' '-qProcessID' '-pPagecounter' 
 4493      '-tEndTime' '-Pprinter' '-Hhost' '-nuser' '-Raccntinfo' \
 4494      '-TElapsedTime'
 4495 
 4496 OF Mode:
 4497   filestart                     '-qProcessID' '-pPagecounter' \
 4498      '-tStartTime' '-Pprinter' '-Hhost' '-nuser' '-Raccntinfo'
 4499   fileend '-bPages' '-Telapsed' '-qProcessID' '-pPagecounter' \
 4500      '-tEndTime' '-Pprinter' '-Hhost' '-nuser' '-Raccntinfo'
 4501      
 4502 
 4503 Sample Accounting File Entry:
 4504 
 4505   start '-q10699' '-p234' '-t2000-05-24-09:27:47.784' \
 4506       -Plp -Hh4.private -npapowell
 4507   filestart '-q10700' '-p234' '-t2000-05-24-09:27:47.784' \
 4508       -Plp -Hh4.private -npapowell
 4509   fileend '-b0' '-T1' '-q10700' '-p235' '-t2000-05-24-09:27:47.863' \
 4510       -Plp -Hh4.private -npapowell
 4511   end '-b1' '-T1' '-q10699' '-p235' '-t2000-05-24-09:27:47.863'
 4512       -Plp -Hh4.private -npapowell</screen>
 4513 </informalexample>
 4514 </para>
 4515 
 4516 <para>
 4517 The format of the information written to the accounting file is controlled
 4518 by the 
 4519 <literal>accounting_info=AHPn</literal> &IFHP; configuration value.
 4520 If they are present,
 4521 the specified &IFHP; command line flags are appended to the end of the standard
 4522 accounting information.
 4523 The <literal>accounting=...</literal>
 4524 option specfies a program to run at then end of the job.
 4525 This program has all of the accounting information passed as command line options.
 4526 The program should exit with a 0 exit code; otherwise the results are undefined.
 4527 </para>
 4528 <para>The printcap <symbol>:suspend_of_filter</symbol> controls how the <application/lpd/
 4529 spooler manages the <literal>of</literal> filter.
 4530 When a file is to be printed
 4531 normally, a special two character
 4532 suspend message (<literal>\031\001</literal>)
 4533 is written to the filter STDIN.
 4534 When the &IFHP; filter detects this string in the input
 4535 it is required to suspend itself by sending itself a <literal/SIGSUSP/
 4536 signal.
 4537 The <literal>:suspend_of_filter@</literal> flag causes the <application/lpd/ process to
 4538 close the <literal>:of</literal> filter rather than suspending it,
 4539 and to start a new <literal>:of</literal> filter process when it needs one.
 4540 This option is used when there can be at most one process communicating with the
 4541 printer,
 4542 or when the &IFHP; filter must totally reinitialize the printer at job end.
 4543 </para>
 4544 
 4545 <para>The <literal>pagecount</literal>
 4546 option controls if and how the pagecounter value will be fetched.
 4547 Currently
 4548 <literal>pagecount=ps</literal> (PostScript)
 4549 and
 4550 <literal>pagecount=pjl</literal> (PJL)
 4551 are supported.
 4552 The <literal>pagecount</literal> form
 4553 will use PJL if it is available; otherwise PostScript if it is available.
 4554 The <literal>pagecount@</literal> suppresses pagecount operation.
 4555 The <symbol>pagecount_start</symbol> and <symbol>pagecount_end</symbol> flags control
 4556 if the pagecounter will be obtained at the start and end of the
 4557 print job.</para>
 4558 
 4559 <para>One of the major problems with getting printcounter values is that the
 4560 print job must be totally finished or at least have all of its pages
 4561 run through the paper feed stream when the pagecounter value is reported.
 4562 Unfortunately,
 4563 most manufacturers do not provide accurate ways to coordinate the two
 4564 activities.
 4565 The <literal>waitend</literal> option is used to enable the &IFHP; filter to
 4566 send special command sequences to the printer which will detect
 4567 the true end of job,
 4568 but this may not be possible on many printers.</para>
 4569 
 4570 <para>The <literal>printcounter_poll=N</literal> (default 1) option provides a method to deal with
 4571 these types of printers.
 4572 Commands to get the printcounter value are sent to the printer,
 4573 and repeated at <symbol>printcap_interval</symbol> second intervals
 4574 until the printcounter value has been stable for <literal>N</literal> readings.</para>
 4575 
 4576 <para>The PJL TEOJ (True End Of Job) command has been used with only
 4577 limited success to force End of Job reporting only when the
 4578 job has finished.  This can be sent to the printer during PJL initialization
 4579 by specifying it as one of the PJL initialization strings:
 4580 <informalexample>
 4581 <screen>pjl_init=[ ... teoj ... ]
 4582 pjl_teoj=@PJL TEOJ=ON</screen>
 4583 </informalexample>
 4584 </para>
 4585 
 4586 
 4587 <para>The
 4588 <link linkend="ofoptions"/<symbol/of_options//
 4589 are used to modify the actions of the &IFHP;
 4590 filter when it is running in OF Mode.</para>
 4591 <para>The <symbol>pagecount_start</symbol> and <symbol>pagecount_end</symbol> (both default to TRUE or ON)
 4592 control if pagecounter values are obtained at the start or end
 4593 respectively of the job.</para>
 4594 <para>The pagecount request is sent to the printer every
 4595 <literal>pagecount_interval=nnn</literal>
 4596 second intervals; if nnn is 0, then it is sent only once.
 4597 If no pagecount value is obtained within
 4598 <literal>pagecount_timeout=nnn</literal>
 4599 seconds then the filter exits with an error.</para>
 4600 </sect1>
 4601 
 4602 <sect1 id="pjlinit">
 4603 <title>PJL Initialization
 4604 </title>
 4605 <itemizedlist>
 4606 <listitem><para><literal/pjl_init=[ ... ]/<emphasis/ pjl initialization/</para></listitem>
 4607 <listitem><para><literal/startpage=/<emphasis/ start page to print/</para></listitem>
 4608 <listitem><para><literal/endpage=/<emphasis/ end page to print/</para></listitem>
 4609 <listitem><para><literal/pjl_only=[ ... ]/<emphasis/ pjl commands supported/</para></listitem>
 4610 <listitem><para><literal/pjl_except=[ ... ]/<emphasis/ pjl commands not to be used/</para></listitem>
 4611 <listitem><para><literal/pjl_vars_set=[ ... ]/<emphasis/ pjl variables supported/</para></listitem>
 4612 <listitem><para><literal/pjl_vars_except=[ ... ]/<emphasis/ pjl variables not to be used/</para></listitem>
 4613 <listitem><para><literal/pjl_user_opts=[ ... ]/<emphasis/ pjl options available to user/</para></listitem>
 4614 </itemizedlist>
 4615 
 4616 <para>If a printer supports PJL,
 4617 the many printer operations can be initiated and controlled using
 4618 PJL commands.
 4619 Unfortunately,
 4620 not all printers support the same set of commands.
 4621 In addition,
 4622 not all printers support the same set of operations or options.
 4623 A PJL command has the form:
 4624 <informalexample>
 4625 <screen>@PJL COMMAND OPTION OPTION ...</screen>
 4626 </informalexample>
 4627 
 4628 A PJL variable is set using:
 4629 <informalexample>
 4630 <screen>@PJL SET <emphasis remap=it>var</emphasis> = <emphasis remap=it>value</emphasis> ...</screen>
 4631 </informalexample>
 4632 
 4633 The
 4634 <literal>pjl_only=[ ... ]</literal>,
 4635 <literal>pjl_except=[ ... ]</literal>,
 4636 <literal>pjl_vars_set=[ ... ]</literal>,
 4637 and
 4638 <literal>pjl_vars_except=[ ... ]</literal>
 4639 options are used to control which PJL commands and which PJL variables
 4640 can be set.
 4641 The
 4642 <symbol>pjl_only</symbol>
 4643 variable lists the commands supported by the printer,
 4644 and the
 4645 <symbol>pjl_except</symbol>
 4646 lists commands <emphasis>not</emphasis>
 4647 supported by the printer.
 4648 Before sending a PJL command,
 4649 the
 4650 &IFHP;
 4651 filter checks to make sure that the command name is in
 4652 <symbol>pjl_only</symbol>
 4653 and not in
 4654 <symbol>pjl_except</symbol>.
 4655 If the tests fail, then tne command is not sent.</para>
 4656 
 4657 <para>Similarly,
 4658 when sending a command to set a PJL variable,
 4659 the
 4660 <symbol>pjl_vars_set</symbol>
 4661 and
 4662 <symbol>pjl_vars_except</symbol>
 4663 lists are checked to determine if the variable name is in
 4664 <symbol>pjl_vars_set</symbol>
 4665 and not in
 4666 <symbol>pjl_except</symbol>
 4667 list.
 4668 If the tests fail, then tne command is not sent.</para>
 4669 
 4670 <para>If PJL is enabled,
 4671 then the following actions are taken.
 4672 <orderedlist>
 4673 
 4674 <listitem>
 4675 <para> PJL Universal Exit Language (UEL) <literal>\033%-12345X</literal> is sent to the printer.
 4676 </para>
 4677 
 4678 <para>This is required to ensure that the following PJL commands are
 4679 accepted.</para>
 4680 </listitem>
 4681 
 4682 <listitem>
 4683 <para> PJL JOB command is sent at the start of job.
 4684 The JOB command can be used to select pages or impressions to be printed.
 4685 If the
 4686 <literal>-Zstartpage=nnn</literal>
 4687 or
 4688 <literal>-Zendpage=mmm</literal>
 4689 option is present, then the PJL JOB command has the form:
 4690 <informalexample>
 4691 <screen>@PJL JOB START=nnn END=mmm</screen>
 4692 </informalexample>
 4693 </para>
 4694 </listitem>
 4695 
 4696 <listitem>
 4697 <para> The
 4698 <literal>pjl_init=[ ... ]</literal>
 4699 value option is expanded using the PJL
 4700 (<literal>"pjl_"</literal>) language context as described above.</para>
 4701 </listitem>
 4702 
 4703 <listitem>
 4704 <para> The
 4705 <literal>-Toption=value</literal>s
 4706 and
 4707 <literal>-Zoption=value</literal>s
 4708 are scanned for matching option names in the
 4709 <literal>pjl_user_opts=[ ... ]</literal>
 4710 list.
 4711 If they are found,
 4712 then the options are recursively evaluated in the PJL language context.
 4713 The expansion algorithm will cause the option value to be used to set PJL
 4714 variables.
 4715 For example:
 4716 <informalexample>
 4717 <screen>Configuration:
 4718   pjl_vars_set=[ OUTBIN AUTOSELECT JAM=YES ]
 4719 
 4720 Command
 4721   ifhp -Zoutbin=upper,autoselect,jam
 4722 
 4723 PJL command generated:
 4724   @PJL SET OUTBIN=UPPER
 4725   @PJL SET AUTOSELECT=ON
 4726   @PJL SET JAM=YES</screen>
 4727 </informalexample>
 4728 </para>
 4729 </listitem>
 4730 
 4731 </orderedlist>
 4732 </para>
 4733 
 4734 </sect1>
 4735 
 4736 <sect1
 4737 id="fileconversion">
 4738 <title>File Conversion Support
 4739 </title>
 4740 <itemizedlist>
 4741 <listitem><para><literal/forceconversion/ FLAG <emphasis/force use of file utility /</para></listitem>
 4742 <listitem><para><literal/default_language=/<emphasis/ default job language /</para></listitem>
 4743 </itemizedlist>
 4744 
 4745 
 4746 
 4747 
 4748 <para>The <command>lpr -l</command> or <command>lp -b</command> flags indicate that the spooled files
 4749 are not to be processed by an output filter.
 4750 The &LPRng; spooler recognizes this option and passes the <option>-c</option>
 4751 command line option to suppress any language specific processing for files.</para>
 4752 
 4753 <para>However,
 4754 many PostScript printers cannot handle text files,
 4755 and produce many hundreds of pages of garbage
 4756 output if they are sent to the printer without being translated
 4757 into PostScript,
 4758 and some printers require language specific setup in order to print
 4759 PCL, PostScript or text files correctly.</para>
 4760 
 4761 <para>The &IFHP; filter has builtin tests for PJL,
 4762 PCL, and PostScript files.
 4763 These tests are almost identical to those used
 4764 by many printers which do
 4765 <emphasis>autodetection</emphasis>.
 4766 If you need to recognize a wider range of file types,
 4767 you can configure &IFHP; to use the
 4768 UNIX <literal>file</literal>(1) program.</para>
 4769 
 4770 <para>Finally,
 4771 some printers have a very specialized job format that requires
 4772 conversion to by a
 4773 <literal>rasterizer</literal>
 4774 program.
 4775 This is handled as detailed in the following sections.</para>
 4776 
 4777 
 4778 <sect2
 4779 id="file-util-path">
 4780 <title>File Type Detection
 4781 </title>
 4782 
 4783 <itemizedlist>
 4784 <listitem><para><literal/file_util_path=/<emphasis/ file utilty path /</para></listitem>
 4785 <listitem><para><literal/forceprocessing/ FLAG <emphasis/force file processing/</para></listitem>
 4786 </itemizedlist>
 4787 <para>The &IFHP; filter has a set of built-in tests
 4788 to determine if the input job file is
 4789 PJL, PostScript, and PCL, or (default) text,
 4790 and flags the file
 4791 with language types
 4792 <literal>pjl</literal>,
 4793 <literal>ps</literal>,
 4794 <literal>pcl</literal>,
 4795 and
 4796 <literal>text</literal> respectively.</para>
 4797 
 4798 <para>You can also use the UNIX
 4799 <link linkend="fileutil"/file utility/
 4800 utility to determine type as well.
 4801 The <literal>file</literal> utility is invoked with it <acronym>STDIN</acronym> attached to the file
 4802 and &IFHP; uses the information it writes to <acronym>STDOUT</acronym>
 4803 as the raw file type.
 4804 The &IFHP; program will
 4805 convert the output to lowercase,
 4806 remove multiple whitespace characters,
 4807 and replace the remaining whitespace characters with underscores <symbol>_</symbol>.</para>
 4808 
 4809 <para>By default,
 4810 &IFHP;
 4811 will not try to detect <emphasis>binary</emphasis> files,
 4812 i.e. - files printed with the binary or literal flag (<literal>-c</literal>
 4813 command line flag).
 4814 You can use the <literal>forceprocessing</literal> flag to cause
 4815 all files of all types to be processed.
 4816 &IFHP;
 4817 will first try to use its builtin tests and then will
 4818 use the <literal>file</literal> utility.
 4819 You can set the <symbol>forceconversion</symbol> flag to force &IFHP;
 4820 to only use the <literal>file</literal> utility.
 4821 The following shows the information in the <filename>ifhp.conf</filename>
 4822 file used to configure the file type detection.
 4823 <informalexample>
 4824 <screen>##forceprocessing - check all files for type - default 'no'
 4825 forceprocessing@
 4826 ## default
 4827 default_language=text
 4828 ## force only use of file program
 4829 ## default is to let ifhp try first, then try file
 4830 forceconversion@
 4831 ##  file utility path
 4832 file_util_path=/usr/bin/file -</screen>
 4833 </informalexample>
 4834 </para>
 4835 
 4836 <para>The output of the file utility is converted to lower case and
 4837 used as the language type for further processing.</para>
 4838 
 4839 </sect2>
 4840 
 4841 <sect2
 4842 id="conversion">
 4843 <title>Conversion
 4844 </title>
 4845 
 4846 <itemizedlist>
 4847 <listitem><para><literal/file_output_match=/ TABLE <emphasis/file utility output match list /</para></listitem>
 4848 <listitem><para><literal/language=/<emphasis/ language type override /</para></listitem>
 4849 </itemizedlist>
 4850 
 4851 <para>Once the language type has been determined,
 4852 the &IFHP; filter then decides if a conversion program
 4853 needs to be run and will convert the input file to a required file type.
 4854 This activity is  controlled by the <symbol>file_output_match</symbol>
 4855 table.
 4856 <informalexample>
 4857 <screen>file_output_match = [
 4858   *postscript*  ps  \%s{ps_converter}
 4859   *pcl*         pcl  \%s{pcl_converter}
 4860   *pjl*         pjl  \%s{pjl_converter}
 4861   *printer*job*language* pjl
 4862   *text*  pcl  \%s{pcl_converter}
 4863   *gzip_compressed*  filter  \%s{gzip_decompresser}
 4864   ]</screen>
 4865 </informalexample>
 4866 
 4867 Each line of the
 4868 <symbol>file_output_match</symbol>
 4869 table contains
 4870 a (URL encoded) <emphasis remap=it>glob</emphasis> pattern,
 4871 the language type (<literal>ps</literal>, <emphasis remap=tt>pcl</emphasis>, etc.) produced by the conversion program,
 4872 and the (optional) conversion program.</para>
 4873 
 4874 <para>The format:
 4875 <informalexample>
 4876 <screen>file_output_match = &lt;/pathname</screen>
 4877 </informalexample>
 4878 </para>
 4879 
 4880 <para>will cause &IFHP; to open and read the specified file
 4881 for the <symbol>file_output_match</symbol> table.
 4882 The file's contents must have the same format as the
 4883 <symbol>file_output_match</symbol> table but without the <literal>[</literal> or <literal>]</literal> delimiters.</para>
 4884 
 4885 <para>The <symbol>file_match_table</symbol> is scanned from first to last entry
 4886 for a <literal>glob</literal> pattern that
 4887 matches the file type determined by the &IFHP; program or the output of the
 4888 <symbol>file_util_path</symbol> program.
 4889 If no match is found,
 4890 then the language is set to the
 4891 <symbol>default_language</symbol> value.</para>
 4892 
 4893 <para>The output language of the conversion program is set to the second entry.
 4894 The conversion program will be run with its STDIN set to the input file
 4895 and its STDOUT used as the converted output.
 4896 If there is no conversion program then the original file is used
 4897 and only the language type is modified.</para>
 4898 
 4899 <para>The <literal>filter</literal> language type causes the specified conversion program to
 4900 be run and then the output of the program to be reprocessed.
 4901 As shown above,
 4902 this allows file decompression routines to be used to expand the
 4903 files.</para>
 4904 
 4905 <para>The following are some short samples of what can be done with the
 4906 conversion facility.
 4907 <informalexample>
 4908 <screen>
 4909 # set up GhostScript
 4910 gs_device=epsonc
 4911 gs_options=-r1440
 4912 gs=/usr/bin/gs
 4913 gs_converter= [ \%s{gs} -dBATCH -q -sOutputFile=- \
 4914   -sDEVICE=\%s{gs_device} \%s{gs_options} - ]
 4915 # use GhostScript for conversion
 4916 ps_converter = [ \%{gs_converter} ]
 4917 text_converter= [/usr/bin/a2ps -q -B -1 -M Letter \
 4918   --borders=no -o- \%s{ps_converter} ]
 4919 gzip_decompresser = [ /usr/bin/gzip -c -d ]
 4920 
 4921 [ ghostscript gs ]
 4922 file_output_match = [
 4923   *postscript*  ps  \%s{ps_converter}
 4924   *text*  pcl  \%s{pcl_converter}
 4925   *gzip_compressed*  filter  \%s{gzip_decompresser}
 4926   ]
 4927 
 4928 Printcap entry:
 4929 
 4930 pr:
 4931   :ifhp=model=ghostscript,gs_device=laserjet,gs_options=-r300x300
 4932 </screen>
 4933 </informalexample>
 4934 </para>
 4935 
 4936 <para>In this example,
 4937 we have shown a very interesting device - the GhostScript device.
 4938 We use the <literal>gs</literal> (GhostScript) program to do the conversion,
 4939 and specify the <symbol>gs_device</symbol> and <symbol>gs_options</symbol> values in the
 4940 printcap entry.
 4941 There are a few details that should be observed when using this facility.
 4942 <orderedlist>
 4943 
 4944 <listitem>
 4945 <para>The output from the <literal>file</literal> program has spaces converted to underscores.
 4946 If you need to match spaces then use the underscore in the pattern.
 4947 For example, <literal>ascii text</literal> would be matched by <emphasis remap=tt>*ascii_text*</emphasis>.</para>
 4948 </listitem>
 4949 
 4950 <listitem>
 4951 <para>If the conversion program contains a shell meta character such as
 4952 <literal>|</literal>,
 4953 <literal>;</literal>,
 4954 <literal>&gt;</literal>,
 4955 <literal>&lt;</literal>,
 4956 etc,
 4957 then it will be executed using
 4958 <literal>/bin/sh -c 'command'</literal>.
 4959 This allows a pipe of conversion commands to be constructed.
 4960 This is discussed in detail below.</para>
 4961 </listitem>
 4962 
 4963 <listitem>
 4964 <para>The most commonly used conversion programs are
 4965 <link linkend="ghostscript"/GhostScript/,
 4966 used to convert PostScript to a format compatible with a non-PostScript
 4967 printer,
 4968 and the
 4969 <link linkend="a2ps">a2ps</link>,
 4970 <link linkend="enscript">enscript</link>, and
 4971 <link linkend="textps">textps</link>
 4972 Text to PostScript conversion programs which
 4973 convert text into PostScript for a non-text supporting printer.
 4974 The use of a <literal>wrapper</literal> program with these utilities is discussed below.</para>
 4975 </listitem>
 4976 
 4977 <listitem>
 4978 <para>All of the command line options can be substituted on the command
 4979 line using <literal>\%{X}</literal>, where <emphasis remap=tt>X</emphasis> is the single letter command
 4980 line option flag.</para>
 4981 </listitem>
 4982 
 4983 <listitem>
 4984 <para>The <literal>\%s{ARGV}</literal> value is replaced by the command line arguments.</para>
 4985 </listitem>
 4986 
 4987 <listitem>
 4988 <para>The conversion program must exit with a 0 error code or an error is assumed
 4989 to have occurred.</para>
 4990 </listitem>
 4991 
 4992 </orderedlist>
 4993 </para>
 4994 
 4995 <para>The <literal>enscript</literal> program
 4996 will exit with a non-zero error codes even for successful conversions
 4997 and we need to use a
 4998 <literal>wrapper</literal> script that will run it and then return the correct
 4999 error code as shown below.
 5000 <informalexample>
 5001 <screen>#!/bin/sh
 5002 # /usr.../wrapper path [options]
 5003 # wrapper script for a2ps, enscript and others
 5004 #   path is the path to the program and options are the
 5005 #   options to pass.  The program is run and then the exit
 5006 #   code is corrected
 5007 "$@"
 5008 status=$?
 5009 case "$status" in
 5010     1 ) exit $status ;;
 5011 esac
 5012 exit 0</screen>
 5013 </informalexample>
 5014 </para>
 5015 
 5016 </sect2>
 5017 
 5018 <sect2
 5019 id="crlf">
 5020 <title>LF to CR/LF Conversion
 5021 </title>
 5022 <itemizedlist>
 5023 <listitem><para><literal/crlf/ FLAG <emphasis/LF to CR-LF conversion/</para></listitem>
 5024 </itemizedlist>
 5025 
 5026 <para>When processing <literal>text</literal> or <emphasis remap=tt>pcl</emphasis> files,
 5027 the <literal>crlf</literal> option will enable translation of
 5028 LF (<literal>\n</literal>) to CR/LF (<emphasis remap=tt>\r\n</emphasis>) sequences.
 5029 If you are using &IFHP; to simply do LF to CR/LF translation,
 5030 then you can use:
 5031 <informalexample>
 5032 <screen>ifhp -Tcrlf</screen>
 5033 </informalexample>
 5034 </para>
 5035 
 5036 </sect2>
 5037 
 5038 <sect2>
 5039 <title>Text Treated Like PCL</title>
 5040 
 5041 <para>Text is simply PCL with no special formatting codes.
 5042 However, you will still need to send the PCL initialization
 5043 strings to the printer.
 5044 You can do this by using the following entry in the
 5045 <symbol>file_output_match</symbol> table:
 5046 <informalexample>
 5047 <screen>file_output_match = [
 5048  *text*  pcl
 5049  ]</screen>
 5050 </informalexample>
 5051 </para>
 5052 
 5053 </sect2>
 5054 
 5055 <sect2>
 5056 <title>Default to Passthrough</title>
 5057 
 5058 <para>Your printer may be capable of handling a wide variety of job
 5059 formats.  If you want to simply pass through files of
 5060 unknown type or language then use the following entry in the
 5061 <symbol>file_output_match</symbol> table:
 5062 <informalexample>
 5063 <screen>file_output_match = [
 5064  *  raw
 5065  ]</screen>
 5066 </informalexample>
 5067 </para>
 5068 
 5069 </sect2>
 5070 </sect1>
 5071 
 5072 <sect1
 5073 id="ghostscriptconfig">
 5074 <title>GhostScript Printer
 5075 </title>
 5076 
 5077 <para>Generating a raster image from a PostScript or PCL file in
 5078 a timely manner requires a high speed processor and substantial amounts
 5079 of memory.
 5080 Many of the low cost printers require the user's system to do the raster
 5081 conversion,
 5082 and a raster file is then transferred to the printer.
 5083 These files are usually in a proprietary format.
 5084 The
 5085 <link linkend="ghostscript">GhostScript</link>
 5086 program can process PostScript files and produce raster output for a
 5087 wide range of devices.
 5088 See the GhostScript documentation for details.
 5089 Some printers have PCL support but do not support PostScript.
 5090 The
 5091 <literal>gs</literal> and <literal>pcl_gs</literal>
 5092 printer configuration support these printers.
 5093 <informalexample>
 5094 <screen>
 5095 # PRINTER ghostscript - Printer with GhostScript conversion to raster files
 5096 gs_converter= [ /usr/bin/gs -dSAFER -dBATCH -q 
 5097    -sOutputFile=- -sDEVICE=\%s{gs_device} \%s{gs_options} -
 5098  ]
 5099 text_converter= [ /usr/bin/a2ps -q -B -1 -M Letter --borders=no -o-
 5100  ]
 5101 
 5102 [ ghostscript gs ]
 5103 pcl@
 5104 pjl@
 5105 ps
 5106 text@
 5107 file_output_match = [
 5108 # PostScript to Raster
 5109   *postscript*  raw  \%s{gs_converter}
 5110 # text to PostScript to Raster conversion
 5111   *text*  filter  \%s{text_converter}
 5112   ]
 5113 
 5114 # PRINTER pcl_gs - PCL Printer with GhostScript conversion to raster files
 5115 [ pcl_gs ]
 5116 pcl
 5117 pjl@
 5118 ps
 5119 text@
 5120 file_output_match = [
 5121 # PostScript to Raster
 5122   *postscript*  raw  \%s{gs_converter}
 5123   *pcl*  pcl
 5124 # text to PostScript to Raster conversion
 5125   *text*  filter  \%s{text_converter}
 5126   ]</screen>
 5127 </informalexample>
 5128 </para>
 5129 
 5130 <para>The <literal>\%s{gs_device}</literal> and <literal>\%s{gs_options}</literal> parameters can now be
 5131 specified in the printcap.
 5132 The following shows a typical printcap entry for use with this entry.
 5133 <informalexample>
 5134 <screen>#  force clients (lpr, lpq, to use server)
 5135 lp:lp=lp@serverhost 
 5136 # server information  
 5137 lp:server  
 5138   :sd=<emphasis remap=it>spooldir</emphasis> 
 5139   :lp=/dev/lpt0     
 5140   :...  
 5141   :ifhp=model=gs,gs_device=epson,gs_options=-r240x72 
 5142   #path to ifhp filter  
 5143   :filter=/.../ifhp  </screen>
 5144 </informalexample>
 5145 </para>
 5146 
 5147 <para>The &IFHP; configuration entry uses GhostScript to do the
 5148 rasterization of the PostScript file,
 5149 and the <literal>a2ps</literal> program to do a text to PostScript conversion.</para>
 5150 
 5151 </sect1>
 5152 
 5153 <sect1
 5154 id="languageinit">
 5155 <title>Language Specific Initialization
 5156 </title>
 5157 
 5158 <itemizedlist>
 5159 <listitem><para><literal/ps_init=/ <emphasis/PostScript initialization steps /</para></listitem>
 5160 <listitem><para><literal/pcl_init=/ <emphasis/PCL initialization steps /</para></listitem>
 5161 </itemizedlist>
 5162 
 5163 <para>After determining the output file language type,
 5164 language specific operations are then carried out by
 5165 expanding the
 5166 <symbol>language</symbol><literal>_init=[ ... ]</literal>
 5167 options in the language context,
 5168 and then the options in the
 5169 <literal>-Toption=value</literal>
 5170 and
 5171 <literal>-Zoption=value</literal>
 5172 command line options.
 5173 The
 5174 <option>-T</option>
 5175 options are expanded before the
 5176 <option>-Z</option>,
 5177 allowing the
 5178 <option>-Z</option> actions to override any set by the
 5179 <option>-T</option> actions.</para>
 5180 
 5181 <para>As mentioned elsewhere,
 5182 the reason for the language specific processing is to allow
 5183 different actions for the same command line option,
 5184 depending on the file type that is being processed.
 5185 For example,  when processing a PCL file it might be necessary to send
 5186 PCL command strings and when processing a PostScript file,
 5187 you would need to send PostScript commands.</para>
 5188 
 5189 </sect1>
 5190 
 5191 <sect1
 5192 id="filetransfer">
 5193 <title>File Transfer and Error Status Monitoring
 5194 </title>
 5195 <itemizedlist>
 5196 <listitem><para><literal/logall/ FLAG <emphasis/log all printer status/</para></listitem>
 5197 <listitem><para><literal/pjl_error_codes/ TABLE <emphasis/PJL error code translations/</para></listitem>
 5198 <listitem><para><literal/pjl_quiet_codes/ TABLE <emphasis/ignore these PJL error codes/</para></listitem>
 5199 <listitem><para><literal/pjl_alert_codes/ TABLE <emphasis/alert operation on these PJL error codes/</para></listitem>
 5200 <listitem><para><literal/pjl_alert_handler/ TABLE <emphasis/program to alert operator /</para></listitem>
 5201 </itemizedlist>
 5202 
 5203 <para>If the printer can return status, i.e., the
 5204 <literal>status</literal> option is on,
 5205 the filter will read status information from the printer.</para>
 5206 
 5207 <para>If the
 5208 <literal>logall</literal>
 5209 flag is SET,
 5210 then all error messages will be written to the status or log file.</para>
 5211 
 5212 <para>If the printer is returning PJL status information,
 5213 then this has a specific format:
 5214 <informalexample>
 5215 <screen>@PJL UINFO DEVICE
 5216 CODE=nnnn
 5217 DISPLAY="value"
 5218 ...
 5219 
 5220 @PJL UINFO JOB
 5221 START
 5222 ...
 5223 
 5224 @PJL UINFO JOB
 5225 END
 5226 ...
 5227 </screen>
 5228 </informalexample>
 5229 </para>
 5230 
 5231 <para>The
 5232 &IFHP; program will extract the
 5233 <acronym>CODE</acronym>
 5234 and job start and end flags,
 5235 and log these as appropriate.</para>
 5236 
 5237 <para>Unfortunately,
 5238 some PJL based printers are extremely verbose in their generation of status
 5239 messages.
 5240 In order to reduce the amount of logging of redundant information,
 5241 &IFHP;
 5242 will only record when a device status has
 5243 <emphasis remap=bf>changed</emphasis>,
 5244 rather than when it has been reported.</para>
 5245 
 5246 <para>The
 5247 pjl_quiet_codes=[ code code code ]
 5248 value is used to suppress reporting of selected error codes.
 5249 If the error code is in the pjl_quiet_codes list,  then the error status
 5250 will not be reported to the user unless the
 5251 <literal>logall</literal>
 5252 option is set.
 5253 The list of values is used as <emphasis remap=it>glob</emphasis> patterns.
 5254 For example:
 5255 <informalexample>
 5256 <screen>  pjl_quiet_codes=[ 10000 10001 10003 10023 10024 35078 41* ]</screen>
 5257 </informalexample>
 5258 </para>
 5259 
 5260 <para>Also, there may be error codes which do not have a builtin error
 5261 message available.  New messages can be added using the
 5262 <symbol>pjl_error_codes</symbol>
 5263 option.
 5264 Its value is a list of lines, each line consisting of an error code
 5265 followed by the corresponding error message:
 5266 <informalexample>
 5267 <screen>pjl_error_codes=[
 5268    code=msg
 5269    code=msg
 5270    ...
 5271 ]
 5272 
 5273 Example:
 5274   pjl_error_codes=[
 5275      10000=powersave mode
 5276      10001=Ready Online
 5277      10002=Ready Offline
 5278      10003=Warming Up
 5279      10004=Self Test
 5280      10005=Reset
 5281   ]</screen>
 5282 </informalexample>
 5283 </para>
 5284 
 5285 <para>Finally,
 5286 there are codes or classes of codes that require operator intervention.
 5287 These are specified using the <symbol>pjl_alert_codes</symbol>,
 5288 and the <symbol>pjl_alert_handler</symbol> program will be invoked to send them
 5289 to the appropriate destination.
 5290 The formated error message will be available on STDIN for the handler.
 5291 For example:
 5292 <informalexample>
 5293 <screen>pjl_alert_codes=[ 41* 42* 23* ]
 5294 pjl_alert_handler=/usr/local/libexec/filters/alert_handler</screen>
 5295 </informalexample>
 5296 </para>
 5297 
 5298 </sect1>
 5299 
 5300 <sect1
 5301 id="waitend">
 5302 <title>End of Job
 5303 </title>
 5304 
 5305 <itemizedlist>
 5306 <listitem><para><literal/waitend/ OPTION <emphasis/wait for job completion status/</para></listitem>
 5307 <listitem><para><literal/waitend_interval=/<emphasis/ query for end at this interval/</para></listitem>
 5308 <listitem><para><literal/waitend_ctrl_t_interval=/<emphasis/ send CTRL-T at this interval/</para></listitem>
 5309 </itemizedlist>
 5310 
 5311 <para>The <literal>waitend</literal> option controls the job termination sequence.
 5312 By default,
 5313 this will do the same work as the
 5314 <literal>sync</literal> operation,
 5315 and the option takes the same set of values.</para>
 5316 
 5317 <para>If <literal>waitend</literal>
 5318 is suppressed using <literal>waitend@</literal>,
 5319 then as soon as a job has been transferred,
 5320 the next step,
 5321 <literal>pagecount</literal>,
 5322 will be attempted.
 5323 If the print job has not finished at this point,
 5324 then erroneous page counts will be reported.</para>
 5325 
 5326 <para>When the <literal>appsocket</literal> protocol is used,
 5327 suppressing <literal>waitend</literal> will cause no error messages from the printer to
 5328 be reported.</para>
 5329 
 5330 <para>Some printers do not have a True End Of Job reporting capability
 5331 using PJL.
 5332 This means that the job will be reported as done,
 5333 but paper is still moving through the print engine.
 5334 If you try to get pagecounts at this point you will get the wrong value.
 5335 An alternative method is to set
 5336 <literal>waitend=ps</literal>
 5337 and
 5338 The <literal>end_ctrl_t=word:word:...</literal>
 5339 This will cause a CONTROL-T to be sent to the printer,
 5340 a PostScript convention that will cause the PostScript interpreter to return
 5341 the actual printing status.
 5342 In most printers this will be
 5343 <literal>printing</literal> or something other
 5344 than
 5345 <literal>idle</literal> or <emphasis remap=tt>busy</emphasis>
 5346 as long as paper is moving in the print engine.
 5347 When status is returned,
 5348 the words in the
 5349 <literal>end_ctrl_t=word:word:...</literal>
 5350 list value are examined for a match.
 5351 If the status word is present then the end of job condition is assumed.</para>
 5352 
 5353 <para>The <symbol>waitend_interval</symbol>
 5354 value controls how often the waitend operation is repeated.
 5355 This is usually set to a fairly large value,
 5356 as it is normally used only to recover from printer failures
 5357 such as users turning the printer on and off.</para>
 5358 
 5359 <para>The <symbol>waitend_ctrl_t_interval</symbol>
 5360 controls how often the printer is queried for status using CTRL-T
 5361 and is usually set to a short (2 or 3 second) value.</para>
 5362 
 5363 </sect1>
 5364 
 5365 <sect1
 5366 id="appsocket">
 5367 <title>Tektronix Phaser, QMS and AppSocket Support
 5368 </title>
 5369 
 5370 <itemizedlist>
 5371 <listitem><para><literal/appsocket/ FLAG <emphasis/connect to printer and use AppSocket Protocol/</para></listitem>
 5372 </itemizedlist>
 5373 <para>The <literal>appsocket</literal> flag is used to specify that data transfer will
 5374 be done using the
 5375 <link linkend="appsocketpc">AppSocket</link>
 5376 protocol.
 5377 The &IFHP; filter will open a connection to the ip address and
 5378 port specified by the <literal>dev=host%port</literal> option
 5379 and carry out the various operations that it needs to do.</para>
 5380 
 5381 <para>
 5382 Normally after sending information to the printer a <function/close()/
 5383 operation is done on the network connection.
 5384 This will usually be acceptible as the printer will print the job
 5385 that was sent to it.
 5386 However, some printers require that the network connection be left
 5387 open to report status.
 5388 </para>
 5389 
 5390 <para>If page count information is needed,
 5391 the &IFHP; filter will then reopen the connection and get the page count information.</para>
 5392 
 5393 </sect1>
 5394 </chapter>
 5395 
 5396 <chapter>
 5397 <title>Banners and OF Mode Operation</title>
 5398 
 5399 <para>One of the more difficult administrative issues is whether to print
 5400 banners (job separators) or to save the large amount of wasted
 5401 paper, time and effort.
 5402 The &LPRng; and
 5403 &IFHP;
 5404 combination provide a rather esoteric set of methods to generate banners,
 5405 at least one of which should be suitable for your application.</para>
 5406 
 5407 <para>You should be aware that some printers have the obnoxious habit of
 5408 generating their own banner pages when jobs are transferred via
 5409 the RFC1179 protocol.
 5410 You should consult the manufacturers documentation and take the
 5411 necessary steps to turn printer banner page generation off.
 5412 It may turn out that this is impossible to do,
 5413 and in that case the only option is to use the Socket or Appsocket
 5414 connection methods.</para>
 5415 
 5416 <para>In the original BSD print spooler,
 5417 the <literal>:of</literal> print filter was responsible for
 5418 banner generation.
 5419 The print server would send it a
 5420 <emphasis remap=it>magic string</emphasis> that the filter would recognize
 5421 as a <emphasis remap=it>print a banner</emphasis> request,
 5422 and it would then generate a banner.
 5423 After this,
 5424 another special <literal>magic cookie</literal> string,
 5425 the character sequence <literal>0x19,0x01</literal>,
 5426 was sent to cause the <literal>:of</literal> filter to suspend itself.
 5427 This allowed the print spooler to hold the connection to the printer
 5428 open while it started another filter to transfer a file.
 5429 Finally,
 5430 after all the jobs were sent, the <literal>:of</literal> filter was
 5431 sent a <acronym>SIGCONT</acronym> signal to wake up and perform whatever
 5432 closing operations were necessary.</para>
 5433 
 5434 <para>This mixing of functionality causes horrible problems when
 5435 special setup strings must be sent to printers in order to
 5436 configure them for various operation.
 5437 In order to avoid these problems,
 5438 the banner printing and filter functions have been separated in
 5439 the &IFHP; filter.
 5440 If a banner is needed,
 5441 then &LPRng; will use a special banner generating program
 5442 to generate the banner.
 5443 The output of this program is then sent to the
 5444 <literal>:of</literal> filter, or directly to the printer if there is no
 5445 <literal>:of</literal> filter.</para>
 5446 
 5447 
 5448 <sect1>
 5449 <title>No Banner</title>
 5450 
 5451 <para>Here is a typical printcap entry when banner printing
 5452 is not wanted:
 5453 <informalexample>
 5454 <screen>lp:
 5455   :sh
 5456   :filter=/.../ifhp</screen>
 5457 </informalexample>
 5458 </para>
 5459 
 5460 <para>The <literal>:sh</literal> (suppress headers or banners) explicitly disables
 5461 banner printing,
 5462 and the <application/lpd/ server will not even attempt to print a banner.</para>
 5463 
 5464 </sect1>
 5465 
 5466 <sect1>
 5467 <title>Banner Printing and No OF Filter</title>
 5468 
 5469 <para>This printcap entry specifies a banner generator program and
 5470 and banner generation.
 5471 There is no <literal>:of</literal> filter specified, so the banner is sent
 5472 directly to the printer.
 5473 In such a case the banner printing program should make sure that
 5474 it generates output with the appropriate set of initialization
 5475 strings.
 5476 The <literal>pclbanner</literal>,
 5477 <literal>psbanner</literal>,
 5478 and
 5479 <literal>lpbanner</literal>
 5480 programs produce PCL,
 5481 PostScript,
 5482 and text banners suitable for a wide range of printers.
 5483 The code for these banner generators is part of the &LPRng; distribution.
 5484 <informalexample>
 5485 <screen>lp:
 5486   :bp=/.../pclbanner
 5487   :of=/.../ifhp
 5488   :filter=/.../ifhp
 5489    # or
 5490   :bp=/.../psbanner
 5491   :of=/.../ifhp
 5492   :filter=/.../ifhp
 5493    # or
 5494   :bp=/.../lpbanner
 5495   :of=/.../ifhp
 5496   :filter=/.../ifhp</screen>
 5497 </informalexample>
 5498 </para>
 5499 
 5500 </sect1>
 5501 
 5502 <sect1>
 5503 <title>Banner Printing With OF Filter</title>
 5504 
 5505 <para>Finally,
 5506 we may want banner printing together with the <literal>:of</literal> filter.
 5507 This is usually the case when we need to perform special printer
 5508 setups or require the &IFHP; filter to do accounting.
 5509 In this case we need to make sure that the banner page is counted
 5510 as part of the job:
 5511 <informalexample>
 5512 <screen>lp:
 5513   :bp=/.../pclbanner <emphasis/or/ :bp=/.../psbanner <emphasis/or/ :bp=/.../lpbanner
 5514   :of=/.../ifhp
 5515   :filter=/.../ifhp</screen>
 5516 </informalexample>
 5517 </para>
 5518 
 5519 <para>When invoked as an <literal>:of</literal> filter, the <application/lpd/
 5520 server passes a <option>-Fo</option> option on the command line,
 5521 so that the &IFHP; filter knows what mode it is operating in.</para>
 5522 
 5523 </sect1>
 5524 
 5525 <sect1>
 5526 <title>&LPRng; Options Controlling Banner Printing</title>
 5527 
 5528 <para>
 5529 The <command>lpr -h</command> (no header or banner) option
 5530 suppresses putting <emphasis/banner name/
 5531 (<literal/L/ line) into the control file.
 5532 The &LPRng; <symbol>:ab</symbol>
 5533 (always banner) overrides this,
 5534 and will print a banner using the user name information.
 5535 The <literal>:sh</literal> (suppress header) option will override everything
 5536 and prevent banners from being generated.
 5537 </para>
 5538 <para>
 5539 Banners are generated by the
 5540 <literal>:bp=/...</literal> (banner program)
 5541 program;
 5542 different banners at start and end can be generated by using the
 5543 <literal>:bs=/...</literal> (banner start)
 5544 and
 5545 <literal>:be=/...</literal> (banner end)
 5546 options,
 5547 which override the <literal>:bp=</literal> option.
 5548 </para>
 5549 
 5550 </sect1>
 5551 
 5552 <sect1 id="ofoptions">
 5553 <title>of_options option</title>
 5554 
 5555 <para>This option,
 5556 usually used on the command line or in the
 5557 <literal>printcap</literal> file as part of the
 5558 <literal>:ifhp</literal> information,
 5559 specifies a set of options to use when the filter is running in
 5560 OF mode.
 5561 For example:
 5562 <informalexample>
 5563 <screen>lp:
 5564   :ifhp=sync@,pagecount@,waitend@,of_options=sync pagecount waitend
 5565   :filter=/usr/local/libexec/filtes/ifhp
 5566   :of=/usr/local/libexec/filtes/ifhp
 5567 
 5568 same as:
 5569 
 5570 lp:
 5571   :filter=/usr/local/libexec/filtes/ifhp -Tsync@,pagecount@,waitend@
 5572   :of=/usr/local/libexec/filtes/ifhp -Tsync,pagecount,waitend</screen>
 5573 </informalexample>
 5574 </para>
 5575 
 5576 <para>In this printcap entry,
 5577 the &IFHP; filter is invoked normally with the
 5578 <literal>sync@</literal>,
 5579 <literal>pagecount@</literal>
 5580 and
 5581 <literal>waitend@</literal> options.
 5582 This causes it to send jobs as fast as possible to the output device
 5583 and only monitor the device for error status.
 5584 The <literal>of=</literal> entry causes the <application/lpd/ print spooler to start &IFHP;
 5585 in OF mode,
 5586 and the <symbol>of_options</symbol> are used to override the other ones.</para>
 5587 
 5588 </sect1>
 5589 </chapter>
 5590 
 5591 <chapter>
 5592 <title>Font Download Support</title>
 5593 
 5594 <para>For historical reasons,
 5595 there is support for downloading a font or other file to the
 5596 printer.
 5597 A large amount of the necessary operations are now in the
 5598 <filename>ifhp.conf</filename>
 5599 file.</para>
 5600 
 5601 <para>The
 5602 <symbol>font_download</symbol>
 5603 built-in option supports downloading as described below.</para>
 5604 
 5605 
 5606 <sect1>
 5607 <title>PCL Font Downloading</title>
 5608 
 5609 <para>The following shows the a typical
 5610 <filename>ifhp.conf</filename>
 5611 file which has PCL font downloading enabled.
 5612 <informalexample>
 5613 <screen>#
 5614 # Fonts and Font Downloading
 5615 #  fontid is used to set the current font
 5616 pcl_init=[ ... font ... ]
 5617 
 5618 # combination command
 5619 pcl_font=[ delete_fonts font_id font_download font_primary ]
 5620 
 5621 # font control
 5622 #
 5623 font_op=0
 5624 pcl_font_op=\033*c\%{font_op}F
 5625 pcl_delete_fonts=\033*c0F
 5626 
 5627 font_id=1
 5628 pcl_font_id=\033*c\%{font_id}D
 5629 
 5630 # set primary font
 5631 font_primary=1
 5632 pcl_font_primary=\033(\%{font_primary}X
 5633 
 5634 # font directory
 5635 pcl_fontdir=/usr/local/lib/fonts
 5636 
 5637 #default font file
 5638 font=c1201b.10
 5639 </screen>
 5640 </informalexample>
 5641 </para>
 5642 
 5643 <para>To allow users to download a font and have it set up for PCL use,
 5644 the
 5645 <symbol>pcl_init</symbol>
 5646 option should include the
 5647 <literal>font</literal>
 5648 option in an appropriate position in the initialization sequence.
 5649 As shown above,
 5650 this will get expanded into the
 5651 <symbol>pcl_delete_fonts</symbol>,
 5652 <symbol>pcl_font_id</symbol>,
 5653 <symbol>pcl_font_download</symbol> (which is has built-in support),
 5654 and the
 5655 <symbol>pcl_font_primary</symbol>
 5656 options,
 5657 which are expanded in order.</para>
 5658 
 5659 <para>The
 5660 <symbol>pcl_font_download</symbol> is supported by the builtin operation which will
 5661 find the
 5662 <symbol>pcl_fontdir</symbol>
 5663 directory value
 5664 and a value for the
 5665 <literal>font</literal>
 5666 variable,
 5667 using values from the
 5668 <option>-Z</option>
 5669 and
 5670 <option>-T</option>
 5671 and configuration information in that order.
 5672 If no
 5673 <literal>font</literal>
 5674 value is found,
 5675 no font will be downloaded.
 5676 For example:
 5677 <informalexample>
 5678 <screen>lpr -Tfont=font1,font2</screen>
 5679 </informalexample>
 5680 </para>
 5681 
 5682 <para>When the
 5683 <symbol>pcl_font_download</symbol>
 5684 option is expanded,
 5685 it will generate the pathnames
 5686 <filename>/usr/local/lib/fonts/font1</filename>
 5687 and
 5688 <filename>/usr/local/lib/fonts/font2</filename>,
 5689 open these files,
 5690 and send their contents directly to the printer.</para>
 5691 
 5692 </sect1>
 5693 
 5694 <sect1>
 5695 <title>PS Font Downloading</title>
 5696 
 5697 <para>PostScript font downloading is supported in a similar manner to
 5698 PCL font downloading.
 5699 <informalexample>
 5700 <screen>#
 5701 # Fonts and Font Downloading
 5702 #
 5703 ps_init=[ ... font ... ]
 5704 
 5705 # combination command
 5706 ps_font=[ font_download ]
 5707 
 5708 # font directory
 5709 ps_fontdir=/usr/local/lib/fonts
 5710 
 5711 #default font file
 5712 font=font.ps.10</screen>
 5713 </informalexample>
 5714 </para>
 5715 
 5716 <para>In a similar manner to the PCL font downloading,
 5717 when the
 5718 <symbol>ps_init</symbol>
 5719 list is expanded,
 5720 the
 5721 <symbol>ps_font</symbol>
 5722 entry will be expanded in turn.
 5723 If the <literal>-Zfont=ZapDingbat.ps</literal> is specified,
 5724 then the
 5725 <filename>/usr/local/lib/fonts/ZapDingbat.sp</filename>
 5726 file will be opened and downloaded to the printer.</para>
 5727 
 5728 </sect1>
 5729 
 5730 <sect1>
 5731 <title>PJL File Downloading</title>
 5732 
 5733 <para>In a similar manner to the above font downloading,
 5734 you can specify a configuration or other setup file that should be
 5735 sent to the printer as part of the PJL setups.
 5736 The following configuration shows how to set this up.
 5737 <informalexample>
 5738 <screen>#
 5739 # PJL Initialization File Downloading
 5740 #  fontid is used to set the current font
 5741 pjl_init=[ ... setup  ... ]
 5742 
 5743 setup=initval
 5744 font=\%s{setup}
 5745 # setup directory
 5746 pjl_fontdir=/usr/local/lib/fonts
 5747 pjl_setup=[ font_download ]</screen>
 5748 </informalexample>
 5749 </para>
 5750 
 5751 <para>The above configuration will cause the value of the
 5752 <literal>setup</literal>
 5753 <option>-Z</option>,
 5754 <option>-T</option>
 5755 or configuration option to be used.</para>
 5756 
 5757 </sect1>
 5758 </chapter>
 5759 
 5760 <chapter>
 5761 <title>Debugging and Problem Solving</title>
 5762 
 5763 <para>If you are reading this section,
 5764 then most likely you have had a problem using &IFHP; with &LPRng;.
 5765 Before going any further,
 5766 please read
 5767 <link linkend="rfc1179pc">RFC1179 (BSD or TCP/IP) Job Transfer Printcap Entry</link>,
 5768 and make sure that your printcap entry has the
 5769 <symbol>lpd_bounce</symbol> flag set.
 5770 This is the <emphasis remap=it>Most Frequently Asked Question</emphasis> and the
 5771 <emphasis remap=it>Most Frequently Provided Answer</emphasis> on the &LPRng; mailing list.</para>
 5772 
 5773 <para>The following section outlines a method to debug problems with the
 5774 &IFHP; filter.
 5775 It will make use of some <literal>diagnostic</literal> options that are normally
 5776 not used in a printcap entry.
 5777 First,
 5778 let us start with a typical printcap entry and a problem.
 5779 <informalexample>
 5780 <screen>lw4:
 5781   :lp=10.0.0.14%9100
 5782   :sd=/var/spool/lpd/%P
 5783   :ifhp=/usr/local/lib/filters/ifhp
 5784 
 5785 Command:
 5786   lpr -Plw4 -V /etc/motd
 5787 
 5788 LPR output:
 5789 
 5790 sending job 'papowell@h4+223' to lw4@localhost
 5791 connecting to 'localhost', attempt 1
 5792 connected to 'localhost'
 5793 requesting printer lw4@localhost
 5794 sending control file 'cfA223h4.private' to lw4@localhost
 5795 completed sending 'cfA223h4.private' to lw4@localhost
 5796 sending data file 'dfA223h4.private' to lw4@localhost
 5797 completed sending 'dfA223h4.private' to lw4@localhost
 5798 done job 'papowell@h4+223' transfer to lw4@localhost
 5799 Version LPRng-3.6.14</screen>
 5800 </informalexample>
 5801 </para>
 5802 
 5803 <para>When trying to print to the print queue,
 5804 the user discovers that no output comes out of the printer.
 5805 The immediate suspicion is that the filter is not working.
 5806 You should make sure that the <literal>lpr</literal> command is actually sending
 5807 the job to the print queue.
 5808 You can then use <literal>lpq</literal> to discover what happened:
 5809 <informalexample>
 5810 <screen># lpq -llll
 5811 Printer: lw4@h4  'Hp : Laserwriter'
 5812  Queue: no printable jobs in queue
 5813  Status: subserver pid 27251 starting at 15:34:09.350
 5814  Status: accounting at start at 15:34:09.357
 5815  Status: opening device 'h14.private%9100' at 15:34:09.366
 5816  Status: printing job 'root@h4+223' at 15:34:09.375
 5817  Status: printing data file 'dfA223h4.private', size 3, IF filter 'ifhp' at 15:34:09.376
 5818  Status: IF filter finished at 15:34:35.012
 5819  Status: printing done 'root@h4+223' at 15:34:35.012
 5820  Status: accounting at end at 15:34:35.014
 5821  Status: finished 'root@h4+223', status 'JSUCC' at 15:34:35.014
 5822  Status: subserver pid 27251 exit status 'JSUCC' at 15:34:35.018
 5823  Status: lw4@h4.private: job 'root@h4+223' printed at 15:34:35.020
 5824  Status: job 'root@h4+223' removed at 15:34:35.101
 5825  Filter_status: accounting at start, pagecount 89696, pages 0 at 15:34:13.304
 5826  Filter_status: sending job file at 15:34:13.306
 5827  Filter_status: starting transfer at 15:34:13.306
 5828  Filter_status: initial job type 'text' at 15:34:13.306
 5829  Filter_status: job type 'pcl' at 15:34:13.306
 5830  Filter_status: transferring 3 bytes at 15:34:13.308
 5831  Filter_status: 100 percent done at 15:34:13.308
 5832  Filter_status: finished writing file, cleaning up at 15:34:13.308
 5833  Filter_status: sent job file at 15:34:13.308
 5834  Filter_status: doing cleanup at 15:34:13.308
 5835  Filter_status: getting end using 'pjl job/eoj' at 15:34:13.309
 5836  Filter_status: end of job detected at 15:34:33.219
 5837  Filter_status: getting pagecount using 'pjl info pagecount' at 15:34:33.219
 5838  Filter_status: final pagecount 89697 at 15:34:35.009
 5839  Filter_status: accounting at end, pagecount 89697, pages 1 at 15:34:35.010
 5840  Filter_status: done at 15:34:35.010</screen>
 5841 </informalexample>
 5842 </para>
 5843 
 5844 <para>As you can see from the <literal>lpq</literal> output,
 5845 the <literal>Status</literal> section shows the
 5846 <application/lpd/ activities
 5847 and the <symbol>Filter_status</symbol> section shows what &IFHP;
 5848 is doing.
 5849 This is the first line of defense - make sure that the information
 5850 and errors reported here are for the correct filter.</para>
 5851 
 5852 <para>If this does not help,
 5853 then we will start with the basic filter tests and work our way
 5854 <emphasis remap=it>back</emphasis> to the print server.
 5855 First,  you will need a couple of test files.
 5856 If you have a PostScript printer,
 5857 find a simple PostScript file - the <filename>ellipse.ps</filename>
 5858 file is included in the &IFHP; distribution in the
 5859 <acronym>UTILS</acronym> directory.
 5860 You will also need a short text file - <filename>/etc/motd</filename>
 5861 is usually handy to use.</para>
 5862 
 5863 <para>Create the <filename>/tmp/send</filename> file with the following contents:
 5864 <informalexample>
 5865 <screen>#!/bin/sh
 5866 cp /dev/null /tmp/t
 5867 /usr/local/libexec/filters/ifhp -Tdev=/tmp/t,trace,debug=1 &lt;/etc/motd 2&gt;/tmp/trace</screen>
 5868 </informalexample>
 5869 </para>
 5870 
 5871 <para>This will create the <filename>/tmp/t</filename> file,
 5872 run the &IFHP; filter,
 5873 and put the trace and debugging information into the <filename>/tmp/trace</filename>
 5874 file.
 5875 Run this command using:
 5876 <informalexample>
 5877 <screen>#!/bin/sh
 5878 sh -x /tmp/send</screen>
 5879 </informalexample>
 5880 </para>
 5881 
 5882 <para>Examine the output in <filename>/tmp/trace</filename>.
 5883 It will look like:
 5884 <informalexample>
 5885 <screen>ifhp 15:46:14.402 [27307] main: Debug '1'
 5886 ifhp 15:46:14.403 [27307] main: dump &lt;NULL&gt;
 5887 ifhp 15:46:14.403 [27307] main: Model_id '&lt;NULL&gt;'
 5888 ifhp 15:46:14.440 [27307] main: scanning Raw for default, then model '&lt;NULL&gt;'
 5889 ifhp 15:46:14.441 [27307] Select_model_info: id 'default', list-&gt;count 1940, model-&gt;count 0, init 0
 5890 ifhp 15:46:14.448 [27307] Dump_line_list: main: Model information - count 156, max 204, list 0x806e000
 5891 ifhp 15:46:14.448 [27307]   [ 0]='T=dev=/tmp/g,trace,debug=1'
 5892 ifhp 15:46:14.448 [27307]   [ 1]='banner@'
 5893 ifhp 15:46:14.448 [27307]   [ 2]='banner_file=/usr/local/libexec/filters/psbanner.ps'
 5894 ifhp 15:46:14.448 [27307]   [ 3]='converter='
 5895 ifhp 15:46:14.448 [27307]   [ 4]='debug=1'
 5896 ifhp 15:46:14.449 [27307]   [ 5]='default_language=text'
 5897 ifhp 15:46:14.449 [27307]   [ 6]='dev=/tmp/g'
 5898 ifhp 15:46:14.449 [27307]   [ 7]='duplex_select=1'</screen>
 5899 </informalexample>
 5900 </para>
 5901 
 5902 <para>Most of the information with debug level 1 is simply showing the details of
 5903 options,
 5904 command execution, and error status.
 5905 This will,
 5906 however,
 5907 help with the majority of problems.</para>
 5908 
 5909 <para>You can now modify the <filename>/tmp/send</filename> file to better reflect your
 5910 printer.
 5911 <informalexample>
 5912 <screen>#!/bin/sh
 5913 cp /dev/null /tmp/t
 5914 # substitute your ifhp options here
 5915 ifhp=model=hp4,status@
 5916 /usr/local/libexec/filters/ifhp -Tdev=/tmp/t,trace,debug=1,${ifhp} &lt;/etc/motd 2&gt;/tmp/trace</screen>
 5917 </informalexample>
 5918 
 5919 Now run this again and examine the trace and output in <filename>/tmp/t</filename>.
 5920 If this looks correct,
 5921 we move on to the interactive tests.</para>
 5922 
 5923 <para>If your printer is a network based printer and you are using RFC1179 transfers,
 5924 then you can use the following <literal>lpr</literal> command to
 5925 send the <filename>/tmp/t</filename> file
 5926 directly to the printer:
 5927 <informalexample>
 5928 <screen>  lpr -Ppr@host /tmp/t
 5929 Example:
 5930   print queue 'raw'
 5931 
 5932   lpr -Praw@10.1.1.1 /tmp/t
 5933 </screen>
 5934 </informalexample>
 5935 </para>
 5936 
 5937 <para> This form of the command causes <literal>lpr</literal> to send the job directly
 5938 to the printer.
 5939 If this works correctly then we know that there is no problem with &IFHP;
 5940 formatting the file,
 5941 and that the problem must be with the <application/lpd/ print spooler.</para>
 5942 
 5943 <para>If your printer is network based and uses a socket connection,
 5944 then you can have &IFHP; connect to the printer by using the <literal>dev=host%port</literal>
 5945 connection option.
 5946 This is only used for testing or when you want to use the AppSocket protocol.
 5947 <informalexample>
 5948 <screen>#!/bin/sh
 5949 # substitute your ifhp options here
 5950 #  this should always work
 5951 #ifhp=model=hp4,status@
 5952 #  this does status checking, no pagecount
 5953 #ifhp=model=hp4,pagecount@
 5954 #  this does status checking and pagecount
 5955 #ifhp=model=hp4
 5956 /usr/local/libexec/filters/ifhp -Tdev=10.1.1.1%9100,trace,debug=1,${ifhp} &lt;/etc/motd 2&gt;/tmp/trace</screen>
 5957 </informalexample>
 5958 </para>
 5959 
 5960 <para>If you have a windowing system, run this command from one window and
 5961 in another window use the <command>tail -f /tmp/trace</command> command to view status.
 5962 Most of the time you will discover that the system is failing to print
 5963 because either the
 5964 <literal>sync</literal>,
 5965 <literal>pagecount</literal>,
 5966 or
 5967 <literal>waitidle</literal>
 5968 step of the printing process is not completing correctly.
 5969 If there is insufficient detail for you to decide  the failure mechanism,
 5970 set <literal>debug=3</literal>, or even <literal>debug=4</literal> and explore what is happening.</para>
 5971 
 5972 <para>If you have a parallel port connected printer on <filename>/dev/lptxx</filename>,
 5973 then you can simply use <command>cat /tmp/t &gt;/dev/lptxx</command> and see what happens.
 5974 If this works, then use:
 5975 <informalexample>
 5976 <screen>#!/bin/sh
 5977 # substitute your ifhp options here
 5978 ifhp=model=hp4,status@
 5979 /usr/local/libexec/filters/ifhp -Tdev=/dev/lptxxx,trace,debug=1,${ifhp} &lt;/etc/motd 2&gt;/tmp/trace</screen>
 5980 </informalexample>
 5981 </para>
 5982 
 5983 <para>If you have a serial port printer,
 5984 then you can use a similar method for setting up a connection.
 5985 You will need to use the undocumented <literal>stty</literal> option to set the speed and
 5986 other parameters.
 5987 These are identical to those used by &LPRng;, so you should have no problems.
 5988 <informalexample>
 5989 <screen>#!/bin/sh
 5990 # substitute your ifhp options here
 5991 #  this should always work
 5992 #ifhp=model=hp4,status@
 5993 #  this does status checking, no pagecount
 5994 #ifhp=model=hp4,pagecount@
 5995 #  this does status checking and pagecount
 5996 #ifhp="model=hp4,stty= 9600 -parity crtscts raw"
 5997 stty="9600 -parity crtscts raw"
 5998 /usr/local/libexec/filters/ifhp -Tdev=/dev/tty00,trace,debug=1,${ifhp},stty=\"${stty}\" &lt;/etc/motd 2&gt;/tmp/trace</screen>
 5999 </informalexample>
 6000 </para>
 6001 
 6002 <para>If all this does not help,
 6003 then subscribe to the &LPRng; mailing list and ask for help.</para>
 6004 
 6005 </chapter>
 6006 
 6007 <appendix id=ifhpoptions>
 6008 <title>Index to Options</title>
 6009 
 6010 <para>
 6011 
 6012 <table frame=all id=ifhpoptionstable>
 6013 <title><literal/ifhp.conf/ - &IFHP; Options</title>
 6014 <tgroup cols=2 colsep=1 rowsep=1 align=left >
 6015 <thead><row><entry>Option</entry><entry>Purpose</entry></row></thead>
 6016 <tbody>
 6017 <row><entry><link linkend="modelselection"/<literal/default//</entry> <entry>HP 4M Plus, PostScript, PJL, PCL, status, pagecount support </entry></row>
 6018 <row><entry><link linkend="appsocket"/<literal/appsocket FLAG//</entry> <entry>Use Tektronix AppSocket Protocol </entry></row>
 6019 <row><entry><link linkend="config"/<literal/config=PATHNAMES//</entry> <entry>Configuration file pathnames </entry></row>
 6020 <row><entry><link linkend="crlf"/<literal/crlf FLAG//</entry> <entry>Do LF to CRLF translation </entry></row>
 6021 <row><entry><link linkend="config"/<literal/debug FLAG//</entry> <entry>Debugging level </entry></row>
 6022 <row><entry><link linkend="conversion"/<literal/default_language=LANGUAGE//</entry> <entry>Default job file language (ps, pcl, raw, text, etc) </entry></row>
 6023 <row><entry><link linkend="pjlinit"/<literal/endpage=NNN//</entry> <entry>PJL JOB command END = NNN value </entry></row>
 6024 <row><entry><link linkend="fileconversion"/<literal/forceconversion FLAG//</entry> <entry>Force conversion using UNIX file(1) utility </entry></row>
 6025 <row><entry><link linkend="conversion"/<literal/file_output_match=LIST//</entry> <entry>File type and conversion matching </entry></row>
 6026 <row><entry><link linkend="file-util-path"/<literal/file_util_path=PATHNAME//</entry> <entry>Pathname of the UNIX file(1) utility </entry></row>
 6027 <row><entry><link linkend="conversion"/<literal/language=LANGUAGE//</entry> <entry>Specify job file language to be used (ps, pcl, raw, text, etc) </entry></row>
 6028 <row><entry><link linkend="filetransfer"/<literal/logall FLAG//</entry> <entry>Log all status reports from printer if set </entry></row>
 6029 <row><entry><link linkend="nullpad"/<literal/nullpad=COUNT//</entry> <entry>Send COUNT nulls to force full buffer condition </entry></row>
 6030 <row><entry><link linkend="options"/<literal/model=NAME//</entry> <entry>Specify model name for configuration selection </entry></row>
 6031 <row><entry><link linkend="options"/<literal/model_from_option=X//</entry> <entry>Specify model name using a command line option value </entry></row>
 6032 <row><entry><link linkend="syncpage"/<literal/pagecount=LANGUAGE//</entry> <entry>Get pagecount using pjl, ps or default </entry></row>
 6033 <row><entry><link linkend="syncpage"/<literal/pagecount_interval=SECONDS//</entry> <entry>Send pagecount command at SECONDS interval </entry></row>
 6034 <row><entry><link linkend="syncpage"/<literal/pagecount_ps_code=STRING//</entry> <entry>PostScript code to get pagecount information </entry></row>
 6035 <row><entry><link linkend="syncpage"/<literal/pagecount_timeout=SECONDS//</entry> <entry>Timeout getting pagecount after SECONDS </entry></row>
 6036 <row><entry><link linkend="languages"/<literal/pcl FLAG//</entry> <entry>Printer supports PCL if set </entry></row>
 6037 <row><entry><link linkend="pcl-eoj-at-start"/<literal/pcl_eoj_at_start FLAG//</entry> <entry>PCL EOJ (CTRL-D) at start of job </entry></row>
 6038 <row><entry><link linkend="languageinit"/<literal/pcl_init=LIST//</entry> <entry>PCL initializations to be done </entry></row>
 6039 <row><entry><link linkend="pcl-user-opts"/<literal/pcl_user_opts=LIST//</entry> <entry>User PCL options supported </entry></row>
 6040 <row><entry><link linkend="languages"/<literal/pjl FLAG//</entry> <entry>Printer supports PJL if set </entry></row>
 6041 <row><entry><link linkend="filetransfer"/<literal/pjl_alert_codes=LIST//</entry> <entry>alert operator on these PJL error codes </entry></row>
 6042 <row><entry><link linkend="filetransfer"/<literal/pjl_alert_handler=STRING//</entry> <entry>program to alert operator on PJL error </entry></row>
 6043 <row><entry><link linkend="pjl-console"/<literal/pjl_console FLAG//</entry> <entry>Printer supports messages on console </entry></row>
 6044 <row><entry><link linkend="filetransfer"/<literal/pjl_error_codes=LIST//</entry> <entry>PJL error messages for error codes </entry></row>
 6045 <row><entry><link linkend="pjlinit"/<literal/pjl_except=LIST//</entry> <entry>Do not allow these PJL commands </entry></row>
 6046 <row><entry><link linkend="pjlinit"/<literal/pjl_init=LIST//</entry> <entry>PJL initializations to be done </entry></row>
 6047 <row><entry><link linkend="pjl-job"/<literal/pjl_job FLAG//</entry> <entry>PJL JOB and EOJ supported </entry></row>
 6048 <row><entry><link linkend="pjlinit"/<literal/pjl_only=LIST//</entry> <entry>Allow only these PJL commands </entry></row>
 6049 <row><entry><link linkend="filetransfer"/<literal/pjl_quiet_codes=LIST//</entry> <entry>ignore these PJL error codes </entry></row>
 6050 <row><entry><link linkend="pjlinit"/<literal/pjl_user_opts=LIST//</entry> <entry>Allow only these user PJL commands or variables to be set </entry></row>
 6051 <row><entry><link linkend="pjlinit"/<literal/pjl_vars_except=LIST//</entry> <entry>Do not allow these PJL variables to be set </entry></row>
 6052 <row><entry><link linkend="pjlinit"/<literal/pjl_vars_set=LIST//</entry> <entry>Allow these PJL variables to be set </entry></row>
 6053 <row><entry><link linkend="languages"/<literal/ps FLAG//</entry> <entry>Printer supports PostScript (ps) </entry></row>
 6054 <row><entry><link linkend="ps-eoj-at-start"/<literal/ps_eoj_at_start FLAG//</entry> <entry>PostScript EOJ (CTRL-D) at start of job </entry></row>
 6055 <row><entry><link linkend="languageinit"/<literal/ps_init=LIST//</entry> <entry>PS initializations to be done </entry></row>
 6056 <row><entry><link linkend="ps-user-opts"/<literal/ps_user_opts=LIST//</entry> <entry>Support these PostScript user options </entry></row>
 6057 <row><entry><link linkend="remove-ctrl"/<literal/remove_ctrl=LIST//</entry> <entry>Remove these characters from PostScript jobs </entry></row>
 6058 <row><entry><link linkend="remove-pjl-at-start"/<literal/remove_pjl_at_start FLAG//</entry> <entry>Remove PJL commands from begining of job </entry></row>
 6059 <row><entry><link linkend="pjlinit"/<literal/startpage=NNN//</entry> <entry>PJL JOB command START = NNN value </entry></row>
 6060 <row><entry><link linkend="rwtimeout"/<literal/send_job_rw_timeout=NNN//</entry> <entry>Timeout for non-responding printer</entry></row>
 6061 <row><entry><link linkend="status"/<literal/status FLAG//</entry> <entry>Printer supplies status information </entry></row>
 6062 <row><entry><link linkend="statusfile"/<literal/statusfile=PATHNAME//</entry> <entry>Status file pathname </entry></row>
 6063 <row><entry><link linkend="statusfile"/<literal/statusfile_max=NNN//</entry> <entry>Status file has maximum size of NNN Kbytes </entry></row>
 6064 <row><entry><link linkend="statusfile"/<literal/statusfile_min=NNN//</entry> <entry>Status file has truncated size of NNN Kbytes </entry></row>
 6065 <row><entry><link linkend="statusfile"/<literal/summaryfile=PATHNAME//</entry> <entry>Summary file pathname </entry></row>
 6066 <row><entry><link linkend="syncpage"/<literal/sync FLAG//</entry> <entry>Synchronize printer if set </entry></row>
 6067 <row><entry><link linkend="syncpage"/<literal/sync_interval=SECONDS//</entry> <entry>Send synchronization request at SECONDS interval </entry></row>
 6068 <row><entry><link linkend="syncpage"/<literal/sync_timeout=SECONDS//</entry> <entry>Timeout synchronization request after SECONDS </entry></row>
 6069 <row><entry><link linkend="tbcp"/<literal/tbcp FLAG//</entry> <entry>Use Transparent Binary Communications Protocol for PostScript files </entry></row>
 6070 <row><entry><link linkend="languages"/<literal/text FLAG//</entry> <entry>Printer supports text mode </entry></row>
 6071 <row><entry><link linkend="config"/<literal/trace FLAG//</entry> <entry>Put error and trace messages on STDERR if set </entry></row>
 6072 <row><entry><link linkend="waitend"/<literal/waitend=METHOD//</entry> <entry>How to wait for printer to end printing </entry></row>
 6073 <row><entry><link linkend="waitend"/<literal/waitend_interval=SECONDS//</entry> <entry>How often to query printer for end of printing </entry></row>
 6074 <row><entry><link linkend="waitend"/<literal/waitend_ctrl_t_interval=SECONDS//</entry> <entry>How often to send CTRL-T for end of printing status </entry></row>
 6075 
 6076 </tbody>
 6077 </tgroup>
 6078 </table>
 6079 
 6080 </para>
 6081 
 6082 </appendix>
 6083 
 6084 
 6085 <appendix>
 6086 <title>HP JetDirect Card Support</title>
 6087 
 6088 <para>The  HPJetDirect  card or external
 6089 JetDirect box can  be configured through the printer front
 6090 panel  or through a set of network files.  Here is a summary
 6091 of  the  methods  used  from  UNIX  systems, or when you are
 6092 desperate, to configure the printer.</para>
 6093 
 6094 
 6095 <sect1>
 6096 <title>MicroSoft JetDirect Support</title>
 6097 <para>
 6098 There is limited support from HP for non-MicroSoft configuration tools.
 6099 However,
 6100 the tools that are provided are simple and easy to use,
 6101 especially for the initial configuration.
 6102 </para>
 6103 </sect1>
 6104 
 6105 <sect1>
 6106 <title>TCP/IP Address</title>
 6107 <para>You can set the TCP/IP address from the front panel.
 6108 Reset  the printer and then use the MENU, +-, SELECT keys as follows:
 6109 <informalexample>
 6110 <screen> MENU  -&gt; MIO MENU (use MENU to display MIO MENU)
 6111  ITEM  -&gt; CFG NETWORK=NO*
 6112  +     -&gt; CFG NETWORK=YES
 6113  ENTER -&gt; CFG NETWORK=YES*
 6114  ITEM  -&gt; TCP/IP=OFF* (use ITEM to display TCP/IP)
 6115  +     -&gt; TCP/IP=ON
 6116  ENTER -&gt; TCP/IP=ON*
 6117  ITEM  -&gt; CFG TCP/IP=NO* (use ITEM to display TCP/IP)
 6118  +     -&gt; CFG TCP/IP=YES
 6119  ENTER -&gt; CFG TCP/IP=YES*
 6120  ITEM  -&gt; BOOTP=NO*
 6121      (Enable BOOTP if you want to - see below)
 6122  ITEM  -&gt; IP BYTE 1=0*
 6123      This is IP address MSB byte.
 6124      Use +- keys to change value, and then ENTER to change
 6125      Use ITEM keys to get IP BYTE=2,3,4
 6126  ITEM  -&gt; SM BYTE 1=255*
 6127       This is the subnet mask value
 6128      Use +- keys to change value, and then ENTER to change
 6129      Use ITEM keys to get IP BYTE=2,3,4
 6130  ITEM  -&gt; LG BYTE 1=255*
 6131      This is the Syslog server (LoGger) IP address
 6132      Use +- keys to change value, and then ENTER to change
 6133      Use ITEM keys to get IP BYTE=2,3,4
 6134  ITEM  -&gt; GW BYTE 1=255*
 6135      This is the subnet gateway (router) IP address
 6136      Use +- keys to change value, and then ENTER to change
 6137      Use ITEM keys to get IP BYTE=2,3,4
 6138  ITEM  -&gt; TIMEOUT=90
 6139       This is the connection timeout value.  It puts a limit
 6140      on time between connections.  A value of 10 is reasonable.</screen>
 6141 </informalexample>
 6142 </para>
 6143 
 6144 </sect1>
 6145 <sect1>
 6146 <title>Web Server Configuration</title>
 6147 <para>
 6148 Many of the newer releases of HP JetDirect firmware have a Web Server
 6149 configuration capability.
 6150 Unfortunately,
 6151 the web pages assume that you have JavaScript support for the browser,
 6152 and not all of the facilities used are supported by all browsers.
 6153 However the configuration information and pages presented are extremely simple
 6154 to use and understand.
 6155 </para>
 6156 <para>
 6157 The major problem with the Web Server configuration is that not all of the
 6158 options can be set through the Web Server pages.
 6159 </para>
 6160 </sect1>
 6161 
 6162 <sect1>
 6163 <title>Telnet Configuration</title>
 6164 <para>
 6165 Once you have assigned an IP address to the JetDirect Box you can telnet to
 6166 the box and configure it through a simple command line interface.
 6167 When you first connect to the box,
 6168 hit <literal/RETURN/ a couple of times,
 6169 followed by <literal/?/ (Question Mark) <literal/RETURN/
 6170 and you should get a simple help menu.
 6171 This help information usually scrolls off a small (25 line) screen so a
 6172 buffer that allows you to see all of the information is advisable.
 6173 </para>
 6174 <para>
 6175 The major problem with the telnet configuration is that not all of the
 6176 options can be set through the command line facilties.
 6177 </para>
 6178 </sect1>
 6179 
 6180 <sect1>
 6181 <title>BOOTP Information</title>
 6182 
 6183 <para>If  you have a bootp server, you can put this information
 6184 in  the  bootptab  file.   To  use this, you must enable the
 6185 bootp  option  on  the printer.  The T144 option specifies a
 6186 file to be read from the bootp server.  This file is read by
 6187 using  the  TFTP  protocol, and you must have a TFTPD server
 6188 enabled.  Here is a sample bootptab entry.
 6189 <informalexample>
 6190 <screen># Example /etc/bootptab: database for bootp server (/etc/bootpd).
 6191 # Blank lines and lines beginning with '#' are ignored.
 6192 #
 6193 # Legend:
 6194 #
 6195 #       first field -- hostname
 6196 #                       (may be full domain name)
 6197 #
 6198 #       hd -- home directory
 6199 #       bf -- bootfile
 6200 #       cs -- cookie servers
 6201 #       ds -- domain name servers
 6202 #       gw -- gateways
 6203 #       ha -- hardware address
 6204 #       ht -- hardware type
 6205 #       im -- impress servers
 6206 #       ip -- host IP address
 6207 #       lg -- log servers
 6208 #       lp -- LPR servers
 6209 #       ns -- IEN-116 name servers
 6210 #       rl -- resource location protocol servers
 6211 #       sm -- subnet mask
 6212 #       tc -- template host (points to similar host entry)
 6213 #       to -- time offset (seconds)
 6214 #       ts -- time servers
 6215 #
 6216 # Be careful about including backslashes where they're needed.  Weird (bad)
 6217 # things can happen when a backslash is omitted where one is intended.
 6218 #
 6219 peripheral1:
 6220 :hn:ht=ether:vm=rfc1048:
 6221 :ha=08000903212F:
 6222 :ip=190.40.101.22:
 6223 :sm=255.255.255.0:
 6224 :gw=190.40.101.1:
 6225 :lg=190.40.101.3:
 6226 :T144="hpnp/peripheral1.cfg":</screen>
 6227 </informalexample>
 6228 </para>
 6229 
 6230 <para>If  you  are  using the T144 option, you will need to create
 6231 the  configuration file.  The sample configuration file from
 6232 the HP Direct distribution is included below.
 6233 <informalexample>
 6234 <screen>#
 6235 # Example HP Network Peripheral Interface configuration file
 6236 #
 6237 # Comments begin with '#' and end at the end of the line.
 6238 # Blank lines are ignored.  Entries cannot span lines.
 6239 
 6240 # Name is the peripheral (or node) name.  It is displayed on the peripheral's
 6241 # self-test page or configuration plot, and when sysName is obtained through
 6242 # SNMP.  This name can be provided in the BOOTP response or can be specified
 6243 # in the NPI configuration file to prevent the BOOTP response from overflowing
 6244 # the packet.  The domain portion of the name is not necessary because the
 6245 # peripheral does not perform Domain Name System (DNS) searches.  Name is
 6246 # limited to 64 characters.
 6247 
 6248 name: picasso
 6249 
 6250 # Location describes the physical location of the peripheral.  This is the
 6251 # value used by the interface for the MIB-II sysLocation object.  The default
 6252 # location is undefined.  Only printable ASCII characters are allowed.
 6253 # Maximum length is 64 characters.
 6254 
 6255 location: 1st floor, south wall
 6256 
 6257 # Contact is the name of the person who administers or services the peripheral
 6258 # and may include how to contact this person.  It is limited to 64 characters.
 6259 # This is the value used by the interface for the MIB-II sysContact object.
 6260 # The default contact is undefined.  Only printable ASCII characters are
 6261 # allowed.  Maximum length is 64 characters.
 6262 
 6263 contact: Phil, ext 1234
 6264 
 6265 # The host access list contains the list of hosts or networks of hosts
 6266 # that are allowed to connect to the peripheral.  The format is
 6267 # "allow: netnum [mask]", where netnum is a network number or a host IP
 6268 # address.  Mask is an address mask of bits to apply to the network number
 6269 # and connecting host's IP address to verify access to the peripheral.
 6270 # The mask usually matches the network or subnet mask, but this is not
 6271 # required.  If netnum is a host IP address, the mask 255.255.255.255 can
 6272 # be omitted.  Up to ten access list entries are permitted.
 6273 
 6274 # to allow all of network 10 to access the peripheral:
 6275 allow: 10.0.0.0  255.0.0.0
 6276 
 6277 # to allow a single host without specifying the mask:
 6278 allow: 15.1.2.3
 6279 
 6280 # Idle timeout is the time (in seconds) after which an idle
 6281 # print data connection is closed.  A value of zero disables
 6282 # the timeout mechanism.  The default timeout is 90 seconds.
 6283 
 6284 idle-timeout: 120
 6285 
 6286 # A community name is a password that allows SNMP access to MIB values on
 6287 # the network peripheral.  Community names are not highly secure; they are
 6288 # not encrypted across the network.  The get community name determines which
 6289 # SNMP GetRequests are responded to.  By default, the network peripheral
 6290 # responds to all GetRequests.  The get community name is limited to 32
 6291 # characters.
 6292 #
 6293 # For hpnpstat and hpnpadmin, the community name can be stored in
 6294 # /usr/lib/hpnp/hpnpsnmp.
 6295 
 6296 get-community-name: blue
 6297 
 6298 # The set community name is similar to the get community name.  The set
 6299 # community name determines which SNMP SetRequests are responded to.  In
 6300 # addition, SetRequests are only honored if the sending host is on the
 6301 # host access list.  By default, the network peripheral does not respond
 6302 # to any SetRequests.  The set community name is limited to 32 characters.
 6303 #
 6304 # The set community name can come from /usr/lib/hpnp/hpnpsnmp
 6305 # if it is the same as the get community name.  We recommend that the
 6306 # set community name be different from the get community name though.
 6307 
 6308 set-community-name: yellow
 6309 
 6310 # SNMP traps are asynchronous notifications of some event that has occurred.
 6311 # SNMP traps are useful only with network management software.  Traps are
 6312 # sent to specific hosts and include a trap community name.  Up to four
 6313 # hosts can be sent SNMP traps.   The trap community name is limited to
 6314 # 32 characters.  The default name is public.
 6315 
 6316 trap-community-name: red
 6317 
 6318 # The SNMP trap destination list specifies systems to which SNMP
 6319 # traps are sent.  Up to four IP addresses are allowed.  If no
 6320 # trap destinations are listed, traps are not sent.
 6321 
 6322 trap-dest: 15.1.2.3
 6323 trap-dest: 15.2.3.4
 6324 
 6325 # The SNMP authentication trap parameter enables or disables the sending
 6326 # of SNMP authentication traps.  Authentication traps indicate that an SNMP
 6327 # request was received and the community name check failed.  By default,
 6328 # the parameter is off.
 6329 
 6330 authentication-trap: on
 6331 
 6332 # The syslog-facility parameter sets the source facility identifier that the
 6333 # card uses when issuing syslog messages.  Other facilities, for example,
 6334 # include the kernel (LOG_KERN), the mail system (LOG_MAIL), and the spooling
 6335 # system (LOG_LPR).  The card only allows its syslog facility to be configured
 6336 # to one of the local user values (LOG_LOCAL0 through LOG_LOCAL7).  The
 6337 # selectable option strings, local0 through local7 (configured to LOG_LOCAL0
 6338 # through LOG_LOCAL7, respectively) are case insensitive.  The default
 6339 # syslog-facility for the card is LOG_LPR.
 6340 
 6341 syslog-facility: local2
 6342 
 6343 # This parameter allows the card to treat hosts on other subnets as if the
 6344 # hosts were on the card's subnet.  This parameter determines the TCP
 6345 # Maximum Segment Size (MSS) advertised by the card to hosts on other subnets
 6346 # and affects the card's initial receive-window size.  The card will use a
 6347 # TCP MSS of 1460 bytes for local hosts, and 536 bytes for a non-local host.
 6348 # The default is off, that is, the card will use the maximum packet sizes
 6349 # only on the card's configured subnet.
 6350 #
 6351 # The configuration utility does not allow access to this parameter.  If you
 6352 # want to configure it, you must manually edit the NPI configuration file
 6353 # and add it to the bottom of the entry for the network peripheral.
 6354 
 6355 subnets-local: on
 6356 
 6357 # This parameter affects how the card handles TCP connection requests from
 6358 # the host.  By default, the JetDirect MPS card will accept a TCP connection
 6359 # even if the peripheral is off-line.  If this parameter is set to "on", then
 6360 # the card will only accept a TCP connection when the peripheral is on-line.
 6361 
 6362 old-idle-mode: off
 6363 </screen>
 6364 </informalexample>
 6365 </para>
 6366 
 6367 </sect1>
 6368 
 6369 <sect1>
 6370 <title>Timeouts</title>
 6371 
 6372 <para>You should be aware that the
 6373 <literal>idle-timeout</literal>
 6374 value in the configuration file will override the value
 6375 entered on the control panel of the printer.</para>
 6376 
 6377 <para>Also,
 6378 the
 6379 <literal>@PJL SET TIMEOUT = NNN</literal>
 6380 command will override this value as well.</para>
 6381 
 6382 </sect1>
 6383 </appendix>
 6384 </book>