# The KLJetTool Handbook

Bernd Johannes
Wuebben

    wuebben@kde.org

02/11/1997
0.02.00

This Handbook describes KLJetTool Version 0.2

KDE
KLJetTool
laserjet

## Introduction

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.

I hope you will enjoy this little tool.

`Bernd Johannes Wuebben`

wuebben@kde.org

## Installation

### How to obtain KLJetTool

KLJetTool is part of the KDE project http://www.kde.org. KEdit can be found on ftp://ftp.kde.org/pub/kde/, the main ftp site of the KDE project.

### Requirements

In order to successfully compile KLJetTool, you need the latest versions of `libkdecore` and `libkfm`. All required libraries as well as KLJetTool itself can be found on ftp://ftp.kde.org/pub/kde/.

### Compilation and installation

In order to compile and install KLJetTool on your system, type the following in the base directory of the KEdit distribution:

    % ./configure
    % make
    % make install

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

## Getting KLJetTool to work

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.

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.

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.

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.

On a redhat system the script `/var/spool/lpd/lp/filter` is invoked from `/etc/printcap`, 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 `/etc/magic` 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:

- Add a line to the `/etc/magic` 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 `/etc/magic` add these lines doesn't really matter.

      # HP Printer Job Language, Bernd Wuebben (wuebben@math.cornell.edu)
      0	string		\033%-12345X	 HP PJL printer commands

- 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

         *pjl* )
                                                    startpnt="INPUT-to-prdata";;

  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.

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.

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.

## Usage

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.

## Copyright

                              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.