<!doctype linuxdoc system>

<!-- The KLJetTool Handbook.

 -->

<article>

<!-- Title information -->

<title>The KLJetTool Handbook
<author>Bernd Johannes Wuebben, <tt/wuebben@kde.org/
<date>Version 0.2, 2 November 1997
<abstract>This Handbook describes KLJetTool Version 0.2

<!-- Table of contents -->
<toc>

<!-- Begin the document -->


<sect>Introduction

<p>
KLJetTool is a program that lets you adjust your Hewlett Packard Laserjet
operating parameters. Some of Hewlet Packards printers such as the 5L or the
6L do no longer have a hardware control panel and the printer is controlled
completely by software. However this software is often available only for
the Windows platform. KLJetTool seeks to fill the need for such software
on the Unix platform. It should work with any printer that understands
Hewlet Packarts PJL ( Printer Job Language). However some features may
have no effect on your particular model.
<p>
I hope you will enjoy this little tool.
<p>
<tt>Bernd Johannes Wuebben</tt>
<p>
<htmlurl url="mailto:wuebben@kde.org" name="wuebben@kde.org">
<p>

<sect>Installation
<p>
<sect1>How to obtain KLJetTool
<p>
KLJetTool is part  of the KDE project <url url="http://www.kde.org">.
KEdit can be found on <url url="ftp://ftp.kde.org/pub/kde/">, the main ftp site
of the KDE project.

<sect1>Requirements
<p>
In order to successfully compile KLJetTool, you need the latest versions of <tt> libkdecore</tt>
and <tt> libkfm</tt>. All required libraries as well as KLJetTool itself can be found
on <url url="ftp://ftp.kde.org/pub/kde/">. 



<sect1>Compilation and installation
<p>

In order to compile and install KLJetTool on your system, type the following in the base 
directory of the KEdit distribution:
<tscreen><verb>
% ./configure
% make
% make install
</verb></tscreen>


Since KLJetTool uses <tt>autoconf</tt> you should have not trouble compiling it.
Should you run into problems please report them to the <sf/KDE/ mailing lists.

<sect>Getting KLJetTool to work<p>

Some Linux distributions have an overly eager printing subsystem
that doesn't respect the PJL files generated by LJetTool. 
The printing subsystem these  systems does not recognize
a PJL file as such and tries to transform it using its filters.
This will cause KLJetTool to malfunction.

<p>
This section describes the steps necessary to get LJetTool to 
work on pre 5.0  RedHat Linux systems (KLJetTool should work out of the
box on RedHat linux 5.0 based distributions ). I assume similar steps might
be necessary on other systems. However, the steps which need
to be undertaken are not difficult. All that needs to be done is
to make sure that the printing subsystem sends PJL files
unmodified to the printer.
<p>
A RedHat Linux system does not recognize PJL out of the box,
and tries to do weird things with it rather then sending it
unmodified to the printer, so we have to teach it how to deal 
with a PJL file. However before you make the changes suggested
here to your system, be sure that KLJetTool really doesn't work
on your system. RedHat and other distributions  might well have 
updated its printing subsystem by the time you read this.
<p>

I assume other distributions with an equally 'sophisticated'
printer subsytem such as the RedHat system might also need 
to be taught how to deal with PJL ( Printer Job Language ) 
files that are send to the printer.
<p>

On a redhat system the script <tt>/var/spool/lpd/lp/filter</tt>
is invoked from <tt>/etc/printcap</tt>, each time something is printed
using the command 'lpr'. The filter runs the program
'file' on the file to be printed and 'file' will tell the
'filter' script what sort of document we are dealing with.
Then depending on the type of the document the right program
is run to produce output in a format that the printer can
understand. The program 'file' uses the file <tt>/etc/magic</tt>
to determine the type of the document to be printed ( e.g PostScript,
dvi, text etc )

For example, if I print a postscript document, myfile.ps, file
tells the 'filter' script that we are dealing with a postscript
file and 'filter' will run ghostscript first to convert myfile.ps
into pcl 5, a language my laserjet understands, before sending the
file to the printer. 

Unfortunately a RedHat system doesn't recognize a PJL file and
tries to do wrong things with the PJL file rather than sending 
it out to the printer unmodified. 

In order to get LJetTool to work on a RedHat system we only need
to do two things:

<itemize>
<item> Add a line to the <tt>/etc/magic</tt> file so that the program 'file'
   will correctly recognize a PJL file as a PJL file.
   
   Simply add the following two lines to your /etc/magic file.
   Where in the file <tt>/etc/magic</tt> add these lines doesn't really matter.
<tscreen><verb>
# HP Printer Job Language, Bernd Wuebben (wuebben@math.cornell.edu)
0	string		\033%-12345X	 HP PJL printer commands
</verb></tscreen>

<item> teach the /var/spool/lpd/lp/filter script what to do with PJL
   files. This can be done by adding the following two lines 
   to the 'filter' script
<tscreen><verb>
   *pjl* )
                                              startpnt="INPUT-to-prdata";;
</verb></tscreen>		
			      
   If you have a look at the filter script it will be clear where to
   add it ( at about line 220 in the version I have ). These lines
   simply tell the script to leave a PJL file alone and to send it
   unmodified to the printer.
</itemize>

I have included a copy of my filter script as well as my /etc/magic. You
can use them if you have trouble making the above outlined modifications.
You should be able to find them in the same directory where you found 
KLJetTool documentation.
<p>
I would love to received instructions for what ( if anything ) needs
to be done to get LJetTool to work on other systems who use an elaborate
printing filter subsystem. 
<p>   

<sect>Usage<p>

KLJetTool is very simply to use. In fact most of its functions should be
selfexplanatory. However, I have absolutely no time to write a long
manual at this point. Please contact me if you would like to write it.

<sect>Copyright<p>
<tscreen><verb>
                          KLJetTool 

Copyright 1997  Bernd Johannes Wuebben,  <wuebben@math.cornell.edu>


This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.

</verb></tscreen>
</article>

