v0.1 Nov 11, 2000
-
+ppa-rpms@users.sourceforge.netv0.2 June 11, 2002
+Information about using pnm2ppa with Mandrake. (Updated for pnm2ppa-1.04 and later.)
-
Mandrake-specific issues.
+
Mandrake-specific issues.
See the document
INSTALL.REDHAT.html
for installation and setup. That document is written
for Red Hat; note the Mandrake-specific differences
-listed below,
+listed below,
+
To update pnm2ppa
+in any recent Mandrake release (7.2 or later) from v1.04 to v1.10,
+the simplest procedure may be
+just to compile pnm2ppa from tarball source and replace the Mandake binaries
+/usr/bin/pnm2ppa and /usr/bin/calibrate_ppa with
+the new versions. They should function as drop-in replacements,
+with the same user interface, but improved image quality.
+(You may also wish to use the newer pnm2ppa.conf configuration
+file template).
+
+
+
+
Mandrake 7.0 and earlier has incompatible and non-functional
@@ -59,6 +72,7 @@
and appears to now have its own printer configuration tool, but still
includes pnm2ppa support in rhs-printfilters.
+
Next
Previous
diff --git a/docs/en/INSTALL.MANDRAKE.txt b/docs/en/INSTALL.MANDRAKE.txt
index caa49d0..0f9b1e2 100644
--- a/docs/en/INSTALL.MANDRAKE.txt
+++ b/docs/en/INSTALL.MANDRAKE.txt
@@ -1,35 +1,44 @@
PPA Printer-Support RPM Packages for MANDRAKE Linux distri-
butions.
The pnm2ppa project team ppa-rpms@users.sourceforge.net
- v0.1 Nov 11, 2000
+ v0.2 June 11, 2002
Information about using pnm2ppa with Mandrake. (Updated for
pnm2ppa-1.04 and later.)
- MMaannddrraakkee--ssppeecciiffiicc iissssuueess..
+ Mandrake-specific issues.
See the document INSTALL.REDHAT.html for installation and setup. That
document is written for Red Hat; note the Mandrake-specific
differences listed below,
+ To update pnm2ppa in any recent Mandrake release (7.2 or later) from
+ v1.04 to v1.10, the simplest procedure may be just to compile pnm2ppa
+ from tarball source and replace the Mandake binaries /usr/bin/pnm2ppa
+ and /usr/bin/calibrate_ppa with the new versions. They should
+ function as drop-in replacements, with the same user interface, but
+ improved image quality. (You may also wish to use the newer
+ pnm2ppa.conf configuration file template).
- +o Mandrake 7.0 and earlier has incompatible and non-functional
+
+
+ o Mandrake 7.0 and earlier has incompatible and non-functional
pnm2ppa support which must be replaced. Please use printtool to
delete any installed PPA printers BEFORE upgrading rhs-
printfilters. (If you forget to do this, and printtool will not
start after the update, delete or move your /etc/printcap file.)
Install the pnm2ppa RPM package. Then update rhs-printfilters with
rhs-printfilters-1.58-4ppa5mdk.i386.rpm from
- http://sourceforge.net/projects/pnm2ppa. (Do NNOOTT use rhs-
+ http://sourceforge.net/projects/pnm2ppa. (Do NOT use rhs-
printfilters-1.57-4ppa4.i386.rpm which is for RedHat systems only.)
- +o Mandrake-7.1 supplies a pnm2ppa RPM and has support for it in rhs-
+ o Mandrake-7.1 supplies a pnm2ppa RPM and has support for it in rhs-
printfilters. Mandrake 7.1 has a configuration tool DrakConf for
setting up printers, which may be an interface to printtool. Some
users have reported difficulties with this. In that case, just use
printtool to configure the printer.
- +o Mandrake-7.2 does not have a separate pnm2ppa RPM package, but has
+ o Mandrake-7.2 does not have a separate pnm2ppa RPM package, but has
added pnm2ppa to the ghostscript RPM package. This creates
difficulties for updating pnm2ppa with the RPM package from
http://sourceforge.net/projects/pnm2ppa. You will get reported
@@ -42,25 +51,3 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/docs/en/INSTALL.REDHAT.html b/docs/en/INSTALL.REDHAT.html
index f3715f3..4381495 100644
--- a/docs/en/INSTALL.REDHAT.html
+++ b/docs/en/INSTALL.REDHAT.html
@@ -1,7 +1,7 @@
-
+
PPA Printer-Support RPM Packages for Red Hat Linux and Compatible Distributions
@@ -14,41 +14,50 @@
PPA Printer-Support RPM Packages for Red Hat Linux and Compatible Distributions
v0.27, Nov 11, 2000
-
+ppa-rpms@users.sourceforge.netv0.30, July 9, 2002
+Information and installation instructions
to accompany pnm2ppa packages for Red Hat Linux available at
http://sourceforge.net/projects/pnm2ppa
-(Updated for pnm2ppa-1.04 and later.)
+(Updated for pnm2ppa-1.10 and Red Hat 6.2 or later.)
See the "Troubleshooting" section at the end of
this document for
fixes to some reported problems
-
Overview of HP's PPA DeskJet Printers.
+
Overview of HP's PPA DeskJet Printers.
Most of Hewlett-Packard's DeskJet(tm) printers use the PCL3 command language,
-and are currently supported by Ghostscript drivers. However, a few models,
+and are currently supported by Ghostscript drivers. However, a few legacy
+models,
namely
-
DeskJet 710C Series: HP DeskJet 710C, 712C
-
DeskJet 720C Series: HP DeskJet 720C, 722C
+
DeskJet 710C Series: HP DeskJet 710C, 712C
+(discontinued)
+
DeskJet 720C Series: HP DeskJet 720C, 722C
+(discontinued)
DeskJet 820C Series: HP DeskJet 820Cxi, 820Cse
(discontinued)
DeskJet 1000C Series: HP DeskJet 1000Cxi, 1000Cse
(discontinued)
+
feature "Host-based" printing,
and use HP's proprietary
PPA (Printer Performance Architecture) protocol,
instead of PCL. The two models in each series are physically
identical;
-they just come with different bundled Windows software.
-The 820C and 1000C series are discontinued at this time (January 2000).
+they just came with different bundled Windows software.
+All PPA printers are now discontinued from HP's product lines,
+but may still be found as second-hand legacy items.
PPA printers rely on software running on the
host CPU to carry out the low-level processing
of printer output that would be done by hardware in
a standard PCL printer. The relation of PPA printers to PCL printers
is analogous to the relation between "Winmodems" and true modems.
-
Unfortunately, HP only supplies Windows software drivers for PPA printers,
+Presumably, the idea at the time was that this would allow cheaper hardware
+to be used, but the decline in hardware prices probably meant that
+the savings were not significant, and PPA printing seems to have been
+abandoned.
+
Unfortunately, HP only supplied Windows software drivers for PPA printers,
and have indicated that it is unlikely that
they will ever make the proprietary PPA specs public.
This is apparently because of concerns that
@@ -59,48 +68,52 @@
damage the printer by sending it
bad sequences of PPA commands, which is not the case for PCL commands,
and it seems that HP do not wish to take any responsibility for such damage by
-encouraging unofficial PPA programming.)
-
In fact,
-the decline in hardware component prices has meant that the anticipated
-cost-savings through using host-based PPA instead of printer-based PCL
-are less than expected, and two of the PPA printer series
-(820C, 1000C) have been phased out, and replaced by similar PCL printers
-in HP's product line. The 710C and 720C series are still being sold
-at this time of writing. All other currently-offered
-DeskJet models appear to be standard PCL3
-printers.
-
-
Many Linux users may have inadvertently purchased PPA DeskJet models,
-mistaking them for PCL3 DeskJets, for which independently-produced
-Linux drivers have long
-been available. Fortunately, a reverse engineering effort,
+encouraging unofficial PPA programming.)
+
In the past, Linux users often inadvertently purchased PPA DeskJet models,
+mistaking them for PCL3 DeskJets, which have traditionally
+been well-supported
+by Linux drivers.
+Fortunately, a reverse engineering effort,
started in 1998 by Tim Norman,
-http://www.normsoft.com/ppa
+and continued by the pnm2ppa project at
+http://pnm2ppa.sourceforge.net,
and
-http://pnm2ppa.sourceforge.net,
-and continued by the pnm2ppa project at
http://sourceforge.net/projects/pnm2ppa
has managed to produce drivers that provide basic printing
functionality for these PPA printers under Linux and other
-Unices.
-
-
-
-
The pnm2ppa driver for color printing with PPA printers.
+Unices. While HP have recently begun to release their own Linux
+drivers for PCL3 DeskJets, they have not included drivers for their legacy
+PPA printers in this effort.
+
The pnm2ppa driver has been stable since v1.04, released
+October 2000, with no known reproducible bugs, except that image printing
+quality was not so good. This version has been distributed with
+Red Hat, and other Linux distributions. v1.10, released July 2002,
+contains a lot of changes that improve image quality, in particular
+by improved bidirectional printing, and
+always printing black on top of color.
+
A better improvement would be for someone to make a PPA backend to
+gimp-print, using
+pnm2ppa as a guide for how to send data to PPA printers.
+But, since PPA printers are now "legacy" hardware, and
+pnm2ppa appears to
+work fine for most printing tasks, it is unlikely that any new developers will
+be interested in doing this, and there is currently no further development
+anticipated. The project is currently in "low-maintenance mode".
+
+
The pnm2ppa driver for color printing with PPA printers.
Color printing with PPA printers is supported by the
pnm2ppa driver which is the successor to the older
black-and-white-only driver
-pbm2ppa-0.8.6 developed by Tim Norman.
-
pnm2ppa
-can translate portable anymap (pnm)
+translates portable anymap (pnm)
format images into a stream of PPA instructions which can be sent to the
printer. In the driver name,
"pnm" stands for the superset
of three image formats:
ppm (portable "pixmap" format for color images),
pgm (portable "greymap" format for greyscale images),
-and pbm (portable "bitmap" format for black and white images).
+and pbm (portable "bitmap" format for black and white images).
Ghostscript has a number of "output devices" that
produce pnm format output from postscript or pdf input.
These come in plain (text) and raw
@@ -119,9 +132,9 @@
The last two output devices are switches that try to analyze the
image, and select an appropriate format; however, they are not
recommended for routine use, as they may inconsistently choose the format.
-The ghostscript-5.10
-package supplied with Red Hat 6.x distributions provides all these
-devices; older versions may not. To see the list of available
+The ghostscript
+packages supplied with all recent Red Hat distributions provides all these
+devices. To see the list of available
ghostscript output devices, type the command line
@@ -131,14 +144,14 @@
if the required ppmraw or
pbmraw devices are not shown, you will have to upgrade your
-version of ghostscript.
+version of ghostscript.
The data must be streamed directly from ghostscript to
pnm2ppa to the (local) printer without being
stored in any intermediate
file: one ppm-format (color) US Letter size page is represented
by 3x5100x6600 Bytes (100MB) in binary format and four times this amount in
-text format.
-
+text format.
+
An example of
a command line for printing a postscript
file file.ps using gs (ghostscript) and pnm2ppa is
@@ -158,87 +171,97 @@
The pnm2ppa option --eco specifies "EconoFast"
mode, for a lower quality output which uses less ink, and prints faster,
and -v 720 specifies the PPA printer as belonging
-to the DeskJet 720C series.
+to the DeskJet 720C series.
+
+
pnm2ppa expects that the input resolution is 600dpi
+(or 300dpi if it is called with the pnm2ppa --dpi300 ...option).
+This corresponds to the gs -r600 ... or
+gs -r300 ... ghostscript options.
+If other higher/lower input resolutions are used, the size of
+the printed image will be larger/smaller, provided it is
+within the printer's allowed size range.
+
+
Obviously, it would be impractical to type such a command each time
-one wished to print something, so in addition to the pnm2ppa
-driver itself, an enhanced version of Red Hat's rhs-printfilters
-RPM package is provided; after this is installed, the PPA printer
-can be managed like other standard printers with the Red Hat
-printtool utility. The postscript file can then be printed with
+one wished to print something, and since RedHat 6.2, printfilter
+support for pnm2ppa is built into Red Hat's printer
+configuration scheme, so after configuration,
the simple command
lpr file.ps
-
-
-
However, if you wish to print to paper sizes supported by ghostscript,
-but not supported by the Red Hat printtool utility, you can
+
+should successfully print a postscript file.
+However, in case you wish to check if something
+is misconfigured in the print filters, you can use a script like the
+above one to bypass them and check that the printer is working.
+
+
Also, if you wish to print to paper sizes supported by ghostscript,
+but not supported by the Red Hat Printer configuration utilities, you can
use scripts like the one above.
The HP 710C, 720C, and 820C series support paper sizes from
3"x3" to 8.5"x14", while the 1000C
supports 4"x6" to 13"x19".
The latest version at the time
of writing is
-pnm2ppa-1.04-1.i386.rpm, and is built on
-Red Hat 6.2. If you are running a different release
+pnm2ppa-1.10-1rh7x.i386.rpm, and is built on
+Red Hat 7.3, or
+pnm2ppa-1.10-1rh62.i386.rpm, built on
+Red Hat 6.2.
+If you are running a different release
of Red Hat (or a different Linux distribution)
you may need to download and rebuild the source RPM
-pnm2ppa-1.04-1.src.rpm instead:
-
(You must be root to do this, and have the necessary
compilers installed; on Red Hat, the rebuilt binary RPM will be created in
-the directory /usr/src/redhat/RPMS/i386/.)
+the directory /usr/src/redhat/RPMS/i386/.)
Red Hat 6.2 and later also includes support for configuring your
-printer to use pnm2ppa using printtool
-and rhs-printfilters.
-If you are using Red Hat 6.1 and earlier,you will need to
-update the rhs-printfilters that came with the distribution
-to the
-rhs-printfilters-1.57-4ppa4.i386.rpm also available at
-http://sourceforge.net/projects/pnm2ppa.
-(This is designed to work only with printtool-3.43 and earlier.)
-
-
Note: If you are using Red Hat 6.2, you may wish to update the
-print filter support that it comes with. The pnm2ppa-1.04-1
+printer to use pnm2ppa.
+(Information necessary for configuring
+pnm2ppa on older Red Hat releases has been removed from
+this document; for this, see the documentation that came with
+pnm2ppa-1.04, or update your RedHat distribution.)
+Note: If you are still using Red Hat 6.2, you may wish to update the
+print filter support for pnm2ppa that comes with it.
+The pnm2ppa-1.10-1rh62*
RPM package supplies the necessary files that you can use.
After installing this RPM, see
-/usr/lib/rhs/rhs-printfilters/README.ppa for details.
-
-
Installing the pnm2ppa RPM package and setting up the PPA printer.
+/usr/lib/rhs/rhs-printfilters/README.ppa for details.
+
+
Installing the pnm2ppa RPM package and setting up the PPA printer.
To install the RPM package, you must log in as the system administrator,
-root.
+root.
Now begin the installation. First install the pnm2ppa RPM:
-rpm -Uvh pnm2ppa-1.04-1.i386.rpm
-
-
-
-The pnm2ppa executable gets installed in /usr/bin/.
-
If you are using a 2.2.x kernel,
-(e.g. Red Hat 6.x)
-it will be able to autodetect
+rpm -Uvh pnm2ppa-1.10-1*.i386.rpm
+
+
+
+The pnm2ppa executable gets installed in /usr/bin/.
+
The Linux kernel will be able to autodetect
IEEE-1284 devices like PPA printers, provided they are attached
to the parallel port with a bidirectional IEEE-1284 cable. (If your
printer works under Windows, you have the correct cable.)
-(Note that older (2.0.x) kernels do not have this autoprobe facility.)
A script detect_ppa is provided by the pnm2ppa
RPM: just type
@@ -248,17 +271,6 @@
to confirm that your Printer is found.
-
It is possible (especially on Red Hat 6.1) that you will have to add
-a line
-
-
-alias parport_lowlevel parport_pc
-
-
-
-to the file /etc/conf.modules for the printer to be found (this is
-a parallel port recognition issue, not specific to PPA printers.
-and a known "gotcha" on Red Hat 6.1).
A typical message from the printer, which will
be displayed if autodetection is successful, is:
@@ -272,16 +284,15 @@
A list of PPA printers found, and the parallel ports to which they are
-attached, will also be shown.
-
+attached, will also be shown.
+
At this point it is useful to test that your printer is working, by
printing a test page using the supplied script test_ppa
which the RPM has installed. You will need to know your
printer model (710, 712, 720, 722, 820, 1000), your paper size
(letter, legal, a4) and the printer port the printer is attached to.
If it is attached to the primary parallel port, this is
-/dev/lp1 under older 2.0.x kernels, and (usually)
-/dev/lp0 under newer 2.2.x kernels, as in Red Hat 6.x.
+(usually) /dev/lp0.
Type
@@ -297,49 +308,56 @@
Tip:
The test_ppa script
-does not use the print filters that
-will be installed by the rhs-printfilters RPM, so it is
+does not use the Red Hat print filters, so it is
useful when troubleshooting, for testing if any printing problems are
associated with the basic printer installation, or with the
configuration of the print filters.
-
-
Installing the PPA-enhanced rhs-printfilters RPM package (if needed).
-
-
-
This step is NOT needed on Red Hat 6.2 or later.
-
-
The rhs-printfilters rpm distributed with
-Red Hat 6.1 does not support pnm2ppa,
-If you use an older distribution, you will first have to replace their
-rhs-printfilters RPM with the PPA-enhanced version from the
-pnm2ppa project.
-
Once you have confirmed you have a working printer, install the
-RPM rhs-printfilters-1.57-4ppa4.i386.rpm
-
-
-rpm -Uvh rhs-printfilters-1.57-4ppa4.i386.rpm
-
-
-
Configuring the print filters with printtool.
-
Now start the "Red Hat Linux Print System Manager"
+
+
+
Configuring the print filters.
+
Note: Red Hat 7.3 now features either CUPS or LPRng printer management.
+The configuration tools should be able to configure pnm2ppa,
+using the information about it taken from the Linux Printer Database.
+Apart from the addition of a new --dpi300 option
+to accept 300dpi input (useful for printing PNM output from 300dpi scanners),
+there have been no changes in the pnm2ppa command line since the pnm2ppa-1.0
+release, so the configuration scripts are stable. (They
+can only use the default 600dpi input mode.)
+
Since Red Hat 7.1, there is a graphical
+printer configuration utility printconf-gui. In Red Hat 6.2 and
+7.0, the older configuration utility called printtool is used.
+In either case,
+start the "Red Hat Linux Print System Manager"
(as root) to
configure the printer, either
-by clicking on the printer icon in Red Hat's "control-panel", or just
-typing
+by clicking on the printer icon in Red Hat's "control-panel",
+or just typing
printtool
-In the Print System Manager window, click on Add, then
+which also starts printconf-gui in the newer Red Hat releases.
+
+
Configuring the print filters with the Red Hat 6.2/7.0 printtool
+
(Skip this section unless you are still using Red Hat 6.2 or 7.0)
+
The following description is for the older printtool that
+is used by Red Hat 6.2/7.0. The printer configuration utility
+printconf-gui for Red Hat 7.1 and later
+is a little different, as it is based on the foomatic printer
+configuration database which contains entries for pnm2ppa
+(but not the older pbm2ppa). You should be able to easily figure out
+what to do: it can configure all pnm2ppa command-line options in the
+Driver Options screen.
+
In the Red Hat 6.2/7.0 Print System Manager window, click on Add, then
in the "Add a Printer Entry", select Local Printer, and
click Ok. Hopefully, the port on which the printer is attached
will be listed as "Detected" (if not,
fix the problem before continuing, perhaps by
adding the line "alias parport_lowlevel parport_pc"
-to /etc/conf.modules), as mentioned above.
+to /etc/conf.modules).
You will now have to "edit
the local printer entry" for the PPA printer. Click on
Select to chose the "Input filter".
@@ -349,20 +367,10 @@
HP DeskJet 1000 series (PPA) (for 1000Cse, 1000Cxi models)
HP DeskJet 710/720 series (PPA) (for 710C, 712C, 720C, 722C models)
-
HP DeskJet 820 series (PPA) (for 820Cse, 820Cxi models)
-
-
If these entries do not show up, it may be because the older
-rhs-printfilters package that you updated did not allow
-the printer database /usr/lib/rhs/rhs-printfilters/printerdb
-to be replaced. Try deleting or renaming the printerdb
-file, and then reinstall
-the PPA-enhanced rhs-printfilters RPM using
-"rpm --force -Uvh rhs-printfilters*"
-
-
-
-
-
Select the appropriate
+
HP DeskJet 820 series (PPA) (for 820Cse, 820Cxi models)
+
+
+Select the appropriate
entry for your printer model. You will then be presented with
various options:
@@ -452,23 +460,23 @@
When you have made your choices, click on Ok to
save your selections and close the "Configure Filter" screen,
and then click on OK to close the "Edit Local Printer Entry"
-screen.
+screen.
You are now back in the "Red Hat Print System Manager" screen;
highlight the printer you just configured, and, in the Tests
menu, choose Print Postscript test page to print a test page using
the Red Hat print filters. If this printed correctly, your
print system is set up to use the PPA printer, just like any of the other
-printers that the Red Hat print filters support.
-
-
-
-
Configuring pnm2ppa.conf and calibrating the printer.
+printers that the Red Hat print filters support.
+
+
+
+
Configuring pnm2ppa.conf and calibrating the printer.
A number of printer parameters are set to reasonable default values
for each of the printer models, but you may wish to "fine tune"
or calibrate your printer. The default values can be overridden
by entries in the configuration files, which by default are
/etc/pnm2ppa.conf and /etc/pbm2ppa.conf.
-At 600dpi, one pixel is 1/600 inch.
+At 600dpi, one pixel is 1/600 inch.
The user-adjustable parameters are:
verbose 1 and silent 1. These control
@@ -568,36 +576,57 @@
can be used to switch of the various inks; this can be useful
in troubleshooting and debugging pnm2ppa.
+
Use test_ppa to print various test pages
-or calibration patterns to adjust the offsets.
+or calibration patterns to adjust the offsets.
If you wish to specify these
parameters using the command-line options
-described above, some of them can be
+described above, in Red Hat 6.2/7.0 some of them can be
entered in the "extra GS options" box using the Print System Manager
(printtool), as described above.
-
-
-
Utility programs for the printer.
+In Red Hat 7.1 and later, all command-line options can be set using the new
+printconf-gui utility.
+
+
Utility programs for the printer.
HP's Windows software provides a utility program
that sends PPA commands to tell the printer to perform
-taks like cleaning the printheads, etc. The codes for some
-of these functions have already been reverse engineered.
-There are proposals to add support for PPA printers to the
+tasks like cleaning the printheads, etc.
+
On Red Hat Linux, You can use test_ppa
+(which acts as a command-line front-end for
+calibrate_ppa) to print head-cleaning patterns.
+
There is a graphical (gtk-based) tool
+written by Javier Sedano
+for creating
+a pnm2ppa.conf file and acting as a front end to
+calibrate_ppa.
+This is called ppaSet, and a beta version of it can be found
+in the same place as the pnm2ppa-1.10 distribution
+at
+http://sourceforge.net/projects/pnm2ppa
+
There was also at one time a proposal to add support for PPA printers to the
PUP (Printer Utility Program) utility, which is
also a project at
http://www.sourceforge.net.
However, as of the time of writing, no PUP support
-for PPA printers is available (volunteers, anyone?).
-
-
Troubleshooting
+for PPA printers is available.
+
+
Troubleshooting
The first thing to do is to look at the messages from pnm2ppa
in the system log to see what is happening, whether pnm2ppaactually received any input, and if it was valid.
(You may need to enable system log messages in
/etc/pnm2ppa.conf, see above.)
Maybe ghostscript failed to convert your postscript file into
-PNM format: this is not a pnm2ppa problem!
-Here are suggestions for dealing with problems that you may encounter.
+PNM format: in that case the system log reports
+"Fatal Error! Input image (pnm2ppa) is not a PNM image".
+(note: when this occured, older versions of pnm2ppa reported
+"Input image is not a supported PNM format" which
+may have been confusing).
+This is because the input received by pnm2ppa was not a valid
+PNM image, but instead ghostscript failed to produce any
+PNM output at all, and its only output was probably just an error message.
+This is not a pnm2ppa problem!
+
Here are suggestions for dealing with other problems that you may encounter.
Printing fails in the middle of a print run, perhaps
when a figure embedded in the document is printing (in the latest
@@ -606,43 +635,13 @@
reports that read_line could not read the image, and found EOF
(end-of-file). This probably
means that ghostscript's "ppmraw" or
-"pgmraw" output device failed for some reason,
-usually leaving a core dump, without completing the
-translation of the postscript to a pnm format.
+"pgmraw" output device started correctly, but
+failed for some reason before finishing the image conversion
+from postscript to PNM format, usually leaving a core dump.
(This has been seen to happen in ghostscript 5.10 ;
upgrading to ghostscript 5.50 solved the problem.) If you cannot
upgrade, try printing the document
in black-and-white using the ghostscript "pbmraw" output device.
-
The test_ppa script works,
-but you can't get printtool to make the printfilters work.
-
-You installed pnm2ppa-1.0 and the PPA-enhanced
-rhs-printfilters (earlier than v. 1.61) from the pnm2ppa
-SourceForge page. You are using printtool v. 3.43 or earlier
-and are probably a Mandrake user.
-Solution: (a) use printtool to uninstall the PPA printer;
-(b) delete (or rename) the printer database
-/usr/lib/rhs/rhs-printfilters/printerdb, and reinstall
-the rhs-printfilters RPM using the
-"rpm --force ... "
-option; (c) use printtool to add the
-PPA printer again.
-(Your previously-installed rhs-printfilters may have
-resisted replacement of its printerdb).
-
You upgraded your RedHat (or compatible) Linux distribution
-and your printfilters no longer work.
-You used to use a PPA-enhanced rhs-printfilters from the
-pnm2ppa SourceForge site. You
-upgraded your distribution to one using printtool v 3.44 or later
-(e.g. RedHat 6.2).
-Solution: Make sure that
-rhs-printfilters has been updated to a version
-1.61 or greater that came with your
-upgraded distribution.
-Use printtool to delete, and then add the
-PPA printer
-This will create a new printer configuration compatible
-with your upgraded distribution.
You printed an image file using a "high quality"
printer setting, but it has visible horizontal lines
on it and printing under Windows(tm) 9x doesn't
@@ -650,11 +649,8 @@
These are probably "swath boundaries",
showing the junction between different sweeps of the print head.
Solution: using unidirectional printing (PPA option --uni,
-or unimode 1 in /etc/pnm2ppa.conf) helps a little, but
-this problem requires an extensive
-rewrite of part of pnm2ppa (cutswath.c)
-for a satisfactory solution. (Volunteers welcome - see the TODO file in the
-pnm2ppa docs (/usr/doc/pnm2ppa*/TODO)!)
+or unimode 1 in /etc/pnm2ppa.conf) helps a little.
+this problem is fixed in the pnm2ppa-1.10 release
"Flashing light syndrome ".
Your printer usually works, but you have found that some particular
documents cause the printer to fail, and the lights on its panel
@@ -683,25 +679,27 @@
/etc/pnm2ppa.gamma. See the file
COLOR.html (or COLOR.txt) for more information.
There are three mailing lists,
-ppa.announce (announcements),
-ppa.users (users helping users)
-and ppa.devel (developers).
+ppa-rpms@users.sourceforge.net
+
There are three mailing lists,
+pnm2ppa-announce@lists.sourceforge.net (announcements),
+pnm2ppa-users@lists.sourceforge.net (users helping users)
+and pnm2ppa-devel@lists.sourceforge.net (developers).
You can subscribe to them, or browse their
archives, at
-http://pnm2ppa.sourceforge.net/maillist.htm.
-
To contact the developers, subscribe to ppa.devel and post a message.
+http://sourceforge.net/projects/pnm2ppa.
+(The older pnm2ppa mailing lists died with the ListBot service)
+
To contact the developers, subscribe to ppa.devel and post a message.
There are Public Forums for posting questions
and comments
at
http://sourceforge.net/projects/pnm2ppa
(but whether you get any help from these, depends on
-whether anyone is reading them).
-
+whether anyone is reading them (unlikely!)).
+
Next
Previous
diff --git a/docs/en/INSTALL.REDHAT.txt b/docs/en/INSTALL.REDHAT.txt
index 29e2c42..34d8b21 100644
--- a/docs/en/INSTALL.REDHAT.txt
+++ b/docs/en/INSTALL.REDHAT.txt
@@ -1,41 +1,45 @@
PPA Printer-Support RPM Packages for Red Hat Linux and Com-
patible Distributions
The pnm2ppa project team ppa-rpms@users.sourceforge.net
- v0.27, Nov 11, 2000
+ v0.30, July 9, 2002
Information and installation instructions to accompany pnm2ppa pack-
ages for Red Hat Linux available at http://sourceforge.net/pro-
- jects/pnm2ppa (Updated for pnm2ppa-1.04 and later.) See the "Trou-
- bleshooting" section at the end of this document for fixes to some
- reported problems
-
- OOvveerrvviieeww ooff HHPP''ss PPPPAA DDeesskkJJeett PPrriinntteerrss..
+ jects/pnm2ppa (Updated for pnm2ppa-1.10 and Red Hat 6.2 or later.)
+ See the "Troubleshooting" section at the end of this document for
+ fixes to some reported problems
+
+ Overview of HP's PPA DeskJet Printers.
Most of Hewlett-Packard's DeskJet(tm) printers use the PCL3 command
language, and are currently supported by Ghostscript drivers.
- However, a few models, namely
-
- +o _D_e_s_k_J_e_t _7_1_0_C _S_e_r_i_e_s: HP DeskJet 710C, 712C
-
- +o _D_e_s_k_J_e_t _7_2_0_C _S_e_r_i_e_s: HP DeskJet 720C, 722C
-
- +o _D_e_s_k_J_e_t _8_2_0_C _S_e_r_i_e_s: HP DeskJet 820Cxi, 820Cse _(_d_i_s_c_o_n_t_i_n_u_e_d_)
-
- +o _D_e_s_k_J_e_t _1_0_0_0_C _S_e_r_i_e_s: HP DeskJet 1000Cxi, 1000Cse _(_d_i_s_c_o_n_t_i_n_u_e_d_)
-
- feature "Host-based" printing, and use HP's proprietary PPA (_P_r_i_n_t_e_r
- _P_e_r_f_o_r_m_a_n_c_e _A_r_c_h_i_t_e_c_t_u_r_e) protocol, instead of PCL. The two models
- in each series are physically identical; they just come with different
- bundled Windows software. The 820C and 1000C series are discontinued
- at this time (January 2000).
+ However, a few legacy models, namely
+
+ o DeskJet 710C Series: HP DeskJet 710C, 712C (discontinued)
+
+ o DeskJet 720C Series: HP DeskJet 720C, 722C (discontinued)
+
+ o DeskJet 820C Series: HP DeskJet 820Cxi, 820Cse (discontinued)
+
+ o DeskJet 1000C Series: HP DeskJet 1000Cxi, 1000Cse (discontinued)
+
+ feature "Host-based" printing, and use HP's proprietary PPA (Printer
+ Performance Architecture) protocol, instead of PCL. The two models
+ in each series are physically identical; they just came with different
+ bundled Windows software. All PPA printers are now discontinued from
+ HP's product lines, but may still be found as second-hand legacy
+ items.
PPA printers rely on software running on the host CPU to carry out the
low-level processing of printer output that would be done by hardware
in a standard PCL printer. The relation of PPA printers to PCL
printers is analogous to the relation between "Winmodems" and true
- modems.
-
- Unfortunately, HP only supplies Windows software drivers for PPA
+ modems. Presumably, the idea at the time was that this would allow
+ cheaper hardware to be used, but the decline in hardware prices
+ probably meant that the savings were not significant, and PPA printing
+ seems to have been abandoned.
+
+ Unfortunately, HP only supplied Windows software drivers for PPA
printers, and have indicated that it is unlikely that they will ever
make the proprietary PPA specs public. This is apparently because of
concerns that publication of the specs might reveal crucial details of
@@ -46,65 +50,72 @@
responsibility for such damage by encouraging unofficial PPA
programming.)
- In fact, the decline in hardware component prices has meant that the
- anticipated cost-savings through using host-based PPA instead of
- printer-based PCL are less than expected, and two of the PPA printer
- series (820C, 1000C) have been phased out, and replaced by similar PCL
- printers in HP's product line. The 710C and 720C series are still
- being sold at this time of writing. AAllll ootthheerr ccuurrrreennttllyy--ooffffeerreedd
- DDeesskkJJeett mmooddeellss aappppeeaarr ttoo bbee ssttaannddaarrdd PPCCLL33 pprriinntteerrss..
-
-
- Many Linux users may have inadvertently purchased PPA DeskJet models,
- mistaking them for PCL3 DeskJets, for which independently-produced
- Linux drivers have long been available. Fortunately, a reverse
- engineering effort, started in 1998 by Tim Norman,
- http://www.normsoft.com/ppa and http://pnm2ppa.sourceforge.net, and
- continued by the _p_n_m_2_p_p_a project at
+ In the past, Linux users often inadvertently purchased PPA DeskJet
+ models, mistaking them for PCL3 DeskJets, which have traditionally
+ been well-supported by Linux drivers. Fortunately, a reverse
+ engineering effort, started in 1998 by Tim Norman, and continued by
+ the pnm2ppa project at http://pnm2ppa.sourceforge.net, and
http://sourceforge.net/projects/pnm2ppa has managed to produce drivers
that provide basic printing functionality for these PPA printers under
- Linux and other Unices.
- TThhee ppnnmm22ppppaa ddrriivveerr ffoorr ccoolloorr pprriinnttiinngg wwiitthh PPPPAA pprriinntteerrss..
+ Linux and other Unices. While HP have recently begun to release their
+ own Linux drivers for PCL3 DeskJets, they have not included drivers
+ for their legacy PPA printers in this effort.
+
+ The pnm2ppa driver has been stable since v1.04, released October
+ 2000, with no known reproducible bugs, except that image printing
+ quality was not so good. This version has been distributed with Red
+ Hat, and other Linux distributions. v1.10, released July 2002,
+ contains a lot of changes that improve image quality, in particular by
+ improved bidirectional printing, and always printing black on top of
+ color.
+
+ A better improvement would be for someone to make a PPA backend to
+ gimp-print, using pnm2ppa as a guide for how to send data to PPA
+ printers. But, since PPA printers are now "legacy" hardware, and
+ pnm2ppa appears to work fine for most printing tasks, it is unlikely
+ that any new developers will be interested in doing this, and there is
+ currently no further development anticipated. The project is
+ currently in "low-maintenance mode".
+
+
+ The pnm2ppa driver for color printing with PPA printers.
Color printing with PPA printers is supported by the pnm2ppa driver
which is the successor to the older black-and-white-only driver
pbm2ppa-0.8.6 developed by Tim Norman.
-
- pnm2ppa can translate _p_o_r_t_a_b_l_e _a_n_y_m_a_p (_p_n_m) format images into a
- stream of PPA instructions which can be sent to the printer. In the
- driver name, "_p_n_m" stands for the superset of _t_h_r_e_e image formats: _p_p_m
- (portable "pixmap" format for color images), _p_g_m (portable "greymap"
- format for greyscale images), and _p_b_m (portable "bitmap" format for
+ pnm2ppa translates portable anymap (pnm) format images into a stream
+ of PPA instructions which can be sent to the printer. In the driver
+ name, "pnm" stands for the superset of three image formats: ppm
+ (portable "pixmap" format for color images), pgm (portable "greymap"
+ format for greyscale images), and pbm (portable "bitmap" format for
black and white images).
Ghostscript has a number of "output devices" that produce pnm format
- output from postscript or pdf input. These come in _p_l_a_i_n (text) and
- _r_a_w (binary) variants. While pnm2ppa can now interpret both plain and
+ output from postscript or pdf input. These come in plain (text) and
+ raw (binary) variants. While pnm2ppa can now interpret both plain and
raw pnm formats, there is no point in using the inefficient plain
- formats: _a_l_w_a_y_s use the "raw" output devices, which are:
-
- +o _p_p_m_r_a_w - raw pixmap format (color images);
-
- +o _p_g_m_r_a_w - raw greymap format (greyscale images);
-
- +o _p_b_m_r_a_w - raw bitmap format (black and white images);
-
- +o _p_n_m_r_a_w - selects between ppm, pgm, and pbm raw formats;
-
- +o _p_g_n_m_r_a_w - selects between pgm and pbm raw formats.
+ formats: always use the "raw" output devices, which are:
+
+ o ppmraw - raw pixmap format (color images);
+
+ o pgmraw - raw greymap format (greyscale images);
+
+ o pbmraw - raw bitmap format (black and white images);
+
+ o pnmraw - selects between ppm, pgm, and pbm raw formats;
+
+ o pgnmraw - selects between pgm and pbm raw formats.
The last two output devices are switches that try to analyze the
image, and select an appropriate format; however, they are not
recommended for routine use, as they may inconsistently choose the
- format. The ghostscript-5.10 package supplied with Red Hat 6.x
- distributions provides all these devices; older versions may not.
- To see the list of available ghostscript output devices, type the
- command line
+ format. The ghostscript packages supplied with all recent Red Hat
+ distributions provides all these devices. To see the list of
+ available ghostscript output devices, type the command line
gs --help
-
@@ -127,9 +138,8 @@
-
(all on a single line). In this example the paper size is explicitly
- given to gs as _U_S _L_e_t_t_e_r (8.5"x11") size (letter); pnm2ppa no longer
+ given to gs as US Letter (8.5"x11") size (letter); pnm2ppa no longer
needs to be told what the paper size is, and will read it from the
gs output (and check that it is a permitted size for the printer
type). The pnm2ppa option --eco specifies "EconoFast" mode, for a
@@ -137,41 +147,49 @@
720 specifies the PPA printer as belonging to the DeskJet 720C series.
+ o pnm2ppa expects that the input resolution is 600dpi (or 300dpi if
+ it is called with the pnm2ppa --dpi300 ...option). This
+ corresponds to the gs -r600 ... or gs -r300 ... ghostscript
+ options. If other higher/lower input resolutions are used, the
+ size of the printed image will be larger/smaller, provided it is
+ within the printer's allowed size range.
+
Obviously, it would be impractical to type such a command each time
- one wished to print something, so in addition to the pnm2ppa driver
- itself, an enhanced version of Red Hat's rhs-printfilters RPM package
- is provided; after this is installed, the PPA printer can be managed
- like other standard printers with the Red Hat printtool utility. The
- postscript file can then be printed with the simple command
+ one wished to print something, and since RedHat 6.2, printfilter
+ support for pnm2ppa is built into Red Hat's printer configuration
+ scheme, so after configuration, the simple command
lpr file.ps
-
-
- +o _H_o_w_e_v_e_r_, _i_f _y_o_u _w_i_s_h _t_o _p_r_i_n_t _t_o _p_a_p_e_r _s_i_z_e_s _s_u_p_p_o_r_t_e_d _b_y
- _g_h_o_s_t_s_c_r_i_p_t_, _b_u_t _n_o_t _s_u_p_p_o_r_t_e_d _b_y _t_h_e _R_e_d _H_a_t printtool utility,
+ should successfully print a postscript file. However, in case you
+ wish to check if something is misconfigured in the print filters, you
+ can use a script like the above one to bypass them and check that the
+ printer is working.
+
+ o Also, if you wish to print to paper sizes supported by ghostscript,
+ but not supported by the Red Hat Printer configuration utilities,
you can use scripts like the one above. The HP 710C, 720C, and
820C series support paper sizes from 3"x3" to 8.5"x14", while the
1000C supports 4"x6" to 13"x19".
- AAvvaaiillaabbllee RRPPMM ppaacckkaaggeess..
-
- A RPM package for pnm2ppa is part of the Red Hat Linux distribution
- starting with Red Hat 6.2. You will also find a RPM package for the
- latest release of pnm2ppa at http://sourceforge.net/projects/pnm2ppa.
-
- The latest version at the time of writing is pnm2ppa-1.04-1.i386.rpm,
- and is built on Red Hat 6.2. If you are running a different
- release of Red Hat (or a different Linux distribution) you may need
- to download and rebuild the source RPM pnm2ppa-1.04-1.src.rpm instead:
-
-
- rpm --rebuild pnm2ppa-1.04-1.src.rpm
-
+ Available RPM packages. A RPM package for pnm2ppa is part of the
+ Red Hat Linux distribution starting with Red Hat 6.2. You will also
+ find a RPM package for the latest release of pnm2ppa at
+ http://sourceforge.net/projects/pnm2ppa.
+
+ The latest version at the time of writing is
+ pnm2ppa-1.10-1rh7x.i386.rpm, and is built on Red Hat 7.3, or
+ pnm2ppa-1.10-1rh62.i386.rpm, built on Red Hat 6.2. If you are running
+ a different release of Red Hat (or a different Linux distribution)
+ you may need to download and rebuild the source RPM
+ pnm2ppa-1.10-1.src.rpm instead:
+
+
+ rpm --rebuild pnm2ppa-1.10-1.src.rpm
@@ -180,21 +198,17 @@
directory /usr/src/redhat/RPMS/i386/.)
Red Hat 6.2 and later also includes support for configuring your
- printer to use pnm2ppa using printtool and rhs-printfilters. If you
- are using Red Hat 6.1 and earlier,you will need to update the rhs-
- printfilters that came with the distribution to the rhs-
- printfilters-1.57-4ppa4.i386.rpm also available at
- http://sourceforge.net/projects/pnm2ppa. (This is designed to work
- only with printtool-3.43 and earlier.)
-
-
- Note: If you are using Red Hat 6.2, you may wish to update the print
- filter support that it comes with. The pnm2ppa-1.04-1 RPM package
- supplies the necessary files that you can use. After installing this
- RPM, see /usr/lib/rhs/rhs-printfilters/README.ppa for details.
-
-
- IInnssttaalllliinngg tthhee pnm2ppa RPM package and setting up the PPA printer.
+ printer to use pnm2ppa. (Information necessary for configuring
+ pnm2ppa on older Red Hat releases has been removed from this document;
+ for this, see the documentation that came with pnm2ppa-1.04, or update
+ your RedHat distribution.) Note: If you are still using Red Hat 6.2,
+ you may wish to update the print filter support for pnm2ppa that comes
+ with it. The pnm2ppa-1.10-1rh62* RPM package supplies the necessary
+ files that you can use. After installing this RPM, see
+ /usr/lib/rhs/rhs-printfilters/README.ppa for details.
+
+
+ Installing the pnm2ppa RPM package and setting up the PPA printer.
To install the RPM package, you must log in as the system
administrator, root.
@@ -202,41 +216,25 @@
Now begin the installation. First install the pnm2ppa RPM:
- rpm -Uvh pnm2ppa-1.04-1.i386.rpm
-
+ rpm -Uvh pnm2ppa-1.10-1*.i386.rpm
The pnm2ppa executable gets installed in /usr/bin/.
- If you are using a 2.2.x kernel, (e.g. Red Hat 6.x) it will be able
- to autodetect IEEE-1284 devices like PPA printers, provided they are
- attached to the parallel port with a bidirectional IEEE-1284 cable.
- (If your printer works under Windows, you have the correct cable.)
- (Note that older (2.0.x) kernels do not have this autoprobe facility.)
- A script detect_ppa is provided by the pnm2ppa RPM: just type
+ The Linux kernel will be able to autodetect IEEE-1284 devices like
+ PPA printers, provided they are attached to the parallel port with a
+ bidirectional IEEE-1284 cable. (If your printer works under Windows,
+ you have the correct cable.) A script detect_ppa is provided by the
+ pnm2ppa RPM: just type
detect_ppa
-
- to confirm that your Printer is found.
-
- It is possible (especially on Red Hat 6.1) that you will have to add a
- line
-
-
- alias parport_lowlevel parport_pc
-
-
-
-
- to the file /etc/conf.modules for the printer to be found (this is a
- parallel port recognition issue, not specific to PPA printers. and a
- known "gotcha" on Red Hat 6.1). A typical message from the printer,
- which will be displayed if autodetection is successful, is:
+ to confirm that your Printer is found. A typical message from the
+ printer, which will be displayed if autodetection is successful, is:
CLASS:PRINTER;
@@ -247,7 +245,6 @@
-
A list of PPA printers found, and the parallel ports to which they are
attached, will also be shown.
@@ -257,13 +254,9 @@
has installed. You will need to know your printer model (710, 712,
720, 722, 820, 1000), your paper size (letter, legal, a4) and the
printer port the printer is attached to. If it is attached to the
- primary parallel port, this is /dev/lp1 under older 2.0.x kernels,
- and (usually) /dev/lp0 under newer 2.2.x kernels, as in Red Hat 6.x.
- Type
-
+ primary parallel port, this is (usually) /dev/lp0. Type
test_ppa
-
@@ -271,107 +264,107 @@
when prompted. You will then be asked whether to print a test page,
an offset calibration page, or an alignment calibration page, etc.
- +o _T_i_p_: _T_h_e test_ppa _s_c_r_i_p_t _d_o_e_s _n_o_t _u_s_e _t_h_e _p_r_i_n_t _f_i_l_t_e_r_s _t_h_a_t _w_i_l_l
- _b_e _i_n_s_t_a_l_l_e_d _b_y _t_h_e rhs-printfilters _R_P_M_, _s_o _i_t _i_s _u_s_e_f_u_l _w_h_e_n
- _t_r_o_u_b_l_e_s_h_o_o_t_i_n_g_, _f_o_r _t_e_s_t_i_n_g _i_f _a_n_y _p_r_i_n_t_i_n_g _p_r_o_b_l_e_m_s _a_r_e
- _a_s_s_o_c_i_a_t_e_d _w_i_t_h _t_h_e _b_a_s_i_c _p_r_i_n_t_e_r _i_n_s_t_a_l_l_a_t_i_o_n_, _o_r _w_i_t_h _t_h_e
- _c_o_n_f_i_g_u_r_a_t_i_o_n _o_f _t_h_e _p_r_i_n_t _f_i_l_t_e_r_s_.
-
-
- IInnssttaalllliinngg tthhee PPPPAA--eennhhaanncceedd rhs-printfilters RPM package (if needed).
-
-
- +o _T_h_i_s _s_t_e_p _i_s _N_O_T _n_e_e_d_e_d _o_n _R_e_d _H_a_t _6_._2 _o_r _l_a_t_e_r_.
-
- The rhs-printfilters rpm distributed with Red Hat 6.1 does not support
- pnm2ppa, If you use an older distribution, you will first have to
- replace their rhs-printfilters RPM with the PPA-enhanced version from
- the pnm2ppa project.
-
- Once you have confirmed you have a working printer, install the RPM
- rhs-printfilters-1.57-4ppa4.i386.rpm
-
-
- rpm -Uvh rhs-printfilters-1.57-4ppa4.i386.rpm
-
-
-
-
- CCoonnffiigguurriinngg tthhee pprriinntt ffiilltteerrss wwiitthh printtool.
-
- Now start the "_R_e_d _H_a_t _L_i_n_u_x _P_r_i_n_t _S_y_s_t_e_m _M_a_n_a_g_e_r" (as root) to
- configure the printer, either by clicking on the printer icon in Red
- Hat's "control-panel", or just typing
+ o Tip: The test_ppa script does not use the Red Hat print filters, so
+ it is useful when troubleshooting, for testing if any printing
+ problems are associated with the basic printer installation, or
+ with the configuration of the print filters.
+
+
+ Configuring the print filters.
+
+ Note: Red Hat 7.3 now features either CUPS or LPRng printer
+ management. The configuration tools should be able to configure
+ pnm2ppa, using the information about it taken from the Linux Printer
+ Database. Apart from the addition of a new --dpi300 option to accept
+ 300dpi input (useful for printing PNM output from 300dpi scanners),
+ there have been no changes in the pnm2ppa command line since the
+ pnm2ppa-1.0 release, so the configuration scripts are stable. (They
+ can only use the default 600dpi input mode.)
+
+ Since Red Hat 7.1, there is a graphical printer configuration utility
+ printconf-gui. In Red Hat 6.2 and 7.0, the older configuration
+ utility called printtool is used. In either case, start the "Red Hat
+ Linux Print System Manager" (as root) to configure the printer, either
+ by clicking on the printer icon in Red Hat's "control-panel", or just
+ typing
printtool
-
- In the Print System Manager window, click on _A_d_d, then in the "Add a
- Printer Entry", select _L_o_c_a_l _P_r_i_n_t_e_r, and click _O_k. Hopefully, the
- port on which the printer is attached will be listed as "Detected" (_i_f
- _n_o_t_, _f_i_x _t_h_e _p_r_o_b_l_e_m _b_e_f_o_r_e _c_o_n_t_i_n_u_i_n_g, perhaps by adding the line
- "alias parport_lowlevel parport_pc" to /etc/conf.modules), as men-
- tioned above. You will now have to "_e_d_i_t _t_h_e _l_o_c_a_l _p_r_i_n_t_e_r _e_n_t_r_y" for
- the PPA printer. Click on _S_e_l_e_c_t to chose the "Input filter". The
- _C_o_n_f_i_g_u_r_e _F_i_l_t_e_r screen will open. Among the many printer entries in
- the list "_P_r_i_n_t_e_r _T_y_p_e", you should find three entries
-
- +o HHPP DDeesskkJJeett 11000000 sseerriieess ((PPPPAA)) (for 1000Cse, 1000Cxi models)
-
- +o HHPP DDeesskkJJeett 771100//772200 sseerriieess ((PPPPAA)) (for 710C, 712C, 720C, 722C models)
-
- +o HHPP DDeesskkJJeett 882200 sseerriieess ((PPPPAA)) (for 820Cse, 820Cxi models)
-
- +o If these entries do not show up, it may be because the older rhs-
- printfilters package that you updated did not allow the printer
- database /usr/lib/rhs/rhs-printfilters/printerdb to be replaced.
- Try deleting or renaming the printerdb file, and then reinstall
- the PPA-enhanced rhs-printfilters RPM using "rpm --force -Uvh rhs-
- printfilters*"
-
-
- Select the appropriate entry for your printer model. You will then be
- presented with various options:
-
- +o The _D_r_i_v_e_r _D_e_s_c_r_i_p_t_i_o_n box contains information about the driver
+ which also starts printconf-gui in the newer Red Hat releases.
+
+
+ Configuring the print filters with the Red Hat 6.2/7.0 printtool
+
+ (Skip this section unless you are still using Red Hat 6.2 or 7.0)
+
+ The following description is for the older printtool that is used by
+ Red Hat 6.2/7.0. The printer configuration utility printconf-gui for
+ Red Hat 7.1 and later is a little different, as it is based on the
+ foomatic printer configuration database which contains entries for
+ pnm2ppa (but not the older pbm2ppa). You should be able to easily
+ figure out what to do: it can configure all pnm2ppa command-line
+ options in the Driver Options screen.
+
+ In the Red Hat 6.2/7.0 Print System Manager window, click on Add, then
+ in the "Add a Printer Entry", select Local Printer, and click Ok.
+ Hopefully, the port on which the printer is attached will be listed as
+ "Detected" (if not, fix the problem before continuing, perhaps by
+ adding the line "alias parport_lowlevel parport_pc" to
+ /etc/conf.modules). You will now have to "edit the local printer
+ entry" for the PPA printer. Click on Select to chose the "Input
+ filter". The Configure Filter screen will open. Among the many
+ printer entries in the list "Printer Type", you should find three
+ entries
+
+
+ o HP DeskJet 1000 series (PPA) (for 1000Cse, 1000Cxi models)
+
+ o HP DeskJet 710/720 series (PPA) (for 710C, 712C, 720C, 722C models)
+
+ o HP DeskJet 820 series (PPA) (for 820Cse, 820Cxi models)
+
+ Select the appropriate entry for your printer model. You will then
+ be presented with various options:
+
+ o The Driver Description box contains information about the driver
(you may have to use the scrollbar at the right of the box to read
it all).
- +o The _r_e_s_o_l_u_t_i_o_n box shows a single resolution (600x600). There are
+ o The resolution box shows a single resolution (600x600). There are
no other choices.
- +o The _P_a_p_e_r _S_i_z_e box allows various choices (only _l_e_t_t_e_r, _l_e_g_a_l, and
- _a_4 seem correspond to native paper sizes printed by the Red Hat
+ o The Paper Size box allows various choices (only letter, legal, and
+ a4 seem correspond to native paper sizes printed by the Red Hat
print filters; the other choices, (a3, ledger, ...) appear to get
resized by the print filters to print on US Letter size paper (?)
- ). (Other paper sizes cannot be selected this way, but you _c_a_n
- print to any papersize, _i_f _i_t _s_u_p_p_o_r_t_e_d _b_y _b_o_t_h _g_h_o_s_t_s_c_r_i_p_t _a_n_d _t_h_e
- _p_r_i_n_t_e_r, using a script, as described above, that bypasses the
+ ). (Other paper sizes cannot be selected this way, but you can
+ print to any papersize, if it supported by both ghostscript and the
+ printer, using a script, as described above, that bypasses the
RedHat printfilters.)
- +o The _C_o_l_o_r _D_e_p_t_h_/ _U_n_i_p_r_i_n_t _M_o_d_e box allows various selections of
+ o The Color Depth/ Uniprint Mode box allows various selections of
color and print quality (These are achieved by using various
- combinations of the pnm2ppa options _-_-_e_c_o (EconoFast mode), _-_p
- (disable black ink cartridge) and _-_-_b_w (black and white printing
+ combinations of the pnm2ppa options --eco (EconoFast mode), -p
+ (disable black ink cartridge) and --bw (black and white printing
only), without direct intervention by the user.) The choices (in
the most recent printerdb database) are:
- +o Black and White, econofast mode (--bw --eco)
-
- +o Black and White, normal quality (--bw)
-
- +o Color, econofast mode (--eco --fd)
-
- +o Color, normal quality (--eco)
-
- +o Color, high quality
-
- +o Color, normal quality, black ink disabled (-p --eco)
-
- +o Color, high quality, black ink disabled (-p --uni)
+ o Black and White, econofast mode (--bw --eco)
+
+ o Black and White, normal quality (--bw)
+
+ o Color, econofast mode (--eco --fd)
+
+ o Color, normal quality (--eco)
+
+ o Color, high quality
+
+ o Color, normal quality, black ink disabled (-p --eco)
+
+ o Color, high quality, black ink disabled (-p --uni)
(These are the choices that will be presented by "official" rhs-
printfilters-1.72; if you installed a pnm2ppa RPM package from the
@@ -384,30 +377,28 @@
still be a useful alternative to pnm2ppa on older, slower systems
with less available memory.
- +o The three _P_r_i_n_t_i_n_g _o_p_t_i_o_n_s are not relevant here, and should _n_o_t be
+ o The three Printing options are not relevant here, and should not be
selected. They are for direct printing of text (ascii) to non-
postscript printers, but since the only way of printing text files
with pnm2ppa is by first converting them to postscript(tm), this is
- _n_o_t possible on the PPA printer.
-
- +o _I_t _i_s _i_m_p_o_r_t_a_n_t _t_h_a_t _t_h_e _c_h_o_i_c_e "Fast text printing (non-PS
- printers only)" _i_s _N_O_T _s_e_l_e_c_t_e_d_, _s_o _t_h_a_t _t_h_e _p_r_i_n_t _f_i_l_t_e_r_s _w_i_l_l
- _c_o_n_v_e_r_t _t_e_x_t _f_i_l_e_s _t_o _p_o_s_t_s_c_r_i_p_t _b_e_f_o_r_e _p_r_i_n_t_i_n_g_.
-
- +o The _M_a_r_g_i_n_s entries control the margins used when printing text
+ not possible on the PPA printer.
+
+ o It is important that the choice "Fast text printing (non-PS
+ printers only)" is NOT selected, so that the print filters will
+ convert text files to postscript before printing.
+ o The Margins entries control the margins used when printing text
files (these are instructions to the text-to-postscript conversion
process).
- +o The _E_x_t_r_a _G_S _o_p_t_i_o_n_s box is not only a place for adding options for
- ghostscript, but also for the PPA drivers. _L_e_a_v_e _t_h_i_s _b_o_x _e_m_p_t_y
- _u_n_l_e_s_s _y_o_u _k_n_o_w _w_h_a_t _y_o_u _a_r_e _d_o_i_n_g. As explained in the text in
+ o The Extra GS options box is not only a place for adding options for
+ ghostscript, but also for the PPA drivers. Leave this box empty
+ unless you know what you are doing. As explained in the text in
the Driver Description box (you did read it, didn't you ?), the
entry should be in the format:
gs_options PPA ppa_options
-
@@ -417,21 +408,20 @@
mand line (hopefully, these two sources of information will be consis-
tent with each other!);
- When you have made your choices, click on _O_k to save your selections
- and close the "Configure Filter" screen, and then click on _O_K to
+ When you have made your choices, click on Ok to save your selections
+ and close the "Configure Filter" screen, and then click on OK to
close the "Edit Local Printer Entry" screen.
You are now back in the "Red Hat Print System Manager" screen;
- highlight the printer you just configured, and, in the _T_e_s_t_s menu,
- choose _P_r_i_n_t _P_o_s_t_s_c_r_i_p_t _t_e_s_t _p_a_g_e to print a test page using the Red
+ highlight the printer you just configured, and, in the Tests menu,
+ choose Print Postscript test page to print a test page using the Red
Hat print filters. If this printed correctly, your print system is
set up to use the PPA printer, just like any of the other printers
that the Red Hat print filters support.
-
- CCoonnffiigguurriinngg ppnnmm22ppppaa..ccoonnff aanndd ccaalliibbrraattiinngg tthhee pprriinntteerr..
+ Configuring pnm2ppa.conf and calibrating the printer.
A number of printer parameters are set to reasonable default values
for each of the printer models, but you may wish to "fine tune" or
@@ -442,28 +432,28 @@
The user-adjustable parameters are:
- +o vveerrbboossee 11 and ssiilleenntt 11. These control messages about progress and
+ o verbose 1 and silent 1. These control messages about progress and
errors from pnm2ppa. By default, messages are sent to the system
log /var/log/messages. The verbose 1 keyword send copies to
stderr, the standard error stream to the terminal. The silent 1
keyword silences the stream of messages to the system log.
- +o TThhee ssyysstteemm lloogg mmeessssaaggeess mmaayy bbee ssiilleenncceedd iinn tthhee ddeeffaauulltt
- ccoonnffiigguurraattiioonn ffiillee;; sswwiittcchh ooffff ""ssiilleenntt"" mmooddee wwiitthh ""ssiilleenntt 00"" ffoorr
- ddeebbuuggggiinngg pprriinntteerr pprroobblleemmss ((oorr uussee vveerrbboossee mmooddee))..
-
- +o The vveerrssiioonn keyword can be used to specify the printer model as
+ o The system log messages may be silenced in the default
+ configuration file; switch off "silent" mode with "silent 0"
+ for debugging printer problems (or use verbose mode).
+
+ o The version keyword can be used to specify the printer model as
710, 712, 720, 722, 820, or 1000. It is not needed if you use the
RedHat printool to configure the printer.
- +o xxooffffsseett and yyooffffsseett: the x-offset and y-offset (in pixels) of the
+ o xoffset and yoffset: the x-offset and y-offset (in pixels) of the
printed image on the page, which should be chosen so the image is
correctly centered on the paper. (These can also be set with the
-x and -y options.) See CALIBRATION.html (or
CALIBRATION.txt) for more information.
- +o ttooppmmaarrggiinn, bboottttoommmmaarrggiinn, lleeffttmmaarrggiinn, rriigghhttmmaarrggiinn: the four margins,
+ o topmargin, bottommargin, leftmargin, rightmargin: the four margins,
which define the distances (in pixels) from the edges of the paper
to the printed region; parts of the image that are outside these
margins will not be printed. (These can also be set with the
@@ -472,27 +462,27 @@
-l , and
-r options.)
- +o CCoollOOffffssXX and CCoollOOffffssYY: the x-offset and y-offset (in pixels)
+ o ColOffsX and ColOffsY: the x-offset and y-offset (in pixels)
between the color image produced by the color ink printer head,
and that produced by the black ink printer head. These should be
recalibrated
- eeaacchh ttiimmee aann iinnkk ccaarrttrriiddggee iiss rreeppllaacceedd. See CALIBRATION.html (or
+ each time an ink cartridge is replaced. See CALIBRATION.html (or
CALIBRATION.txt) for more information.
- +o bbllaacckksshheeaarr and ccoolloorrsshheeaarr: these are x offsets between right-to-
+ o blackshear and colorshear: these are x offsets between right-to-
left and left-to-right sweeps of the print head, one for the black
printing and one for the color printing. These provide sideways
offsets (in pixels) of the right-to-left sweeps, that can be used
to correct "shearing" when printing in modes that use bidirectional
print head sweeps.
- +o uunniimmooddee 11 will make unidirectional print sweeps (left-to-right)
+ o unimode 1 will make unidirectional print sweeps (left-to-right)
the default, instead of bidirectional sweeps. The --uni and --bi
options can control how a particular print run is printed.
Unidirectional printing is only useful (it is slower) if there are
issues of "shearing" in high quality image printing.
- +o bbllaacckknneessss : this takes values 0,1,2,3 or 4 drops of black ink per
+ o blackness : this takes values 0,1,2,3 or 4 drops of black ink per
pixel, and controls black ink density in black-and-white and "text-
like" black regions in color printing. At present, this has no
effect on printing with the black ink cartridge disabled, or on
@@ -500,102 +490,93 @@
with the -B option, where n is the number of drops.)
- +o GGaammmmaaRR, GGaammmmaaGG, and GGaammmmaaBB: the are the three "gamma" parameters
+ o GammaR, GammaG, and GammaB: the are the three "gamma" parameters
that define the standard color correction curves for red, green,
and blue. Changing these will affect how colors appear
(decreasing any Gamma enhaces the corresponding color). The Gamma
values are specified as decimal numbers, with Gamma = 1.0
corresponding to no color correction.
- +o Gamma values can also be specified using integer numbers
- RReeddGGaammmmaaIIddxx, GGrreeeennGGaammmmaaIIddxx, BBlluueeGGaammmmaaIIddxx; These are determined by a
+ o Gamma values can also be specified using integer numbers
+ RedGammaIdx, GreenGammaIdx, BlueGammaIdx; These are determined by a
procedure discussed in COLOR.html or COLOR.txt, which involves
- printing a test page. The ppaappeerrssiizzee keyword specifies the paper
+ printing a test page. The papersize keyword specifies the paper
size used for this testpage, because it is produced by pnm2ppa
without the input that usually specifies the page size.
- +o The keywords bbllaacckk__iinnkk 00, ccoolloorr__iinnkk 00, ccyyaann__iinnkk 00, mmaaggeennttaa__iinnkk 00,
- and yyeellllooww__iinnkk 00 can be used to switch of the various inks; this
+ o The keywords black_ink 0, color_ink 0, cyan_ink 0, magenta_ink 0,
+ and yellow_ink 0 can be used to switch of the various inks; this
can be useful in troubleshooting and debugging pnm2ppa.
Use test_ppa to print various test pages or calibration patterns to
adjust the offsets.
If you wish to specify these parameters using the command-line options
- described above, some of them can be entered in the "extra GS options"
- box using the Print System Manager (printtool), as described above.
-
-
- UUttiilliittyy pprrooggrraammss ffoorr tthhee pprriinntteerr..
+ described above, in Red Hat 6.2/7.0 some of them can be entered in the
+ "extra GS options" box using the Print System Manager (printtool), as
+ described above. In Red Hat 7.1 and later, all command-line options
+ can be set using the new printconf-gui utility.
+ Utility programs for the printer.
HP's Windows software provides a utility program that sends PPA
- commands to tell the printer to perform taks like cleaning the
- printheads, etc. The codes for some of these functions have already
- been reverse engineered. There are proposals to add support for PPA
- printers to the PUP (Printer Utility Program) utility, which is also a
- project at http://www.sourceforge.net. However, as of the time of
- writing, no PUP support for PPA printers is available (volunteers,
- anyone?).
-
-
- TTrroouubblleesshhoooottiinngg
+ commands to tell the printer to perform tasks like cleaning the
+ printheads, etc.
+
+ On Red Hat Linux, You can use test_ppa (which acts as a command-line
+ front-end for calibrate_ppa) to print head-cleaning patterns.
+
+ There is a graphical (gtk-based) tool written by Javier Sedano for
+ creating a pnm2ppa.conf file and acting as a front end to
+ calibrate_ppa. This is called ppaSet, and a beta version of it can be
+ found in the same place as the pnm2ppa-1.10 distribution at
+ http://sourceforge.net/projects/pnm2ppa
+
+ There was also at one time a proposal to add support for PPA printers
+ to the PUP (Printer Utility Program) utility, which is also a project
+ at http://www.sourceforge.net. However, as of the time of writing, no
+ PUP support for PPA printers is available.
+
+
+ Troubleshooting
The first thing to do is to look at the messages from pnm2ppa in the
- system log to see what is happening, whether pnm2ppa aaccttuuaallllyy rreecceeiivveedd
- aannyy iinnppuutt, and if it was valid.
- ((YYoouu mmaayy nneeeedd ttoo eennaabbllee ssyysstteemm lloogg mmeessssaaggeess iinn /etc/pnm2ppa.conf,
+ system log to see what is happening, whether pnm2ppa actually received
+ any input, and if it was valid.
+ (You may need to enable system log messages in /etc/pnm2ppa.conf,
see above.) Maybe ghostscript failed to convert your postscript file
- into PNM format: this is nnoott a pnm2ppa problem! Here are suggestions
- for dealing with problems that you may encounter.
-
- +o PPrriinnttiinngg ffaaiillss iinn tthhee mmiiddddllee ooff aa pprriinntt rruunn, perhaps when a figure
+ into PNM format: in that case the system log reports "Fatal Error!
+ Input image (pnm2ppa) is not a PNM image". (note: when this occured,
+ older versions of pnm2ppa reported "Input image is not a supported PNM
+ format" which may have been confusing). This is because the input
+ received by pnm2ppa was not a valid PNM image, but instead ghostscript
+ failed to produce any PNM output at all, and its only output was
+ probably just an error message. This is not a pnm2ppa problem!
+
+ Here are suggestions for dealing with other problems that you may
+ encounter.
+
+ o Printing fails in the middle of a print run, perhaps when a figure
embedded in the document is printing (in the latest pnm2ppa
versions, printing finishes normally, but an incomplete document is
printed). The system log reports that read_line could not read
the image, and found EOF (end-of-file). This probably means that
- ghostscript's "ppmraw" or "pgmraw" output device failed for some
- reason, usually leaving a core dump, without completing the
- translation of the postscript to a pnm format. (This has been seen
- to happen in ghostscript 5.10 ; upgrading to ghostscript 5.50
- solved the problem.) If you cannot upgrade, try printing the
- document in black-and-white using the ghostscript "pbmraw" output
- device.
-
- +o TThhee test_ppa script works, but you can't get printtool to make the
- printfilters work.
-
- You installed pnm2ppa-1.0 and the PPA-enhanced rhs-printfilters
- (earlier than v. 1.61) from the pnm2ppa SourceForge page. You
- are using printtool v. 3.43 or earlier and are probably a Mandrake
- user. Solution: (a) use printtool to uninstall the PPA printer;
- (b) delete (or rename) the printer database /usr/lib/rhs/rhs-
- printfilters/printerdb, and reinstall the rhs-printfilters RPM
- using the "rpm --force ... " option; (c) use printtool to add the
- PPA printer again. (Your previously-installed rhs-printfilters may
- have resisted replacement of its printerdb).
-
- +o YYoouu uuppggrraaddeedd yyoouurr RReeddHHaatt ((oorr ccoommppaattiibbllee)) LLiinnuuxx ddiissttrriibbuuttiioonn aanndd
- yyoouurr pprriinnttffiilltteerrss nnoo lloonnggeerr wwoorrkk. You used to use a PPA-enhanced
- rhs-printfilters from the pnm2ppa SourceForge site. You upgraded
- your distribution to one using printtool v 3.44 or later (e.g.
- RedHat 6.2). Solution: Make sure that rhs-printfilters has been
- updated to a version 1.61 or greater that came with your upgraded
- distribution. Use printtool to delete, and then add the PPA
- printer This will create a new printer configuration compatible
- with your upgraded distribution.
-
- +o YYoouu pprriinntteedd aann iimmaaggee ffiillee uussiinngg aa ""hhiigghh qquuaalliittyy"" pprriinntteerr sseettttiinngg,,
- bbuutt iitt hhaass vviissiibbllee hhoorriizzoonnttaall lliinneess oonn iitt and printing under
+ ghostscript's "ppmraw" or "pgmraw" output device started correctly,
+ but failed for some reason before finishing the image conversion
+ from postscript to PNM format, usually leaving a core dump. (This
+ has been seen to happen in ghostscript 5.10 ; upgrading to
+ ghostscript 5.50 solved the problem.) If you cannot upgrade, try
+ printing the document in black-and-white using the ghostscript
+ "pbmraw" output device.
+
+ o You printed an image file using a "high quality" printer setting,
+ but it has visible horizontal lines on it and printing under
Windows(tm) 9x doesn't show this effect (except in "economode").
These are probably "swath boundaries", showing the junction between
different sweeps of the print head. Solution: using unidirectional
printing (PPA option --uni, or unimode 1 in /etc/pnm2ppa.conf)
- helps a little, but this problem requires an extensive rewrite of
- part of pnm2ppa (cutswath.c) for a satisfactory solution.
- (Volunteers welcome - see the TODO file in the pnm2ppa docs
- (/usr/doc/pnm2ppa*/TODO)!)
-
- +o "FFllaasshhiinngg lliigghhtt ssyynnddrroommee ". Your printer usually works, but you
+ helps a little. this problem is fixed in the pnm2ppa-1.10 release
+
+ o "Flashing light syndrome ". Your printer usually works, but you
have found that some particular documents cause the printer to
fail, and the lights on its panel start flashing rapidly in
sequence. Solution, turn the printer off and back on again.
@@ -605,15 +586,15 @@
(Don't sent it to the Mailing List unless requested). Bug reports
can be filed at the SourceForge pnm2ppa site.
- +o YYoouu wwiisshh ttoo pprriinntt oonn eennvveellooppeess oorr ootthheerr nnoonn--ssttaannddaarrdd mmeeddiiaa nnoott
- ssuuppppoorrtteedd bbyy tthhee pprriinntt ffiilltteerrss? Solution: if you can get
+ o You wish to print on envelopes or other non-standard media not
+ supported by the print filters? Solution: if you can get
Ghostscript (gs) to produce the correct image, and the paper size
is in the range allowed by your printer, you should be able to do
this with a script that bypasses the print filters, as described
earlier in this document.
- +o CCoolloorrss llooookk wwrroonngg,, oorr ddoo nnoott mmaattcchh wwhhaatt tthhee WWiinnddoowwss((ttmm)) 99xx ddrriivveerr
- pprroodduucceess. Solution: check that your color ink cartridge is not
+ o Colors look wrong, or do not match what the Windows(tm) 9x driver
+ produces. Solution: check that your color ink cartridge is not
running out of some ink color; if not, (a) adjust the "gamma"
entries in /etc/pnm2ppa,conf, or (b) install a customized color
calibration file /etc/pnm2ppa.gamma. See the file COLOR.html (or
@@ -621,40 +602,23 @@
- CCoonnttaaccttiinngg tthhee ppnnmm22ppppaa pprroojjeecctt..
+ Contacting the pnm2ppa project.
Send comments or corrections (about this document or the RPMS) to:
ppa-rpms@users.sourceforge.net
- There are three mailing lists, _p_p_a_._a_n_n_o_u_n_c_e (announcements), _p_p_a_._u_s_e_r_s
- (users helping users) and _p_p_a_._d_e_v_e_l (developers). You can subscribe
- to them, or browse their archives, at
- http://pnm2ppa.sourceforge.net/maillist.htm.
-
- To contact the developers, subscribe to _p_p_a_._d_e_v_e_l and post a message.
+ There are three mailing lists, pnm2ppa-announce@lists.sourceforge.net
+ (announcements), pnm2ppa-users@lists.sourceforge.net (users helping
+ users) and pnm2ppa-devel@lists.sourceforge.net (developers). You can
+ subscribe to them, or browse their archives, at
+ http://sourceforge.net/projects/pnm2ppa. (The older pnm2ppa mailing
+ lists died with the ListBot service)
+
+ To contact the developers, subscribe to ppa.devel and post a message.
There are Public Forums for posting questions and comments at
http://sourceforge.net/projects/pnm2ppa (but whether you get any help
- from these, depends on whether anyone is reading them).
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+ from these, depends on whether anyone is reading them (unlikely!)).
+
+
+
diff --git a/docs/en/INSTALL.SOLARIS b/docs/en/INSTALL.SOLARIS
new file mode 100644
index 0000000..298ad28
--- /dev/null
+++ b/docs/en/INSTALL.SOLARIS
@@ -0,0 +1,22 @@
+On Solaris systems, you will probably have to install the GNU "libiberty"
+library (-liberty) which provides getopt_long for Solaris; get it at
+ http://sunfreeware.com
+(look for the package "libiberty.so" in the list of freeware)
+and install it into /usr/local/lib.
+
+The tarball of the package is called "shared-libiberty.tar.gz".
+If you use the precompiled library libiberty-i386.so that it supplies for
+x86 systems, rename it to libiberty.so when you install it. Otherwise,
+build the library from source.
+
+Uncomment the Makefile line adding an entry for -liberty to LDFLAGS.
+
+You may also need to compile with the -D__NO_SYSLOG__ option to suppress
+system log messages. See the Makefile.
+
+If "make install" fails, manually copy the pnm2ppa and calibrate_ppa binaries,
+the manpage pnp2ppa.1, and the configuration file pnm2ppa.conf
+to their appropriate locations.
+
+The "install" command on Solaris does not have the -b (backup) option.
+uncomment the Makefile line entry for this.
\ No newline at end of file
diff --git a/docs/en/PPA_networking-1.html b/docs/en/PPA_networking-1.html
new file mode 100644
index 0000000..76a4009
--- /dev/null
+++ b/docs/en/PPA_networking-1.html
@@ -0,0 +1,89 @@
+
+
+
+
+ Networking HP PPA DeskJet Printers using SAMBA.: Networking HP DeskJet PPA printers with SAMBA
+
+
+
+
+
+Next
+Previous
+Contents
+
+
The HP DeskJet 710/712C, 720/722C, 820Cse/820Cxi and 1000Cse/1000Cxi
+printers are
+"Winprinters" which are designed only for use with
+MS Windows operating systems. HP supplies Windows-only software
+that processes the input data into the proprietary and unpublished
+PPA ("Printer Performance Architecture") protocol.
+
HP states that these printers are not supported as networked
+printers, but they in fact function correctly as shared (SMB)
+printers under MS Windows.
+
In this document, the Host is the computer to which
+the PPA printer is physically connected, and the Clients are
+other computers on the network that wish to print documents
+on the PPA printer.
+
In the Windows printing system, separate copies of the HP PPA printer drivers
+are installed on each Client, and are run on the Client to produce PPA output
+that is sent over the network to be spooled
+on the Host to which the printer is attached.
+
HP's drivers are only supplied for Windows systems. The
+independently-produced
+pnm2ppa
+driver runs on Linux, some other Unix systems, and BeOS.
+
This document describes various tested strategies for
+using pnm2ppa and the
+samba
+suite of SMB tools to allow the PPA printer to be attached to
+a non-Windows host on a (TCP-based) SMB network, or to allow
+non-Windows Clients to receive printing services from a Host
+on the network.
+
There are two possible ways to send printer data from a Client to
+the printer Host over the network.
+
+
as PPA data, created by a driver on the Client.
+This is what
+happens when using conventional printer sharing on Windows.
+
as PostScript data, created on the Client, which
+is then translated into PPA instructions by
+drivers running on the printer Host.
+
+
+Since PPA data is rather large, the first method involves sending
+larger amounts of data over the network, which may be why HP do
+not officially support PPA DeskJets as networked printers. It also
+requires that PPA drivers are installed on the Client.
+
The Host to which the printer is attached can thus provide two
+classes
+of printing services:
+
+
PPA printing services: the Host accepts PPA-format
+printing jobs created on the Clients either with HP's native PPA drivers
+(Windows Clients) or pnm2ppa (Unix/Linux/BeOS Clients);
+
PostScript printing services: the Host accepts PostScript-format
+printing jobs created on any postscript-capable Client, and converts
+them to PPA format using either HP's native PPA drivers
+(Windows Host) or pnm2ppa (Unix/Linux/BeOS Host);
+
+
+It is useful to set up the Host to offer both types of service,
+sharing a common spooling system.
+
+
+Next
+Previous
+Contents
+
+
diff --git a/docs/en/PPA_networking-2.html b/docs/en/PPA_networking-2.html
new file mode 100644
index 0000000..7330275
--- /dev/null
+++ b/docs/en/PPA_networking-2.html
@@ -0,0 +1,149 @@
+
+
+
+
+ Networking HP PPA DeskJet Printers using SAMBA.: Configuring the Printer Host.
+
+
+
+
+
+Next
+Previous
+Contents
+
+
It is assumed that pnm2ppa is installed and working
+to provide local printing services on the Host, and that
+lpr will invoke a full set of print filters, as
+(e.g.) in Red Hat 6.2. The PPA printer is installed with
+the printer name lp, and
+samba is assumed to be installed. General Samba configuration
+issues involving security levels, network password, etc, are outside the
+scope of this document (see the SMB-HOWTO). You must log in as
+root to configure Samba.
+
Here is a sample entry setting up two public printer shares
+in the Host's /etc/smb.conf file.
+The printer HP722C-PPA is for printing by a Client that sends
+PPA output from pnm2ppa or the HP drivers across
+the network, and HP722-PS is for Clients that produce PostScript
+output:
+
+
+[HP722C-PPA]
+ comment = HP 722C printer on Linux (PPA input)
+ path = /var/tmp
+ printer name = lp
+ writable = yes
+ public = yes
+ printable = yes
+ print command = lpr -l -r -h -P %p %s
+[HP722C-PS]
+ comment = HP 722C printer on Linux (Postscript input)
+ path = /var/tmp
+ printer name = lp
+ writable = yes
+ public = yes
+ printable = yes
+ print command = lpr -r -h -P %p %s
+
+
+
+The only differences besides the names are that the print command
+for HP722-PPA uses the " -l "
+"pass-through" option so print filters are not applied.
+The path entry uses /var/tmp because this is (presumably)
+a world-readable and -writable area for temporary files.
+
After editing /etc/smb.conf to include these entries,
+save it, and test its syntax with Samba's testparm utility.
+Then restart samba
+(run "/etc/rc.d/init.d/smb restart" on Red Hat).
+
The Host is assumed to be a Window 98 system, and the PPA
+printer is assumed to be a HP722C installed with the native HP
+PPA drivers supplied on HP's installation CD. Some details may vary
+on other Windows versions.
+
First set up a shared printer that can accept PPA input
+from both networked Windows Clients, and from
+networked non-Windows Clients
+that use pnm2ppa.
+
+
+
IMPORTANT!:
+A PPA printer attached to a Windows Host shared with a
+Client running pnm2ppa has the following limitation:
+
+
Bi-Directional communication between the Windows Host and the printer
+must be disabled.
+
+
+If it is not done,
+a General Protection Fault will usually occur on
+the Windows Host when pnm2ppa sends
+output to the
+shared printer. (A "Hpfbkg06" error occurs,
+and the printer becomes nonfunctional until
+the Windows system is rebooted.)
+Disabling bi-directional communication appears to be a minor inconvenience:
+according to HP, the print quality is unaffected,
+but the
+"advanced features of the Status Monitor"
+will no longer send reminders to align the print cartridges
+after a new cartridge is installed, or
+send error messages
+associated with the ink cartridges
+or the banner lever.
+
+
You may be able to avoid disabling bi-directional communication
+by using an emulated Postscript
+printer to serve non-Windows Clients without using pnm2ppa
+(see below).
+
To turn off bi-directional communication between the Windows Host
+and the printer, open the Settings/Printers folder,
+then right-click on the printer icon, and open the Properties
+dialog. Select the Details tab, and click on
+Spool Settings, then choose the setting
+"Disable bi-directional support for this printer".
+If you have any difficulties, try rebooting Windows after the change,
+or see HP's support document
+http://www.hp.com/cposupport/printers/support_doc/bpd06455.html about disabling bi-directional communication.
+
To set up the Host to share the printer, right-click on its
+icon in the Settings/Printers folder, and select Sharing,
+then assign it a Share Name like HP722C-PPA , and enter a Comment
+Line like "HP 722C printer on Windows 98 (PPA input)".
+
You may now also wish to set up an emulated Postscript printer that
+accepts Postscript input from the Client,
+and prints it using HP's PPA drivers
+running on the Host, instead of on the Client.
+See the section
+Emulating a PostScript printer on a Windows Host
If you have installed and successfully tested the emulated printer,
+set it up for sharing on the network.
+Right-click on its
+icon in the Settings/Printers folder, and select Sharing,
+then assign it a Share Name like HP722C-PS, and enter a Comment
+Line like "HP 722C printer on Windows 98 (PostScript input)".
+
The emulated printer will appear like a Postscript printer to
+the Clients. If it provides acceptable printing services to
+the non-Windows clients, you will not need to connect pnm2ppa
+printers to HP722C-PPA, and will be able to re-enable bi-directional
+communication between the HP drivers and the printer.
+(However, the extra processing involved in the emulation may be
+unacceptably slow, or turn out to use too much of the host's CPU)
+
+
+
+Next
+Previous
+Contents
+
+
diff --git a/docs/en/PPA_networking-3.html b/docs/en/PPA_networking-3.html
new file mode 100644
index 0000000..cf3557b
--- /dev/null
+++ b/docs/en/PPA_networking-3.html
@@ -0,0 +1,88 @@
+
+
+
+
+ Networking HP PPA DeskJet Printers using SAMBA.: Configuring the Printing Clients.
+
+
+
+
+
+Next
+Previous
+Contents
+
+
Open the Settings/Printers folder, and start the
+Add Printer Wizard. Choose to add a Network Printer,
+and browse the network to find the Printer Shares you configured on
+the host (e.g., HP722C-PPA and HP722C-PS). If they are not visible,
+either the Host or the network is not properly configured. Correct
+the problem before proceding.
+
Normally, you will probably want to use
+the native Windows HP PPA drivers, so select the printer Share that accepts
+PPA input (e.g., HP722C-PPA). If the Host
+is a Windows Host, it will provide the drivers over the network,
+otherwise you will have to
+find the printer in the list of available HP Printer drivers,
+or click on Have Disk and install them from HP's installation CD.
+You then get a chance to change the name with which the printer will be
+known on the Client. Finally, you should choose to print a test page.
+
You might instead (or also) want to set up printing
+services using the Printer Share that accepts Postscript
+(e.g., HP722C-PS).
+In that case, if the Host is not a Windows Host, choose a
+"generic" PostScript printer like the
+Apple LaserWriter II NT or the Digital turboPrintServer 20/Net.
+
If the test page prints sucessfully, you are finished!
+
First examine the network by opening a terminal window and
+using the command
+
+
+smbclient -L hostname
+
+
+
+(where "hostname" should be replaced by the
+network name of the Host to which the printer is attached).
+This will list
+the SMB services provided by that Host.
+(Alternatively, your
+system may have some graphical front-end to smbclient
+that allows you to inspect the network.)
+The list should include
+the Printer Share(s) you configured on the Host
+(e.g., HP722C-PPA and HP722C-PS). If these are
+absent, you must first identify and correct the problem.
+
You must now configure the printer. The details of how to do this
+will vary between Linux/Unix distributions, but there will probably
+be support for network printing using Samba.
+
If the Printer Share
+you wish to use is intended to accept PPA input
+(e.g., HP722C-PPA), configure the Client to use the pnm2ppa
+driver.
+
If it is intended to accept PostScript input
+(e.g., HP722C-PS), configure the Client to print to a PostScript printer.
+
You may wish to configure both types of printers, and experiment
+to see which provides the best printing services on your network.
+
See the SMB-HOWTO documentation for more information.
+
+
+
+Next
+Previous
+Contents
+
+
diff --git a/docs/en/PPA_networking-4.html b/docs/en/PPA_networking-4.html
new file mode 100644
index 0000000..d6ab105
--- /dev/null
+++ b/docs/en/PPA_networking-4.html
@@ -0,0 +1,226 @@
+
+
+
+
+ Networking HP PPA DeskJet Printers using SAMBA.: Emulating a PostScript printer on a Windows Host.
+
+
+
+
+Next
+Previous
+Contents
+
+
If you do not have commercial PostScript emulation software for Windows that
+will work with your HP PPA DeskJet
+(the author is unaware of any such software that supports PPA printers),
+you can use Ghostscript together with HP's native Windows drivers.
+
From the Ghostscript home page
+http://www.cs.wisc.edu/~ghost/
+download and install (in this order) the Windows packages of
+
+
Ghostscript (PostScript Emulation Software).
+
GSview (Ghostscript previewer, provides gsprint).
+
RedMon (printer port redirection utility).
+
+
+(Install these using their setup.exe
+installation tools, and do not manually
+set up any configuration files for gsprint
+or RedMon.)
+You must now follow the detailed instructions below, and
+use the Windows "Add Printer Wizard" to add a postscript
+printer, and then
+configure it to use the gsprint utility that comes with
+GSview, and redirect the output to your HP PPA DeskJet using the RedMon utility.
+
In the following, I assume your printer is a HP DeskJet 722C,
+and is installed with its native Windows Drivers as a printer
+called "HP DeskJet 720C Series". Change printer
+name entries
+below as appropriate for your printer model.
+
The following instructions are tested on Windows 98, and may differ
+on other Windows variants.
+
Open the Settings/Printers folder.
+
First check that the HP PPA Deskjet is correctly installed,
+using HP's native Windows drivers. Right-click on its icon,
+and select its Properties dialog. The General
+Properties screen will open. This shows the exact name
+that the printer was given when it was installed. Make a note of
+it, and use the Print Test Page button
+to confirm that the
+printer is working. (The "Printer name:" line on the
+test page will also show the exact name of the HP PPA Deskjet
+that you will need to use when configuring the emulated postscript printer
+below). When you are done,
+click on OK to close the dialog.
+
Now start the Add Printer "Wizard".
+Make the choices:
+
+
install a local printer
+
select a PostScript printer from the
+list of printers;
+(e.g., one of the Apple LaserWriter models:
+the Laserwriter II NT is known to work; Digital
+PrintServer models such as the turboPrintServer 20/Net
+have also been recommended). This will provide a
+suitable postscript driver.
+
From the list of Available Ports, choose
+"FILE: Creates a file on disk"
+(you will change this after
+the printer is installed)
After the printer has been installed,
+right-click on its icon, and rename it to something like,
+e.g.,
+"Ghostscript+HP722C".
+Then right click again and open its Properties dialog.
+
On the General tab screen,
+enter something informative
+in the Comment box, such as
+" Emulated Postscript printer; output redirected
+to a HP722C DeskJet printer" (optional).
+
Next select the Details tab.
+The box "Print using the following driver:"
+should show the
+Postscript driver you selected (e.g., Apple LaserWriter II NT).
+
+
+
Click on Add Port.
+Select other, then Redirected Port, which should be
+available if RedMon was correctly installed, and click on
+OK to accept these
+settings and close the Add Port dialog.
+On the Details tab screen,
+The box "Print to the following port:"
+should now show a
+redirected port such as
+"RPT1 [Redirected Port]".
+
+
Click on
+Port Settings.
+
+
In the box
+"Redirect port to the program:", enter the path to the
+gsprint program. (If you accepted the defaults when installing it,
+this may be C:\Ghostgum\gsview\gsprint.exe; you may
+search for it by clicking on Browse).
+
+
In the box "arguments for this program are:"
+enter the arguments to be passed to the
+gsprint program (there is a document gsprint.htm
+with more details of these in the folder containing gsprint.exe).
+Suggested arguments are:
+
+
+ -printer "HP DeskJet 720C Series" -color -
+
+
+
+Replace "HP DeskJet 720C Series" by the (quoted)
+exact name of the HP PPA DeskJet printer that
+you made a note of earlier. (If you do not copy this name exactly,
+including any capitalization or spaces, things may not work!)
+The -color argument is needed to
+enable color printing;
+(Whether you actually get color printing will depend on the local settings
+of the "HP DeskJet 720C Series" printer
+that really prints
+the document.)
+The final
+" - " is required: without it,
+the output of gsprint will not get redirected to
+the printer.
+
+
+
The box "Output" should show
+"Program handles output".
+
+
In the box "Run", select
+"hidden".
+
+
The box "Shutdown delay" will say
+"300 seconds". Print jobs for which processing by
+gsprint takes longer than this will be terminated,
+to avoid blocking the printer spool queue. Increase this limit
+if necessary.
+
+
+
+Now click on OK to close the Port Settings dialog.
+
+
+
Click on Spool Settings, and select
+"Disable bi-directional support for this printer",
+and click OK.
+
+
Finally, again select the General tab, and test the installation by
+clicking on "Print a test page". If it works, you are
+finished setting up Postscript emulation. Click OK to
+exit the Printer Properties dialog.
+
(If you have problems, first check that you made the correct
+entries in the Printer Properties dialogs, especially check that you
+did not make any typing errors in the
+exact name for the PPA DeskJet printer in the
+gsprint arguments box, which must correspond exactly
+to the "Printer name" given to the HP PPA printer). If the problems
+persist, you might get guidance from the
+gsprint and RedMon documentation; look
+in the folders where these were installed.)
+
You now have a working emulated
+"Postscript printer" that can now be shared over
+a network. (The "sharing" options will now be available
+if you right-click on the emulated printer's icon.)
+
This emulated postscript
+printer is most useful for providing printing services
+to non-Windows
+Clients on a samba network,
+but can be also be used by Windows
+Clients with the following limitations:
+
+
Windows Clients will be able to
+select Print Settings only for the
+visible ("front end") "Postscript printer",
+but not for
+the hidden ("back end") HP PPA DeskJet printer
+that actually
+does the printing.
+
Changes in the local Print Settings of the PPA driver for
+the DeskJet printer on the
+Host system (but not on Client systems, if it
+too is shared) will affect network printing by the
+"Postscript printer".
+
Since the
+visible "Postscript printer" falsely
+advertises its identity, some of its Print Settings
+options seen by users on the Clients may not be valid.
+
The extra processing on the printer Host
+may make printing rather slow compared to native Windows printing.
v0.12 Feb 10, 2002
+
+This document discusses Networking HP 710C, 720C 820C or 1000C Series
+(PPA Protocol) HP DeskJet printers with non-Windows Hosts or Clients,
+using SAMBA. Topics include choosing between transmitting PPA or PostScript
+across the network, Windows and Linux/Unix Hosts, Windows and Linux/Unix
+Clients, and emulating a PostScript printer on Windows.
+(Updated for pnm2ppa-1.04 and later.)
+
+
+
+Next
+Previous
+Contents
+
+
diff --git a/docs/en/PPA_networking.txt b/docs/en/PPA_networking.txt
new file mode 100644
index 0000000..e7731a8
--- /dev/null
+++ b/docs/en/PPA_networking.txt
@@ -0,0 +1,470 @@
+ Networking HP PPA DeskJet Printers using SAMBA.
+ The pnm2ppa project team ppa-rpms@users.sourceforge.net
+ v0.12 Feb 10, 2002
+
+ This document discusses Networking HP 710C, 720C 820C or 1000C Series
+ (PPA Protocol) HP DeskJet printers with non-Windows Hosts or Clients,
+ using SAMBA. Topics include choosing between transmitting PPA or
+ PostScript across the network, Windows and Linux/Unix Hosts, Windows
+ and Linux/Unix Clients, and emulating a PostScript printer on Windows.
+ (Updated for pnm2ppa-1.04 and later.)
+ ______________________________________________________________________
+
+ Table of Contents
+
+
+ 1. Networking HP DeskJet PPA printers with SAMBA
+ 1.1 Overview of PPA printers.
+ 1.2 Choice of protocol for sending over the network.
+
+ 2. Configuring the Printer Host.
+ 2.1 Configuring a Linux/Unix Host to share a PPA printer using Samba.
+ 2.2 Configuring a Windows Host to share a PPA printer with non-Windows Clients.
+
+ 3. Configuring the Printing Clients.
+ 3.1 Setting up Printing from a Windows Client.
+ 3.2 Setting up Printing from a Linux/Unix Samba Client
+
+ 4. Emulating a PostScript printer on a Windows Host.
+ 4.1 Installing Ghostscript as the emulation software.
+ 4.2 Adding the fictitious Postscript printer.
+ 4.3 Redirecting the output to the PPA printer.
+ 4.4 Limitations.
+
+
+ ______________________________________________________________________
+
+ 1. Networking HP DeskJet PPA printers with SAMBA
+
+
+ 1.1. Overview of PPA printers.
+
+ The HP DeskJet 710/712C, 720/722C, 820Cse/820Cxi and 1000Cse/1000Cxi
+ printers are "Winprinters" which are designed only for use with MS
+ Windows operating systems. HP supplies Windows-only software that
+ processes the input data into the proprietary and unpublished PPA
+ ("Printer Performance Architecture") protocol.
+
+ HP states that these printers are not supported as networked printers,
+ but they in fact function correctly as shared (SMB) printers under MS
+ Windows.
+
+ In this document, the Host is the computer to which the PPA printer
+ is physically connected, and the Clients are other computers on the
+ network that wish to print documents on the PPA printer.
+
+ In the Windows printing system, separate copies of the HP PPA printer
+ drivers are installed on each Client, and are run on the Client to
+ produce PPA output that is sent over the network to be spooled on the
+ Host to which the printer is attached.
+
+ HP's drivers are only supplied for Windows systems. The
+ independently-produced pnm2ppa driver runs on Linux, some other Unix
+ systems, and BeOS.
+
+ This document describes various tested strategies for using pnm2ppa
+ and the samba suite of SMB tools to allow the PPA printer to be
+ attached to a non-Windows host on a (TCP-based) SMB network, or to
+ allow non-Windows Clients to receive printing services from a Host on
+ the network.
+
+
+ 1.2. Choice of protocol for sending over the network.
+
+ There are two possible ways to send printer data from a Client to the
+ printer Host over the network.
+
+ o as PPA data, created by a driver on the Client. This is what
+ happens when using conventional printer sharing on Windows.
+
+ o as PostScript data, created on the Client, which is then translated
+ into PPA instructions by drivers running on the printer Host.
+
+ Since PPA data is rather large, the first method involves sending
+ larger amounts of data over the network, which may be why HP do not
+ officially support PPA DeskJets as networked printers. It also
+ requires that PPA drivers are installed on the Client.
+
+ The Host to which the printer is attached can thus provide two classes
+ of printing services:
+
+ o PPA printing services: the Host accepts PPA-format printing jobs
+ created on the Clients either with HP's native PPA drivers (Windows
+ Clients) or pnm2ppa (Unix/Linux/BeOS Clients);
+
+ o PostScript printing services: the Host accepts PostScript-format
+ printing jobs created on any postscript-capable Client, and
+ converts them to PPA format using either HP's native PPA drivers
+ (Windows Host) or pnm2ppa (Unix/Linux/BeOS Host);
+
+ It is useful to set up the Host to offer both types of service,
+ sharing a common spooling system.
+
+
+ 2. Configuring the Printer Host.
+
+
+ 2.1. Configuring a Linux/Unix Host to share a PPA printer using
+ Samba.
+
+ It is assumed that pnm2ppa is installed and working to provide local
+ printing services on the Host, and that lpr will invoke a full set of
+ print filters, as (e.g.) in Red Hat 6.2. The PPA printer is installed
+ with the printer name lp, and samba is assumed to be installed.
+ General Samba configuration issues involving security levels, network
+ password, etc, are outside the scope of this document (see the SMB-
+ HOWTO). You must log in as root to configure Samba.
+
+ Here is a sample entry setting up two public printer shares in the
+ Host's /etc/smb.conf file. The printer HP722C-PPA is for printing by
+ a Client that sends PPA output from pnm2ppa or the HP drivers across
+ the network, and HP722-PS is for Clients that produce PostScript
+ output:
+
+
+
+ [HP722C-PPA]
+ comment = HP 722C printer on Linux (PPA input)
+ path = /var/tmp
+ printer name = lp
+ writable = yes
+ public = yes
+ printable = yes
+ print command = lpr -l -r -h -P %p %s
+ [HP722C-PS]
+ comment = HP 722C printer on Linux (Postscript input)
+ path = /var/tmp
+ printer name = lp
+ writable = yes
+ public = yes
+ printable = yes
+ print command = lpr -r -h -P %p %s
+
+
+
+ The only differences besides the names are that the print command for
+ HP722-PPA uses the " -l " "pass-through" option so print filters are
+ not applied. The path entry uses /var/tmp because this is (presum-
+ ably) a world-readable and -writable area for temporary files.
+
+ After editing /etc/smb.conf to include these entries, save it, and
+ test its syntax with Samba's testparm utility. Then restart samba
+ (run "/etc/rc.d/init.d/smb restart" on Red Hat).
+
+
+
+ 2.2. Configuring a Windows Host to share a PPA printer with non-Win-
+ dows Clients.
+
+ The Host is assumed to be a Window 98 system, and the PPA printer is
+ assumed to be a HP722C installed with the native HP PPA drivers
+ supplied on HP's installation CD. Some details may vary on other
+ Windows versions.
+
+ First set up a shared printer that can accept PPA input from both
+ networked Windows Clients, and from networked non-Windows Clients that
+ use pnm2ppa.
+
+
+ o IMPORTANT!: A PPA printer attached to a Windows Host shared with a
+ Client running pnm2ppa has the following limitation:
+
+ o Bi-Directional communication between the Windows Host and the
+ printer must be disabled.
+
+ If it is not done, a General Protection Fault will usually occur on
+ the Windows Host when pnm2ppa sends output to the shared printer.
+ (A "Hpfbkg06" error occurs, and the printer becomes nonfunctional
+ until the Windows system is rebooted.) Disabling bi-directional
+ communication appears to be a minor inconvenience: according to HP,
+ the print quality is unaffected, but the "advanced features of the
+ Status Monitor" will no longer send reminders to align the print
+ cartridges after a new cartridge is installed, or send error mes-
+ sages associated with the ink cartridges or the banner lever.
+
+ You may be able to avoid disabling bi-directional communication by
+ using an emulated Postscript printer to serve non-Windows Clients
+ without using pnm2ppa (see below).
+
+
+ To turn off bi-directional communication between the Windows Host and
+ the printer, open the Settings/Printers folder, then right-click on
+ the printer icon, and open the Properties dialog. Select the Details
+ tab, and click on Spool Settings, then choose the setting "Disable bi-
+ directional support for this printer". If you have any difficulties,
+ try rebooting Windows after the change, or see HP's support document
+ http://www.hp.com/cposupport/printers/support_doc/bpd06455.html about
+ disabling bi-directional communication.
+
+ To set up the Host to share the printer, right-click on its icon in
+ the Settings/Printers folder, and select Sharing, then assign it a
+ Share Name like HP722C-PPA , and enter a Comment Line like "HP 722C
+ printer on Windows 98 (PPA input)".
+
+ You may now also wish to set up an emulated Postscript printer that
+ accepts Postscript input from the Client, and prints it using HP's PPA
+ drivers running on the Host, instead of on the Client. See the
+ section Emulating a PostScript printer on a Windows Host
+
+ If you have installed and successfully tested the emulated printer,
+ set it up for sharing on the network. Right-click on its icon in the
+ Settings/Printers folder, and select Sharing, then assign it a Share
+ Name like HP722C-PS, and enter a Comment Line like "HP 722C printer
+ on Windows 98 (PostScript input)".
+
+ The emulated printer will appear like a Postscript printer to the
+ Clients. If it provides acceptable printing services to the non-
+ Windows clients, you will not need to connect pnm2ppa printers to
+ HP722C-PPA, and will be able to re-enable bi-directional communication
+ between the HP drivers and the printer. (However, the extra
+ processing involved in the emulation may be unacceptably slow, or turn
+ out to use too much of the host's CPU)
+
+
+
+ 3. Configuring the Printing Clients.
+
+
+ 3.1. Setting up Printing from a Windows Client.
+
+
+ Open the Settings/Printers folder, and start the Add Printer Wizard.
+ Choose to add a Network Printer, and browse the network to find the
+ Printer Shares you configured on the host (e.g., HP722C-PPA and
+ HP722C-PS). If they are not visible, either the Host or the network
+ is not properly configured. Correct the problem before proceding.
+
+ Normally, you will probably want to use the native Windows HP PPA
+ drivers, so select the printer Share that accepts PPA input (e.g.,
+ HP722C-PPA). If the Host is a Windows Host, it will provide the
+ drivers over the network, otherwise you will have to find the printer
+ in the list of available HP Printer drivers, or click on Have Disk
+ and install them from HP's installation CD. You then get a chance to
+ change the name with which the printer will be known on the Client.
+ Finally, you should choose to print a test page.
+
+ You might instead (or also) want to set up printing services using the
+ Printer Share that accepts Postscript (e.g., HP722C-PS). In that
+ case, if the Host is not a Windows Host, choose a "generic" PostScript
+ printer like the Apple LaserWriter II NT or the Digital
+ turboPrintServer 20/Net.
+
+ If the test page prints sucessfully, you are finished!
+
+
+
+ 3.2. Setting up Printing from a Linux/Unix Samba Client
+
+
+ First examine the network by opening a terminal window and using the
+ command
+
+
+ smbclient -L hostname
+
+
+
+ (where "hostname" should be replaced by the network name of the Host
+ to which the printer is attached). This will list the SMB services
+ provided by that Host. (Alternatively, your system may have some
+ graphical front-end to smbclient that allows you to inspect the net-
+ work.) The list should include the Printer Share(s) you configured on
+ the Host (e.g., HP722C-PPA and HP722C-PS). If these are absent, you
+ must first identify and correct the problem.
+
+ You must now configure the printer. The details of how to do this
+ will vary between Linux/Unix distributions, but there will probably be
+ support for network printing using Samba.
+
+ If the Printer Share you wish to use is intended to accept PPA input
+ (e.g., HP722C-PPA), configure the Client to use the pnm2ppa driver.
+
+ If it is intended to accept PostScript input (e.g., HP722C-PS),
+ configure the Client to print to a PostScript printer.
+
+ You may wish to configure both types of printers, and experiment to
+ see which provides the best printing services on your network.
+
+ See the SMB-HOWTO documentation for more information.
+
+
+
+ 4. Emulating a PostScript printer on a Windows Host.
+
+
+ If you do not have commercial PostScript emulation software for
+ Windows that will work with your HP PPA DeskJet (the author is unaware
+ of any such software that supports PPA printers), you can use
+ Ghostscript together with HP's native Windows drivers.
+
+
+ 4.1. Installing Ghostscript as the emulation software.
+
+ From the Ghostscript home page http://www.cs.wisc.edu/~ghost/ download
+ and install (in this order) the Windows packages of
+
+ o Ghostscript (PostScript Emulation Software).
+
+ o GSview (Ghostscript previewer, provides gsprint).
+
+ o RedMon (printer port redirection utility).
+
+ (Install these using their setup.exe installation tools, and do not
+ manually set up any configuration files for gsprint or RedMon.)
+ You must now follow the detailed instructions below, and use the
+ Windows "Add Printer Wizard" to add a postscript printer, and then
+ configure it to use the gsprint utility that comes with GSview, and
+ redirect the output to your HP PPA DeskJet using the RedMon
+ utility.
+
+
+ 4.2. Adding the fictitious Postscript printer.
+
+ In the following, I assume your printer is a HP DeskJet 722C, and is
+ installed with its native Windows Drivers as a printer called "HP
+ DeskJet 720C Series". Change printer name entries below as
+ appropriate for your printer model.
+
+ The following instructions are tested on Windows 98, and may differ on
+ other Windows variants.
+
+ Open the Settings/Printers folder.
+
+ First check that the HP PPA Deskjet is correctly installed, using HP's
+ native Windows drivers. Right-click on its icon, and select its
+ Properties dialog. The General Properties screen will open. This
+ shows the exact name that the printer was given when it was installed.
+ Make a note of it, and use the Print Test Page button to confirm that
+ the printer is working. (The "Printer name:" line on the test page
+ will also show the exact name of the HP PPA Deskjet that you will need
+ to use when configuring the emulated postscript printer below). When
+ you are done, click on OK to close the dialog.
+
+ Now start the Add Printer "Wizard". Make the choices:
+
+ o install a local printer
+
+ o select a PostScript printer from the list of printers; (e.g., one
+ of the Apple LaserWriter models: the Laserwriter II NT is known to
+ work; Digital PrintServer models such as the turboPrintServer
+ 20/Net have also been recommended). This will provide a suitable
+ postscript driver.
+
+ o From the list of Available Ports, choose "FILE: Creates a file on
+ disk" (you will change this after the printer is installed)
+
+ o set as default printer?: NO
+
+ o Print test page?: NO
+
+
+ 4.3. Redirecting the output to the PPA printer.
+
+ After the printer has been installed, right-click on its icon, and
+ rename it to something like, e.g., "Ghostscript+HP722C". Then right
+ click again and open its Properties dialog.
+
+ On the General tab screen, enter something informative in the Comment
+ box, such as " Emulated Postscript printer; output redirected to a
+ HP722C DeskJet printer" (optional).
+
+ Next select the Details tab. The box "Print using the following
+ driver:" should show the Postscript driver you selected (e.g., Apple
+ LaserWriter II NT).
+
+
+ o Click on Add Port. Select other, then Redirected Port, which
+ should be available if RedMon was correctly installed, and click
+ on OK to accept these settings and close the Add Port dialog. On
+ the Details tab screen, The box "Print to the following port:"
+ should now show a redirected port such as "RPT1 [Redirected
+ Port]".
+
+ o Click on Port Settings.
+
+ o In the box "Redirect port to the program:", enter the path to
+ the gsprint program. (If you accepted the defaults when
+ installing it, this may be C:\Ghostgum\gsview\gsprint.exe; you
+ may search for it by clicking on Browse).
+
+ o In the box "arguments for this program are:" enter the arguments
+ to be passed to the gsprint program (there is a document
+ gsprint.htm with more details of these in the folder containing
+ gsprint.exe). Suggested arguments are:
+
+
+ -printer "HP DeskJet 720C Series" -color -
+
+
+
+ Replace "HP DeskJet 720C Series" by the (quoted) exact name of the
+ HP PPA DeskJet printer that you made a note of earlier. (If you do
+ not copy this name exactly, including any capitalization or spaces,
+ things may not work!) The -color argument is needed to enable
+ color printing; (Whether you actually get color printing will
+ depend on the local settings of the "HP DeskJet 720C Series"
+ printer that really prints the document.) The final " - " is
+ required: without it, the output of gsprint will not get redi-
+ rected to the printer.
+
+
+ o The box "Output" should show "Program handles output".
+
+ o In the box "Run", select "hidden".
+
+ o The box "Shutdown delay" will say "300 seconds". Print jobs for
+ which processing by gsprint takes longer than this will be
+ terminated, to avoid blocking the printer spool queue.
+ Increase this limit if necessary.
+
+
+ Now click on OK to close the Port Settings dialog.
+
+
+ o Click on Spool Settings, and select "Disable bi-directional support
+ for this printer", and click OK.
+
+ Finally, again select the General tab, and test the installation by
+ clicking on "Print a test page". If it works, you are finished
+ setting up Postscript emulation. Click OK to exit the Printer
+ Properties dialog.
+
+ (If you have problems, first check that you made the correct entries
+ in the Printer Properties dialogs, especially check that you did not
+ make any typing errors in the exact name for the PPA DeskJet printer
+ in the gsprint arguments box, which must correspond exactly to the
+ "Printer name" given to the HP PPA printer). If the problems persist,
+ you might get guidance from the gsprint and RedMon documentation; look
+ in the folders where these were installed.)
+
+ You now have a working emulated "Postscript printer" that can now be
+ shared over a network. (The "sharing" options will now be available
+ if you right-click on the emulated printer's icon.)
+
+
+ 4.4. Limitations.
+
+ This emulated postscript printer is most useful for providing printing
+ services to non-Windows Clients on a samba network, but can be also be
+ used by Windows Clients with the following limitations:
+
+
+ o Windows Clients will be able to select Print Settings only for the
+ visible ("front end") "Postscript printer", but not for the hidden
+ ("back end") HP PPA DeskJet printer that actually does the
+ printing.
+
+ o Changes in the local Print Settings of the PPA driver for the
+ DeskJet printer on the Host system (but not on Client systems, if
+ it too is shared) will affect network printing by the "Postscript
+ printer".
+
+ o Since the visible "Postscript printer" falsely advertises its
+ identity, some of its Print Settings options seen by users on the
+ Clients may not be valid.
+
+ o The extra processing on the printer Host may make printing rather
+ slow compared to native Windows printing.
+
+
+
diff --git a/docs/en/README b/docs/en/README
index 9be5f84..32d531b 100644
--- a/docs/en/README
+++ b/docs/en/README
@@ -38,11 +38,11 @@
------------
If you need help using this software, you can send a message to the
-ppa.users mailing list, or post your concerns on one of the SourceForge
-forums. Subscribe to the mailing lists at
-http://pnm2ppa.sourceforge.net/maillist.htm
-and visit the SourceForge page at
+pnm2ppa-users@lists.sourceforge.net mailing list, or post your concerns on
+one of the SourceForge forums. Subscribe to the mailing lists at
http://sourceforge.net/projects/pnm2ppa
+(Note the old pnm2ppa mailing lists which used the ListBot service
+died with that service!)
@@ -51,3 +51,4 @@
+
diff --git a/docs/en/RELEASE-NOTES b/docs/en/RELEASE-NOTES
index 4d07752..c9c98a7 100644
--- a/docs/en/RELEASE-NOTES
+++ b/docs/en/RELEASE-NOTES
@@ -1,3 +1,34 @@
+Release notes for pnm2ppa-1.11 October 2002
+
+- pnm2ppa-1.10 had problems with HP820C printers. Hopefully, these
+ are fixed.
+- Also fixed: a memory leak affected all printer models
+ in certain circumstances: in high quality mode, if the last
+ data on a page was in color, the final three print head passes
+ were not printed, and the data was left in unfreed memory.
+ (discovered using the "valgrind" memory-leak detector).
+- compression of color data sent to the printer is now enabled.
+ (only compression of black data was previously enabled).
+ If it is suspected this is causing problems, it can be disabled by
+ a new configuration file keyword "compression 0".
+- Logging of normal informational messages to the system log is
+ now turned off by default. (They still go to stderr in "verbose" mode).
+ Logging of information messages in the System Log can be re-enabled with
+ a new configuration-file entry "log_info 1": this is only accepted
+ from the default configuration file (/etc/pnm2ppa.conf).
+--------------------------------------------
+Release notes for pnm2ppa-1.10 June 23 2002
+
+- major rework of swath-cutting internals so black ink
+ is never overprinted by color ink, and multipass color
+ printing is bidirectional. Only tested on HP722C.
+ Should have much better image quality now, we will have to see
+ if the redesign has broken printing on HP820C, 1000C...
+ Is anyone still using these PPA printers?
+- new: a --dpi300 command line option for interpreting the
+ input as 300dpi instead of 600dpi. This may be useful for
+ printing 300dpi pnm output directly from scanners.
+-----------------------------------------------------
Release notes for pnm2ppa-1.04 November 12 2000
- reduced memory footprint of calibrate_ppa from 36MB to 1.8MB
@@ -57,16 +88,18 @@
Such changes will require significant effort (by someone highly motivated)
to be achieved. pnm2ppa is probably as good as it can get by tweaking its
code with little bug fixes.
+[FIXED IN v1.10]
Improvements in color correction techniques could still be achieved,
though (see docs/en/COLOR.txt).
Calibration and printer utility procedures (head cleaning codes, etc)
could also be added. (perhaps using the PUP utility?)
+[NOW USE calibrate_ppa FOR SOME OF THESE FUNCTIONS]
Use of data compression of sweep data for color sweeps could also be
added without a major rewite, to perhaps speed up printing.
-
+[FIXED IN v1.11]
The pnm2ppa team.
diff --git a/docs/en/TODO b/docs/en/TODO
index 6e3efef..30d3b37 100644
--- a/docs/en/TODO
+++ b/docs/en/TODO
@@ -1,29 +1,20 @@
TODO
+UPDATE (June 10, 2002)
+* Striping in images like ghostscript' example image "tiger.ps'
+ has been eliminated by just making sure that black ink is never overprinted
+ by color ink. A major reworking to cutswath.c and some improvements to
+ image.c were needed. This is probably the final work done on this driver..
+--------------------------------
Code issues (comments by duncan):
* implement data compression for color as well as
black and white printing.
-* bidirectional printing is not fully consistent (It is not clear
- ahead of time whether the next sweep will be color or black, and thus
- when the sweep changes from black to color or vice-versa, the sweep
- direction may not reverse.)
* check out the new information about the buffer on the printer.
(mentioned on ppa.devel by andrew in early 2000)
* cleaning head codes needed. (or put them into PUP);
document the codes in the ppa docs here.
* should multiple color sweeps in a swath (gMaxpass=4)
alternate between right-to-left and left-to-right ?
-* Printing of e.g. tiger.ps (an example included with ghostscript)
- shows lines between swaths. The Windows driver does not. This is because
- the four passes of the color head (gMaxPass=4) are all at the same
- vertical position. This is not the way to e.g. paint a wall using a
- paint roller - instead the successive passes should be vertically
- staggered so their swath boundaries are not all at the same vertical
- position. The Windows driver does this: the vertical position of pass 2
- is 1/4 of a swath height below pass 1, etc. Unfortunately, the design
- decisions in cutswath.c make this not a simple change. Initial changes
- would be to somehow decouple the four sweeps, so they could have independent
- left and right values, directions, vertical positions, etc.
* The Windows driver also has a "normal" mode with gMaxPass=2, and well
as "econofast" (gMaxPass=1) and high quality (gMaxPass=4). It
@@ -36,8 +27,6 @@
* A FS_black_dither routine is needed in black-only printing, for high-quality
black-only images.
-* Internationalization ("i18n") should be done with GNU gettext and .po files,
- not the current hack.
* add autodetection of device via IEEE 1284 and other methods
* redo debugging support (done ajv)
diff --git a/docs/en/pnm2ppa.1 b/docs/en/pnm2ppa.1
index 1973d28..35fd7f1 100644
--- a/docs/en/pnm2ppa.1
+++ b/docs/en/pnm2ppa.1
@@ -1,4 +1,4 @@
-.TH pnm2ppa "28 Oct 2000"
+.TH pnm2ppa "23 Jun 2002"
.SH NAME
pnm2ppa - convert portable anymap (PNM) images to HP's PPA printer format.
.SH SYNOPSIS
@@ -15,6 +15,10 @@
(PNM format output can be produced from PostScript(tm) input by the
GhostScript output devices "pbmraw", "pgmraw" or "ppmraw", or by "pnmraw",
which will choose one of these formats as appropriate for the document.)
+\fBpnm2ppa\fP assumes the input resolution is 600dpi (or 300dpi if
+the command-line option \fB--dpi300\fP is used): input at higher/lower
+resolutions will result in a correspondingly larger/smaller printed image,
+provided it is within the printer's allowed size range.
.PP
.SH OPTIONS
@@ -41,6 +45,11 @@
.\"{{{ -d
.IP "\fB\-d\fP"
Displays the current configuration.
+.\"}}}
+
+.\"{{{ --dpi300
+.IP "\fB\--dpi300\fP"
+Treat input resolution as 300dpi instead of 600dpi.
.\"}}}
.\"{{{ --eco
@@ -191,7 +200,7 @@
.PP
(c) 1999 Andrew van der Stock
.PP
-(c) 1998-2000 Various authors for many, many fixes
+(c) 1998-2002 Various authors for many, many fixes
.SH HISTORY
This program was originally pbm2ppa, written by Tim Norman. It originally
supported black and white output on the 820 series.
@@ -202,5 +211,6 @@
http://sourceforge.net/projects/pnm2ppa.
.SH BUGS
Faint horizontal lines marking boundaries between print sweeps may be visible.
-For best results when printing images, use the options \fB -p --uni \fP.
-
+You may get better results when printing images, with the options:
+ \fB -p --uni \fP (this may no longer apply since recent code improvements).
+
diff --git a/docs/en/sgml/INSTALL.MANDRAKE.sgml b/docs/en/sgml/INSTALL.MANDRAKE.sgml
index 7aca2aa..0499b27 100644
--- a/docs/en/sgml/INSTALL.MANDRAKE.sgml
+++ b/docs/en/sgml/INSTALL.MANDRAKE.sgml
@@ -7,7 +7,7 @@
The pnm2ppa project team
-v0.1 Nov 11, 2000
+v0.2 June 11, 2002
Information about using pnm2ppa
with Mandrake.
@@ -27,6 +27,20 @@
for installation and setup. That document is written
for Red Hat; note the Mandrake-specific differences
listed below,
+
+ To update pnm2ppa
+in any recent Mandrake release (7.2 or later) from v1.04 to v1.10,
+the simplest procedure may be
+just to compile pnm2ppa from tarball source and replace the Mandake binaries
+/usr/bin/pnm2ppa and /usr/bin/calibrate_ppa with
+the new versions. They should function as drop-in replacements,
+with the same user interface, but improved image quality.
+(You may also wish to use the newer pnm2ppa.conf configuration
+file template).
+
+
+
+
Mandrake 7.0 and earlier has incompatible and non-functional
diff --git a/docs/en/sgml/INSTALL.REDHAT.sgml b/docs/en/sgml/INSTALL.REDHAT.sgml
index 1279f08..3b0bda3 100644
--- a/docs/en/sgml/INSTALL.REDHAT.sgml
+++ b/docs/en/sgml/INSTALL.REDHAT.sgml
@@ -7,7 +7,7 @@
The pnm2ppa project team
-v0.27, Nov 11, 2000
+v0.30, July 9, 2002
Information and installation instructions
to accompany pnm2ppa packages
@@ -15,7 +15,7 @@
-(Updated for pnm2ppa-1.04 and later.)
+(Updated for pnm2ppa-1.10 and Red Hat 6.2 or later.)
See the "Troubleshooting" section at the end of
this document for
fixes to some reported problems
@@ -28,11 +28,14 @@
Overview of HP's PPA DeskJet Printers.
Most of Hewlett-Packard's DeskJet(tm) printers use the PCL3 command language,
-and are currently supported by Ghostscript drivers. However, a few models,
+and are currently supported by Ghostscript drivers. However, a few legacy
+models,
namely
DeskJet 710C Series: HP DeskJet 710C, 712C
+(discontinued)DeskJet 720C Series: HP DeskJet 720C, 722C
+(discontinued)DeskJet 820C Series: HP DeskJet 820Cxi, 820Cse
(discontinued)DeskJet 1000C Series: HP DeskJet 1000Cxi, 1000Cse
@@ -44,16 +47,21 @@
PPA (Printer Performance Architecture) protocol,
instead of PCL. The two models in each series are physically
identical;
-they just come with different bundled Windows software.
-The 820C and 1000C series are discontinued at this time (January 2000).
+they just came with different bundled Windows software.
+All PPA printers are now discontinued from HP's product lines,
+but may still be found as second-hand legacy items.
PPA printers rely on software running on the
host CPU to carry out the low-level processing
of printer output that would be done by hardware in
a standard PCL printer. The relation of PPA printers to PCL printers
is analogous to the relation between "Winmodems" and true modems.
-
-Unfortunately, HP only supplies Windows software drivers for PPA printers,
+Presumably, the idea at the time was that this would allow cheaper hardware
+to be used, but the decline in hardware prices probably meant that
+the savings were not significant, and PPA printing seems to have been
+abandoned.
+
+Unfortunately, HP only supplied Windows software drivers for PPA printers,
and have indicated that it is unlikely that
they will ever make the proprietary PPA specs public.
This is apparently because of concerns that
@@ -66,38 +74,44 @@
and it seems that HP do not wish to take any responsibility for such damage by
encouraging unofficial PPA programming.)
-In fact,
-the decline in hardware component prices has meant that the anticipated
-cost-savings through using host-based PPA instead of printer-based PCL
-are less than expected, and two of the PPA printer series
-(820C, 1000C) have been phased out, and replaced by similar PCL printers
-in HP's product line. The 710C and 720C series are still being sold
-at this time of writing. All other currently-offered
-DeskJet models appear to be standard PCL3
-printers.
-
-
-Many Linux users may have inadvertently purchased PPA DeskJet models,
-mistaking them for PCL3 DeskJets, for which independently-produced
-Linux drivers have long
-been available. Fortunately, a reverse engineering effort,
+In the past, Linux users often inadvertently purchased PPA DeskJet models,
+mistaking them for PCL3 DeskJets, which have traditionally
+been well-supported
+by Linux drivers.
+Fortunately, a reverse engineering effort,
started in 1998 by Tim Norman,
-
-and
+and continued by the pnm2ppa project at
,
-and continued by the pnm2ppa project at
+and
has managed to produce drivers that provide basic printing
functionality for these PPA printers under Linux and other
-Unices.
-
-
+Unices. While HP have recently begun to release their own Linux
+drivers for PCL3 DeskJets, they have not included drivers for their legacy
+PPA printers in this effort.
+
+The pnm2ppa driver has been stable since v1.04, released
+October 2000, with no known reproducible bugs, except that image printing
+quality was not so good. This version has been distributed with
+Red Hat, and other Linux distributions. v1.10, released July 2002,
+contains a lot of changes that improve image quality, in particular
+by improved bidirectional printing, and
+always printing black on top of color.
+
+A better improvement would be for someone to make a PPA backend to
+, using
+pnm2ppa as a guide for how to send data to PPA printers.
+But, since PPA printers are now "legacy" hardware, and
+pnm2ppa appears to
+work fine for most printing tasks, it is unlikely that any new developers will
+be interested in doing this, and there is currently no further development
+anticipated. The project is currently in "low-maintenance mode".
The pnm2ppa driver for color printing with PPA printers.
@@ -106,11 +120,10 @@
pnm2ppa driver which is the successor to the older
black-and-white-only driver
developed by Tim Norman.
-
+name="pbm2ppa-0.8.6"> developed by Tim Norman.
pnm2ppa
-can translate portable anymap (pnm)
+translates portable anymap (pnm)
format images into a stream of PPA instructions which can be sent to the
printer. In the driver name,
"pnm" stands for the superset
@@ -136,9 +149,9 @@
The last two output devices are switches that try to analyze the
image, and select an appropriate format; however, they are not
recommended for routine use, as they may inconsistently choose the format.
-The ghostscript-5.10
-package supplied with Red Hat 6.x distributions provides all these
-devices; older versions may not. To see the list of available
+The ghostscript
+packages supplied with all recent Red Hat distributions provides all these
+devices. To see the list of available
ghostscript output devices, type the command line
gs --help
@@ -173,23 +186,33 @@
and -v 720 specifies the PPA printer as belonging
to the DeskJet 720C series.
+
+pnm2ppa expects that the input resolution is 600dpi
+(or 300dpi if it is called with the pnm2ppa --dpi300 ...option).
+This corresponds to the gs -r600 ... or
+gs -r300 ... ghostscript options.
+If other higher/lower input resolutions are used, the size of
+the printed image will be larger/smaller, provided it is
+within the printer's allowed size range.
+
Obviously, it would be impractical to type such a command each time
-one wished to print something, so in addition to the pnm2ppa
-driver itself, an enhanced version of Red Hat's rhs-printfilters
-RPM package is provided; after this is installed, the PPA printer
-can be managed like other standard printers with the Red Hat
-printtool utility. The postscript file can then be printed with
+one wished to print something, and since RedHat 6.2, printfilter
+support for pnm2ppa is built into Red Hat's printer
+configuration scheme, so after configuration,
the simple command
lpr file.ps
-
+should successfully print a postscript file.
+However, in case you wish to check if something
+is misconfigured in the print filters, you can use a script like the
+above one to bypass them and check that the printer is working.
-However, if you wish to print to paper sizes supported by ghostscript,
-but not supported by the Red Hat printtool utility, you can
+Also, if you wish to print to paper sizes supported by ghostscript,
+but not supported by the Red Hat Printer configuration utilities, you can
use scripts like the one above.
The HP 710C, 720C, and 820C series support paper sizes from
3"x3" to 8.5"x14", while the 1000C
@@ -199,7 +222,6 @@
Available RPM packages.
-
A RPM package for pnm2ppa is part of the Red Hat Linux
distribution starting with Red Hat 6.2.
You will also find a RPM package for the latest release of
@@ -211,33 +233,30 @@
The latest version at the time
of writing is
-pnm2ppa-1.04-1.i386.rpm, and is built on
-Red Hat 6.2. If you are running a different release
+pnm2ppa-1.10-1rh7x.i386.rpm, and is built on
+Red Hat 7.3, or
+pnm2ppa-1.10-1rh62.i386.rpm, built on
+Red Hat 6.2.
+If you are running a different release
of Red Hat (or a different Linux distribution)
you may need to download and rebuild the source RPM
-pnm2ppa-1.04-1.src.rpm instead:
-
-rpm --rebuild pnm2ppa-1.04-1.src.rpm
+pnm2ppa-1.10-1.src.rpm instead:
+
+rpm --rebuild pnm2ppa-1.10-1.src.rpm
(You must be root to do this, and have the necessary
compilers installed; on Red Hat, the rebuilt binary RPM will be created in
the directory /usr/src/redhat/RPMS/i386/.)
Red Hat 6.2 and later also includes support for configuring your
-printer to use pnm2ppa using printtool
-and rhs-printfilters.
-If you are using Red Hat 6.1 and earlier,you will need to
-update the rhs-printfilters that came with the distribution
-to the
-rhs-printfilters-1.57-4ppa4.i386.rpm also available at
-.
-(This is designed to work only with printtool-3.43 and earlier.)
-
-
-Note: If you are using Red Hat 6.2, you may wish to update the
-print filter support that it comes with. The pnm2ppa-1.04-1
+printer to use pnm2ppa.
+(Information necessary for configuring
+pnm2ppa on older Red Hat releases has been removed from
+this document; for this, see the documentation that came with
+pnm2ppa-1.04, or update your RedHat distribution.)
+Note: If you are still using Red Hat 6.2, you may wish to update the
+print filter support for pnm2ppa that comes with it.
+The pnm2ppa-1.10-1rh62*
RPM package supplies the necessary files that you can use.
After installing this RPM, see
/usr/lib/rhs/rhs-printfilters/README.ppa for details.
@@ -250,32 +269,20 @@
Now begin the installation. First install the pnm2ppa RPM:
-rpm -Uvh pnm2ppa-1.04-1.i386.rpm
+rpm -Uvh pnm2ppa-1.10-1*.i386.rpm
The pnm2ppa executable gets installed in /usr/bin/.
-If you are using a 2.2.x kernel,
-(e.g. Red Hat 6.x)
-it will be able to autodetect
+The Linux kernel will be able to autodetect
IEEE-1284 devices like PPA printers, provided they are attached
to the parallel port with a bidirectional IEEE-1284 cable. (If your
printer works under Windows, you have the correct cable.)
-(Note that older (2.0.x) kernels do not have this autoprobe facility.)
A script detect_ppa is provided by the pnm2ppa
RPM: just type
detect_ppa
to confirm that your Printer is found.
-
-It is possible (especially on Red Hat 6.1) that you will have to add
-a line
-
-alias parport_lowlevel parport_pc
-
-to the file /etc/conf.modules for the printer to be found (this is
-a parallel port recognition issue, not specific to PPA printers.
-and a known "gotcha" on Red Hat 6.1).
A typical message from the printer, which will
be displayed if autodetection is successful, is:
@@ -295,8 +302,7 @@
printer model (710, 712, 720, 722, 820, 1000), your paper size
(letter, legal, a4) and the printer port the printer is attached to.
If it is attached to the primary parallel port, this is
-/dev/lp1 under older 2.0.x kernels, and (usually)
-/dev/lp0 under newer 2.2.x kernels, as in Red Hat 6.x.
+(usually) /dev/lp0.
Type
test_ppa
@@ -309,50 +315,59 @@
Tip:
The test_ppa script
-does not use the print filters that
-will be installed by the rhs-printfilters RPM, so it is
+does not use the Red Hat print filters, so it is
useful when troubleshooting, for testing if any printing problems are
associated with the basic printer installation, or with the
configuration of the print filters.
-
- Installing the PPA-enhanced rhs-printfilters RPM package (if needed).
-
-
-
-This step is NOT needed on Red Hat 6.2 or later.
-
-
-The rhs-printfilters rpm distributed with
-Red Hat 6.1 does not support pnm2ppa,
-If you use an older distribution, you will first have to replace their
-rhs-printfilters RPM with the PPA-enhanced version from the
-pnm2ppa project.
-
-Once you have confirmed you have a working printer, install the
-RPM rhs-printfilters-1.57-4ppa4.i386.rpm
-
-rpm -Uvh rhs-printfilters-1.57-4ppa4.i386.rpm
-
-
- Configuring the print filters with printtool.
-
-Now start the "Red Hat Linux Print System Manager"
+
+ Configuring the print filters.
+
+Note: Red Hat 7.3 now features either CUPS or LPRng printer management.
+The configuration tools should be able to configure pnm2ppa,
+using the information about it taken from the Linux Printer Database.
+Apart from the addition of a new --dpi300 option
+to accept 300dpi input (useful for printing PNM output from 300dpi scanners),
+there have been no changes in the pnm2ppa command line since the pnm2ppa-1.0
+release, so the configuration scripts are stable. (They
+can only use the default 600dpi input mode.)
+
+Since Red Hat 7.1, there is a graphical
+printer configuration utility printconf-gui. In Red Hat 6.2 and
+7.0, the older configuration utility called printtool is used.
+In either case,
+start the "Red Hat Linux Print System Manager"
(as root) to
configure the printer, either
-by clicking on the printer icon in Red Hat's "control-panel", or just
-typing
+by clicking on the printer icon in Red Hat's "control-panel",
+ or just typing
printtool
-In the Print System Manager window, click on Add, then
+which also starts printconf-gui in the newer Red Hat releases.
+
+
+ Configuring the print filters with the Red Hat 6.2/7.0 printtool
+
+(Skip this section unless you are still using Red Hat 6.2 or 7.0)
+
+The following description is for the older printtool that
+is used by Red Hat 6.2/7.0. The printer configuration utility
+printconf-gui for Red Hat 7.1 and later
+is a little different, as it is based on the foomatic printer
+configuration database which contains entries for pnm2ppa
+(but not the older pbm2ppa). You should be able to easily figure out
+what to do: it can configure all pnm2ppa command-line options in the
+Driver Options screen.
+
+In the Red Hat 6.2/7.0 Print System Manager window, click on Add, then
in the "Add a Printer Entry", select Local Printer, and
click Ok. Hopefully, the port on which the printer is attached
will be listed as "Detected" (if not,
fix the problem before continuing, perhaps by
adding the line "alias parport_lowlevel parport_pc"
-to /etc/conf.modules), as mentioned above.
+to /etc/conf.modules).
You will now have to "edit
the local printer entry" for the PPA printer. Click on
Select to chose the "Input filter".
@@ -363,18 +378,7 @@
HP DeskJet 1000 series (PPA) (for 1000Cse, 1000Cxi models)
HP DeskJet 710/720 series (PPA) (for 710C, 712C, 720C, 722C models)
HP DeskJet 820 series (PPA) (for 820Cse, 820Cxi models)
-
- If these entries do not show up, it may be because the older
-rhs-printfilters package that you updated did not allow
-the printer database /usr/lib/rhs/rhs-printfilters/printerdb
-to be replaced. Try deleting or renaming the printerdb
-file, and then reinstall
-the PPA-enhanced rhs-printfilters RPM using
-"rpm --force -Uvh rhs-printfilters*"
-
-
-
-
+
Select the appropriate
entry for your printer model. You will then be presented with
various options:
@@ -598,26 +602,42 @@
If you wish to specify these
parameters using the command-line options
-described above, some of them can be
+described above, in Red Hat 6.2/7.0 some of them can be
entered in the "extra GS options" box using the Print System Manager
(printtool), as described above.
-
+In Red Hat 7.1 and later, all command-line options can be set using the new
+printconf-gui utility.
Utility programs for the printer.
HP's Windows software provides a utility program
that sends PPA commands to tell the printer to perform
-taks like cleaning the printheads, etc. The codes for some
-of these functions have already been reverse engineered.
-There are proposals to add support for PPA printers to the
+tasks like cleaning the printheads, etc.
+
+On Red Hat Linux, You can use test_ppa
+(which acts as a command-line front-end for
+calibrate_ppa) to print head-cleaning patterns.
+
+There is a graphical (gtk-based) tool
+written by Javier Sedano
+for creating
+a pnm2ppa.conf file and acting as a front end to
+calibrate_ppa.
+This is called ppaSet, and a beta version of it can be found
+in the same place as the pnm2ppa-1.10 distribution
+at
+
+There was also at one time a proposal to add support for PPA printers to the
PUP (Printer Utility Program) utility, which is
also a project at
.
However, as of the time of writing, no PUP support
-for PPA printers is available (volunteers, anyone?).
+for PPA printers is available.
Troubleshooting
@@ -628,8 +648,17 @@
(You may need to enable system log messages in
/etc/pnm2ppa.conf, see above.)
Maybe ghostscript failed to convert your postscript file into
-PNM format: this is not a pnm2ppa problem!
-Here are suggestions for dealing with problems that you may encounter.
+PNM format: in that case the system log reports
+"Fatal Error! Input image (pnm2ppa) is not a PNM image".
+(note: when this occured, older versions of pnm2ppa reported
+"Input image is not a supported PNM format" which
+may have been confusing).
+This is because the input received by pnm2ppa was not a valid
+PNM image, but instead ghostscript failed to produce any
+PNM output at all, and its only output was probably just an error message.
+This is not a pnm2ppa problem!
+
+Here are suggestions for dealing with other problems that you may encounter.
Printing fails in the middle of a print run, perhaps
when a figure embedded in the document is printing (in the latest
@@ -638,45 +667,13 @@
reports that read_line could not read the image, and found EOF
(end-of-file). This probably
means that ghostscript's "ppmraw" or
-"pgmraw" output device failed for some reason,
-usually leaving a core dump, without completing the
-translation of the postscript to a pnm format.
+"pgmraw" output device started correctly, but
+failed for some reason before finishing the image conversion
+from postscript to PNM format, usually leaving a core dump.
(This has been seen to happen in ghostscript 5.10 ;
upgrading to ghostscript 5.50 solved the problem.) If you cannot
upgrade, try printing the document
in black-and-white using the ghostscript "pbmraw" output device.
-
-The test_ppa script works,
-but you can't get printtool to make the printfilters work.
-
-You installed pnm2ppa-1.0 and the PPA-enhanced
-rhs-printfilters (earlier than v. 1.61) from the pnm2ppa
-SourceForge page. You are using printtool v. 3.43 or earlier
-and are probably a Mandrake user.
-Solution: (a) use printtool to uninstall the PPA printer;
-(b) delete (or rename) the printer database
-/usr/lib/rhs/rhs-printfilters/printerdb, and reinstall
-the rhs-printfilters RPM using the
-"rpm --force ... "
-option; (c) use printtool to add the
-PPA printer again.
-(Your previously-installed rhs-printfilters may have
-resisted replacement of its printerdb).
-
-You upgraded your RedHat (or compatible) Linux distribution
-and your printfilters no longer work.
-You used to use a PPA-enhanced rhs-printfilters from the
-pnm2ppa SourceForge site. You
-upgraded your distribution to one using printtool v 3.44 or later
-(e.g. RedHat 6.2).
-Solution: Make sure that
-rhs-printfilters has been updated to a version
-1.61 or greater that came with your
-upgraded distribution.
-Use printtool to delete, and then add the
-PPA printer
-This will create a new printer configuration compatible
-with your upgraded distribution.
You printed an image file using a "high quality"
printer setting, but it has visible horizontal lines
@@ -685,11 +682,8 @@
These are probably "swath boundaries",
showing the junction between different sweeps of the print head.
Solution: using unidirectional printing (PPA option --uni,
-or unimode 1 in /etc/pnm2ppa.conf) helps a little, but
-this problem requires an extensive
-rewrite of part of pnm2ppa (cutswath.c)
-for a satisfactory solution. (Volunteers welcome - see the TODO file in the
-pnm2ppa docs (/usr/doc/pnm2ppa*/TODO)!)
+or unimode 1 in /etc/pnm2ppa.conf) helps a little.
+this problem is fixed in the pnm2ppa-1.10 release
"Flashing light syndrome ".
Your printer usually works, but you have found that some particular
@@ -734,14 +728,15 @@
name="ppa-rpms@users.sourceforge.net">
There are three mailing lists,
-ppa.announce (announcements),
-ppa.users (users helping users)
-and ppa.devel (developers).
+pnm2ppa-announce@lists.sourceforge.net (announcements),
+pnm2ppa-users@lists.sourceforge.net (users helping users)
+and pnm2ppa-devel@lists.sourceforge.net (developers).
You can subscribe to them, or browse their
archives, at
.
+url="http://sourceforge.net/projects/pnm2ppa"
+name="http://sourceforge.net/projects/pnm2ppa">.
+(The older pnm2ppa mailing lists died with the ListBot service)
To contact the developers, subscribe to ppa.devel and post a message.
@@ -751,7 +746,7 @@
url="http://sourceforge.net/projects/pnm2ppa"
name="http://sourceforge.net/projects/pnm2ppa">
(but whether you get any help from these, depends on
-whether anyone is reading them).
+whether anyone is reading them (unlikely!)).
diff --git a/docs/en/sgml/PPA_networking.sgml b/docs/en/sgml/PPA_networking.sgml
new file mode 100644
index 0000000..8ae6668
--- /dev/null
+++ b/docs/en/sgml/PPA_networking.sgml
@@ -0,0 +1,517 @@
+
+
+
+
+
+Networking HP PPA DeskJet Printers using SAMBA.
+The pnm2ppa project team
+
+v0.12 Feb 10, 2002
+
+This document discusses Networking HP 710C, 720C 820C or 1000C Series
+(PPA Protocol) HP DeskJet printers with non-Windows Hosts or Clients,
+using SAMBA. Topics include choosing between transmitting PPA or PostScript
+across the network, Windows and Linux/Unix Hosts, Windows and Linux/Unix
+Clients, and emulating a PostScript printer on Windows.
+(Updated for pnm2ppa-1.04 and later.)
+
+
+
+
+
+
+ Networking HP DeskJet PPA printers with SAMBA
+
+ Overview of PPA printers.
+
+The HP DeskJet 710/712C, 720/722C, 820Cse/820Cxi and 1000Cse/1000Cxi
+printers are
+"Winprinters" which are designed only for use with
+MS Windows operating systems. HP supplies Windows-only software
+that processes the input data into the proprietary and unpublished
+PPA ("Printer Performance Architecture") protocol.
+
+HP states that these printers are not supported as networked
+printers, but they in fact function correctly as shared (SMB)
+printers under MS Windows.
+
+In this document, the Host is the computer to which
+the PPA printer is physically connected, and the Clients are
+other computers on the network that wish to print documents
+on the PPA printer.
+
+In the Windows printing system, separate copies of the HP PPA printer drivers
+are installed on each Client, and are run on the Client to produce PPA output
+that is sent over the network to be spooled
+on the Host to which the printer is attached.
+
+HP's drivers are only supplied for Windows systems. The
+independently-produced
+
+driver runs on Linux, some other Unix systems, and BeOS.
+
+This document describes various tested strategies for
+using pnm2ppa and the
+
+suite of SMB tools to allow the PPA printer to be attached to
+a non-Windows host on a (TCP-based) SMB network, or to allow
+non-Windows Clients to receive printing services from a Host
+on the network.
+
+ Choice of protocol for sending over the network.
+
+There are two possible ways to send printer data from a Client to
+the printer Host over the network.
+
+ as PPA data, created by a driver on the Client.
+This is what
+happens when using conventional printer sharing on Windows.
+ as PostScript data, created on the Client, which
+is then translated into PPA instructions by
+drivers running on the printer Host.
+
+Since PPA data is rather large, the first method involves sending
+larger amounts of data over the network, which may be why HP do
+not officially support PPA DeskJets as networked printers. It also
+requires that PPA drivers are installed on the Client.
+
+The Host to which the printer is attached can thus provide two
+classes
+of printing services:
+
+
+PPA printing services: the Host accepts PPA-format
+printing jobs created on the Clients either with HP's native PPA drivers
+(Windows Clients) or pnm2ppa (Unix/Linux/BeOS Clients);
+
+PostScript printing services: the Host accepts PostScript-format
+printing jobs created on any postscript-capable Client, and converts
+them to PPA format using either HP's native PPA drivers
+(Windows Host) or pnm2ppa (Unix/Linux/BeOS Host);
+
+It is useful to set up the Host to offer both types of service,
+sharing a common spooling system.
+
+ Configuring the Printer Host.
+
+ Configuring a Linux/Unix Host to share a PPA printer
+using Samba.
+
+It is assumed that pnm2ppa is installed and working
+to provide local printing services on the Host, and that
+lpr will invoke a full set of print filters, as
+(e.g.) in Red Hat 6.2. The PPA printer is installed with
+the printer name lp, and
+samba is assumed to be installed. General Samba configuration
+issues involving security levels, network password, etc, are outside the
+scope of this document (see the SMB-HOWTO). You must log in as
+root to configure Samba.
+
+Here is a sample entry setting up two public printer shares
+in the Host's /etc/smb.conf file.
+The printer HP722C-PPA is for printing by a Client that sends
+PPA output from pnm2ppa or the HP drivers across
+the network, and HP722-PS is for Clients that produce PostScript
+output:
+
+[HP722C-PPA]
+ comment = HP 722C printer on Linux (PPA input)
+ path = /var/tmp
+ printer name = lp
+ writable = yes
+ public = yes
+ printable = yes
+ print command = lpr -l -r -h -P %p %s
+[HP722C-PS]
+ comment = HP 722C printer on Linux (Postscript input)
+ path = /var/tmp
+ printer name = lp
+ writable = yes
+ public = yes
+ printable = yes
+ print command = lpr -r -h -P %p %s
+
+The only differences besides the names are that the print command
+for HP722-PPA uses the " -l "
+"pass-through" option so print filters are not applied.
+The path entry uses /var/tmp because this is (presumably)
+a world-readable and -writable area for temporary files.
+
+After editing /etc/smb.conf to include these entries,
+save it, and test its syntax with Samba's testparm utility.
+Then restart samba
+(run "/etc/rc.d/init.d/smb restart" on Red Hat).
+
+
+
+ Configuring a Windows Host to share a PPA printer
+with non-Windows Clients.
+
+The Host is assumed to be a Window 98 system, and the PPA
+printer is assumed to be a HP722C installed with the native HP
+PPA drivers supplied on HP's installation CD. Some details may vary
+on other Windows versions.
+
+First set up a shared printer that can accept PPA input
+from both networked Windows Clients, and from
+networked non-Windows Clients
+that use pnm2ppa.
+
+
+IMPORTANT!:
+A PPA printer attached to a Windows Host shared with a
+Client running pnm2ppa has the following limitation:
+
+Bi-Directional communication between the Windows Host and the printer
+must be disabled.
+
+If it is not done,
+a General Protection Fault will usually occur on
+the Windows Host when pnm2ppa sends
+output to the
+shared printer. (A "Hpfbkg06" error occurs,
+and the printer becomes nonfunctional until
+the Windows system is rebooted.)
+Disabling bi-directional communication appears to be a minor inconvenience:
+according to HP, the print quality is unaffected,
+but the
+"advanced features of the Status Monitor"
+will no longer send reminders to align the print cartridges
+after a new cartridge is installed, or
+send error messages
+associated with the ink cartridges
+or the banner lever.
+
+
+You may be able to avoid disabling bi-directional communication
+by using an emulated Postscript
+printer to serve non-Windows Clients without using pnm2ppa
+(see below).
+
+To turn off bi-directional communication between the Windows Host
+and the printer, open the Settings/Printers folder,
+then right-click on the printer icon, and open the Properties
+dialog. Select the Details tab, and click on
+Spool Settings, then choose the setting
+"Disable bi-directional support for this printer".
+If you have any difficulties, try rebooting Windows after the change,
+or see HP's support document
+ about disabling bi-directional communication.
+
+To set up the Host to share the printer, right-click on its
+icon in the Settings/Printers folder, and select Sharing,
+then assign it a Share Name like HP722C-PPA , and enter a Comment
+Line like "HP 722C printer on Windows 98 (PPA input)".
+
+You may now also wish to set up an emulated Postscript printer that
+accepts Postscript input from the Client,
+and prints it using HP's PPA drivers
+running on the Host, instead of on the Client.
+See the section
+
+
+If you have installed and successfully tested the emulated printer,
+set it up for sharing on the network.
+Right-click on its
+icon in the Settings/Printers folder, and select Sharing,
+then assign it a Share Name like HP722C-PS, and enter a Comment
+Line like "HP 722C printer on Windows 98 (PostScript input)".
+
+The emulated printer will appear like a Postscript printer to
+the Clients. If it provides acceptable printing services to
+the non-Windows clients, you will not need to connect pnm2ppa
+printers to HP722C-PPA, and will be able to re-enable bi-directional
+communication between the HP drivers and the printer.
+(However, the extra processing involved in the emulation may be
+unacceptably slow, or turn out to use too much of the host's CPU)
+
+
+ Configuring the Printing Clients.
+
+ Setting up Printing from a Windows Client.
+
+
+Open the Settings/Printers folder, and start the
+Add Printer Wizard. Choose to add a Network Printer,
+and browse the network to find the Printer Shares you configured on
+the host (e.g., HP722C-PPA and HP722C-PS). If they are not visible,
+either the Host or the network is not properly configured. Correct
+the problem before proceding.
+
+Normally, you will probably want to use
+the native Windows HP PPA drivers, so select the printer Share that accepts
+PPA input (e.g., HP722C-PPA). If the Host
+is a Windows Host, it will provide the drivers over the network,
+otherwise you will have to
+find the printer in the list of available HP Printer drivers,
+or click on Have Disk and install them from HP's installation CD.
+You then get a chance to change the name with which the printer will be
+known on the Client. Finally, you should choose to print a test page.
+
+You might instead (or also) want to set up printing
+services using the Printer Share that accepts Postscript
+(e.g., HP722C-PS).
+In that case, if the Host is not a Windows Host, choose a
+"generic" PostScript printer like the
+Apple LaserWriter II NT or the Digital turboPrintServer 20/Net.
+
+If the test page prints sucessfully, you are finished!
+
+
+ Setting up Printing from a Linux/Unix Samba Client
+
+
+First examine the network by opening a terminal window and
+using the command
+smbclient -L hostname
+
+(where "hostname" should be replaced by the
+network name of the Host to which the printer is attached).
+This will list
+the SMB services provided by that Host.
+(Alternatively, your
+system may have some graphical front-end to smbclient
+that allows you to inspect the network.)
+The list should include
+the Printer Share(s) you configured on the Host
+(e.g., HP722C-PPA and HP722C-PS). If these are
+absent, you must first identify and correct the problem.
+
+You must now configure the printer. The details of how to do this
+will vary between Linux/Unix distributions, but there will probably
+be support for network printing using Samba.
+
+If the Printer Share
+you wish to use is intended to accept PPA input
+(e.g., HP722C-PPA), configure the Client to use the pnm2ppa
+driver.
+
+If it is intended to accept PostScript input
+(e.g., HP722C-PS), configure the Client to print to a PostScript printer.
+
+You may wish to configure both types of printers, and experiment
+to see which provides the best printing services on your network.
+
+See the SMB-HOWTO documentation for more information.
+
+
+ Emulating a PostScript printer on a Windows Host.
+
+
+If you do not have commercial PostScript emulation software for Windows that
+will work with your HP PPA DeskJet
+(the author is unaware of any such software that supports PPA printers),
+you can use Ghostscript together with HP's native Windows drivers.
+
+ Installing Ghostscript as the emulation software.
+
+From the Ghostscript home page
+
+download and install (in this order) the Windows packages of
+
+Ghostscript (PostScript Emulation Software).
+GSview (Ghostscript previewer, provides gsprint).
+RedMon (printer port redirection utility).
+
+(Install these using their setup.exe
+installation tools, and do not manually
+set up any configuration files for gsprint
+or RedMon.)
+You must now follow the detailed instructions below, and
+use the Windows "Add Printer Wizard" to add a postscript
+printer, and then
+configure it to use the gsprint utility that comes with
+GSview, and redirect the output to your HP PPA DeskJet using the RedMon utility.
+
+
+ Adding the fictitious Postscript printer.
+
+In the following, I assume your printer is a HP DeskJet 722C,
+and is installed with its native Windows Drivers as a printer
+called "HP DeskJet 720C Series". Change printer
+name entries
+below as appropriate for your printer model.
+
+The following instructions are tested on Windows 98, and may differ
+on other Windows variants.
+
+Open the Settings/Printers folder.
+
+First check that the HP PPA Deskjet is correctly installed,
+using HP's native Windows drivers. Right-click on its icon,
+and select its Properties dialog. The General
+Properties screen will open. This shows the exact name
+that the printer was given when it was installed. Make a note of
+it, and use the Print Test Page button
+to confirm that the
+printer is working. (The "Printer name:" line on the
+test page will also show the exact name of the HP PPA Deskjet
+that you will need to use when configuring the emulated postscript printer
+below). When you are done,
+click on OK to close the dialog.
+
+Now start the Add Printer "Wizard".
+Make the choices:
+
+ install a local printer
+ select a PostScript printer from the
+list of printers;
+(e.g., one of the Apple LaserWriter models:
+the Laserwriter II NT is known to work; Digital
+PrintServer models such as the turboPrintServer 20/Net
+have also been recommended). This will provide a
+suitable postscript driver.
+ From the list of Available Ports, choose
+"FILE: Creates a file on disk"
+(you will change this after
+the printer is installed)
+ set as default printer?: NO
+ Print test page?: NO
+
+
+Redirecting the output to the PPA printer.
+
+After the printer has been installed,
+right-click on its icon, and rename it to something like,
+e.g.,
+"Ghostscript+HP722C".
+Then right click again and open its Properties dialog.
+
+On the General tab screen,
+enter something informative
+in the Comment box, such as
+" Emulated Postscript printer; output redirected
+to a HP722C DeskJet printer" (optional).
+
+Next select the Details tab.
+The box "Print using the following driver:"
+should show the
+Postscript driver you selected (e.g., Apple LaserWriter II NT).
+
+
+ Click on Add Port.
+Select other, then Redirected Port, which should be
+available if RedMon was correctly installed, and click on
+OK to accept these
+settings and close the Add Port dialog.
+On the Details tab screen,
+The box "Print to the following port:"
+should now show a
+redirected port such as
+"RPT1 [Redirected Port]".
+
+ Click on
+Port Settings.
+
+In the box
+"Redirect port to the program:", enter the path to the
+gsprint program. (If you accepted the defaults when installing it,
+this may be C:\Ghostgum\gsview\gsprint.exe; you may
+search for it by clicking on Browse).
+
+In the box "arguments for this program are:"
+enter the arguments to be passed to the
+gsprint program (there is a document gsprint.htm
+with more details of these in the folder containing gsprint.exe).
+Suggested arguments are:
+
+ -printer "HP DeskJet 720C Series" -color -
+
+Replace "HP DeskJet 720C Series" by the (quoted)
+exact name of the HP PPA DeskJet printer that
+you made a note of earlier. (If you do not copy this name exactly,
+including any capitalization or spaces, things may not work!)
+The -color argument is needed to
+enable color printing;
+(Whether you actually get color printing will depend on the local settings
+of the "HP DeskJet 720C Series" printer
+that really prints
+the document.)
+The final
+" - " is required: without it,
+the output of gsprint will not get redirected to
+the printer.
+
+
+The box "Output" should show
+"Program handles output".
+
+In the box "Run", select
+"hidden".
+
+The box "Shutdown delay" will say
+"300 seconds". Print jobs for which processing by
+gsprint takes longer than this will be terminated,
+to avoid blocking the printer spool queue. Increase this limit
+if necessary.
+
+
+Now click on OK to close the Port Settings dialog.
+
+
+ Click on Spool Settings, and select
+"Disable bi-directional support for this printer",
+and click OK.
+
+
+Finally, again select the General tab, and test the installation by
+clicking on "Print a test page". If it works, you are
+finished setting up Postscript emulation. Click OK to
+exit the Printer Properties dialog.
+
+(If you have problems, first check that you made the correct
+entries in the Printer Properties dialogs, especially check that you
+did not make any typing errors in the
+exact name for the PPA DeskJet printer in the
+gsprint arguments box, which must correspond exactly
+to the "Printer name" given to the HP PPA printer). If the problems
+persist, you might get guidance from the
+gsprint and RedMon documentation; look
+in the folders where these were installed.)
+
+You now have a working emulated
+"Postscript printer" that can now be shared over
+a network. (The "sharing" options will now be available
+if you right-click on the emulated printer's icon.)
+
+ Limitations.
+
+This emulated postscript
+printer is most useful for providing printing services
+to non-Windows
+Clients on a samba network,
+but can be also be used by Windows
+Clients with the following limitations:
+
+Windows Clients will be able to
+select Print Settings only for the
+visible ("front end") "Postscript printer",
+but not for
+the hidden ("back end") HP PPA DeskJet printer
+that actually
+does the printing.
+Changes in the local Print Settings of the PPA driver for
+the DeskJet printer on the
+Host system (but not on Client systems, if it
+too is shared) will affect network printing by the
+"Postscript printer".
+Since the
+visible "Postscript printer" falsely
+advertises its identity, some of its Print Settings
+options seen by users on the Clients may not be valid.
+The extra processing on the printer Host
+may make printing rather slow compared to native Windows printing.
+
+
+
+
+
+
+
+
+
+
diff --git a/gamma.c b/gamma.c
index 8151eda..0fd5525 100644
--- a/gamma.c
+++ b/gamma.c
@@ -74,17 +74,17 @@
for (i = 150; i < image->width / 4; i++)
{
q = (unsigned char) (255.0 * (i - 150) / (image->width / 4 - 150));
- // R
+ /* R */
line[3 * i] = q;
line[3 * i + 1] = 0;
line[3 * i + 2] = 0;
- // G
+ /* G */
line[3 * (i + image->width / 4)] = 0;
line[3 * (i + image->width / 4) + 1] = q;
line[3 * (i + image->width / 4) + 2] = 0;
- // B
+ /* B */
line[3 * (i + 2 * image->width / 4)] = 0;
line[3 * (i + 2 * image->width / 4) + 1] = 0;
line[3 * (i + 2 * image->width / 4) + 2] = q;
diff --git a/global.h b/global.h
index 0e8c0bc..b180514 100644
--- a/global.h
+++ b/global.h
@@ -19,7 +19,7 @@
* Global Variables
*/
-#define VERSION "1.04 (November 05, 2000)"
+#define VERSION "1.12 (November 19, 2002)"
/*
* Global types
@@ -85,6 +85,12 @@
BOOLEAN gSilent, gVerbose ; /* switch off syslog, messages to stderr */
+int gByteCount; /* 1 for pbm/pgm input, 3 for ppm */
+
+BOOLEAN gCalibrate; /* true when printing calibration pages */
+BOOLEAN g300; /* assume 300dpi input when true */
+BOOLEAN gCompress; /* enable compressed (color) sweep data */
+BOOLEAN gLogInfo; /* enable informational syslog messages */
#else
#ifndef __CALIBRATE_C__
extern int gMaxPass;
@@ -108,39 +114,11 @@
extern BOOLEAN gPixmapMode;
extern BOOLEAN gBlack, gCyan, gMagenta, gYellow;
extern BOOLEAN gSilent, gVerbose;
+extern int gByteCount;
+extern BOOLEAN gCalibrate;
+extern BOOLEAN g300;
+extern BOOLEAN gCompress;
+extern BOOLEAN gLogInfo;
#endif
#endif
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/image.c b/image.c
index bf0a464..a64b76e 100644
--- a/image.c
+++ b/image.c
@@ -32,7 +32,7 @@
#include "dither.h"
#include "lang.h"
-
+#include
@@ -51,12 +51,16 @@
image->unread = 0;
image->colors = 0;
+ gCalibrate = false;
+ gByteCount = 3;
+
if (gGammaMode)
{
/* produce color calibration page, uses the default papersize */
image->version = P6_PPMRAW;
image->width = gWidth;
image->height = gHeight;
+ g300 = false;
}
else
{
@@ -65,66 +69,102 @@
return 0;
line[strlen (line) - 1] = 0;
-
/* we have to handle the six pnm formats .
*/
-
if (!strcmp (line, "P1"))
{
+ DPRINTF("input format is P1: pbm (ascii)\n");
image->version = P1_PBM;
if (!gPixmapMode)
- gColorMode = false ;
+ {
+ gColorMode = false ;
+ gByteCount = 1;
+ }
+ else
+ gFastMode = true;
+
strcpy(gFormat,"BitMap");
}
if (!strcmp (line, "P2"))
{
+ DPRINTF("input format is P2: pgm (ascii)\n");
image->version = P2_PGM;
if (!gPixmapMode)
- gColorMode = false ;
+ {
+ gColorMode = false ;
+ gByteCount = 1;
+ }
+ else
+ gFastMode = true;
+
strcpy(gFormat,"GreyMap");
}
if (!strcmp (line, "P3"))
{
+ DPRINTF("input format is P3: ppm (ascii)\n");
image->version = P3_PPM;
strcpy(gFormat,"PixMap");
}
if (!strcmp (line, "P4"))
{
+ DPRINTF("input format is P4: pbm (binary)\n");
image->version = P4_PBMRAW;
if (!gPixmapMode)
- gColorMode = false ;
+ {
+ gColorMode = false ;
+ gByteCount = 1;
+ }
+ else
+ gFastMode = true;
+
strcpy(gFormat,"BitMap");
}
if (!strcmp (line, "P5"))
{
+ DPRINTF("input format is P5: pgm (binary)\n");
image->version = P5_PGMRAW;
if (!gPixmapMode)
- gColorMode = false ;
+ {
+ gColorMode = false ;
+ gByteCount = 1;
+ }
+ else
+ gFastMode = true;
strcpy(gFormat,"GreyMap");
}
if (!strcmp (line, "P6"))
{
+ DPRINTF("input format is P6: ppm (binary)\n");
image->version = P6_PPMRAW;
strcpy(gFormat,"PixMap");
}
if (image->version == none)
{
+ DPRINTF("input format is not recognized as PNM\n");
snprintf(syslog_message,message_size,"initImage(): %s",
gMessages[E_IM_BADFORMAT] );
wrap_syslog (LOG_CRIT,"%s",syslog_message);
return 0;
}
+
+
/* initialize switch that is used to terminate further printing
* if EOF is detected while reading the input image
*/
gTerminate = false ;
- do
+ do {
if (fgets (line, 1024, fptr) == NULL)
return 0;
- while (line[0] == '#');
+ line[strlen (line) - 1] = 0;
+ if (!strcmp (line, "# pnm2ppa calibration image")){
+ gCalibrate = true;
+ g300 = false;
+ DPRINTF("initImage(): Calibration Page input detected!\n");
+ }
+ } while (line[0] == '#');
if (2 != sscanf (line, "%d %d", &image->width, &image->height))
return 0;
@@ -135,6 +175,14 @@
* will only be uses for calibration or gamma correction output
* which is not generated by pnm imput
*/
+
+
+ /* if we treat the input as 300dpi, double image dimensions */
+ if(g300) {
+ DPRINTF("300dpi input mode\n");
+ image->width *= 2;
+ image->height *= 2;
+ }
gWidth = image->width ;
gHeight = image->height ;
@@ -185,8 +233,9 @@
image->colors = colors ;
- DPRINTF( "initImage: width=%d, height=%d, colors = %d\n",
- image->width, image->height, image->colors);
+ DPRINTF( "initImage: width=%d, height=%d, colors = %d,"
+ " ByteCount = %d\n",
+ image->width, image->height, image->colors, gByteCount);
}
/* initialize buffer */
@@ -213,7 +262,7 @@
{
int linesize;
unsigned char *newbuf;
- // size_t newsize;
+ /* size_t newsize; */
int newsize ;
int k;
@@ -243,8 +292,8 @@
return 0;
}
- // calculate the number of bits and add one to double the needed memory
- // size.
+ /* calculate the number of bits and add one to double the needed memory
+ size.*/
newsize = pow(2, (int)((log(image->buflines * linesize + bytes)/log(2))+1));
DPRINTF("resizing memory from %d bytes to %d bytes\n",
@@ -270,9 +319,9 @@
}
-
-void
-convert_black_data (image_t *image, unsigned char *line, unsigned char *black)
+BOOLEAN
+convert_black_data (image_t *image, unsigned char *line, unsigned char *black,
+ BOOLEAN line_is_nonblank)
{
/* Lets document this - please correct anything incorrect here!
(duncan, Feb 12 2000, updated July 2000)
@@ -308,6 +357,8 @@
- whitespace is coded by (255,255,255).
+ - triplication of bytes is switched off when gByteCount == 1
+
Color data is only printed on even lines.
Black data is printed on even and odd lines,
@@ -317,15 +368,34 @@
the next even line.
*/
+ /*
+ FEB 2002 (duncan)
+ try to clean this up for pictures vs. text.
+ identify regions of black surrounded by white space as text ONLY
+ if they are less that "textwidth" dots wide. Otherwise, they are
+ treated as part of an image, and will try to use both ink types,
+ if any color was found on the line.
+ */
int i, j, k;
unsigned char mask = 0x80;
unsigned char *pos = black;
int blackness ;
-
- unsigned char curr_stuff= 0 ; // 0 = white, 1 = not white (current pixel)
+ BOOLEAN use_color = false;
+ BOOLEAN has_black = false;
+
+/* max_text_width is arbitary: make it configurable?
+ textwidth = maximum width of a black region that is printed
+ only with black ink when color is present on the line,
+ on the assumption it is text, not image.
+*/
+ const int max_text_width = 8; /* color dots at 300dpi */
+
+
+
+ unsigned char curr_stuff= 0 ;/* 0 = white, 1 = not white (current pixel)*/
unsigned char remove_black = 1, have_color = 0;
- unsigned char first_black=0 , second_black=0 ; //controls black ink density
+ unsigned char first_black=0 , second_black=0 ; /*controls black ink density*/
blackness = gBlackness ;
j = image->bufferCurLine ;
@@ -357,8 +427,10 @@
}
else
{
- // first_black = 0 ; /* even lines */
- // second_black = 1 ;
+#if 0
+ first_black = 0 ; /* even lines */
+ second_black = 1 ;
+#endif
/* treat odd and even lines the same, to avoid artifacts?*/
first_black = 1 ; /* even lines */
second_black = 0 ;
@@ -389,11 +461,12 @@
/* In Pixmap mode black ink cartridge is disabled (this should
be renamed to (say) NoBlack mode ) */
- if (gPixmapMode)
+ if (gPixmapMode || !line_is_nonblank)
memset (pos, 0x00, (image->width + 7) / 8);
else
{
- if (gColorMode)
+ if (gColorMode && gByteCount ==3 )
+ /* beginning of code that assumes gByteCount == 3 */
{
/* This is the most delicate situation, we (may) have both color
* and black on the same line;
@@ -403,6 +476,17 @@
* neither too sparse...)
*/
+ /* check for presence of color in the line */
+
+ for (i = 0; i < image->width * 3; i += 6)
+ {
+ if (line[i] != line[i+1] || line[i+1] != line[i+2])
+ {
+ use_color = true;
+ break;
+ }
+ }
+
curr_stuff=0;
for (i = 0; i < image->width * 3; i += 6)
@@ -412,16 +496,18 @@
if (curr_stuff==0)
{
+ int black_width = 0;
/* this is a test to see if the current non-whitespace
* pixel is part of a region of black delineated by
* whitespace (have_color=0)
* or is in a region containing some
* colored pixels (in this case have_color=1)
*/
- if (! (line[i]>gMaxPass && //if line is not white
+ if (! (line[i]>gMaxPass && /*if line is not white*/
line[i+1]> gMaxPass &&
line[i+2]>gMaxPass) )
{
+
have_color=0;
k=i;
while ( (!(have_color)) &&
@@ -436,6 +522,10 @@
have_color=1;
k+=6;
+ black_width++;
+ /* treat wide black regions as having color */
+ if (use_color && black_width > max_text_width)
+ have_color=1;
}
if (have_color)
remove_black=0;
@@ -444,6 +534,7 @@
curr_stuff=1;
}
}
+
if ( !(line[i] || line[i + 1] || line[i + 2]))
{
@@ -453,7 +544,7 @@
* these behaviors may need some further
* adjustments.
*/
- if (remove_black)
+ if (gCalibrate || remove_black)
{
/* in this case the black region is
* identified as delineated by whitespace
@@ -533,8 +624,9 @@
mask = 0x80;
}
}
- }
- else
+ } /* end of code that assumes gByteCount == 3 */
+
+ else /* !gColorMode, gByteCount could be 1 or 3 */
{
/* this next part is for printing in black and white only.
* if !gColorMode, the line contains only black or white, so
@@ -543,12 +635,12 @@
*pos = 0;
- for (i = 0 ; i < image->width * 3; i += 6)
+ for (i = 0 ; i < image->width *gByteCount ; i += 2*gByteCount )
{
if (mask == 0x80)
*pos = 0;
- if ((!line[i] && !line[i + 1] && !line[i + 2]))
+ if (!line[i]) /* black even pixel */
{
if (first_black && gBlack)
*pos |= mask; /* one drop of black ink */
@@ -561,9 +653,8 @@
if (second_black && gBlack)
*pos |= mask; /* one drop of black ink */
}
- else
- {
- /* pixel is not black */
+ else /* blank even pixel */
+ {
mask >>= 1;
if (mask == 0)
{
@@ -571,27 +662,42 @@
mask = 0x80;
}
}
- mask >>= 1;
+
+ mask >>= 1; /* odd pixels are left black */
if (mask == 0)
{
pos++;
mask = 0x80;
}
}
- memset (line, 0xff, image->width * 3);
+ memset (line, 0xff, image->width );
}
}
+
+ if (!(gPixmapMode || !line_is_nonblank)) {
+ unsigned char *p;
+ for (p = black; p <= pos; p++) {
+ if( *p ) {
+ has_black = true;
+ break;
+ }
+ }
+ }
+
+ return has_black;
}
-void
+BOOLEAN
convert_color_data (image_t *image, unsigned char *line,
- unsigned char *color[], int c_off)
+ unsigned char *color[], int c_off,
+ BOOLEAN line_is_nonblank)
{
int i, k, j;
unsigned char mask;
unsigned char *pos;
+ BOOLEAN has_color = false;
j = 1;
for (k = 0; k < gMaxPass; k++)
@@ -602,160 +708,175 @@
memset (pos, 0x00, (image->width / 2 + 7) / 8 * 3);
- for (i = 0; i < image->width * 3; i += 6)
- {
-
- if ((line[i] < gMaxPass - (k) + 1) && gCyan)
+ if (line_is_nonblank)
+ for (i = 0; i < image->width * 3; i += 6)
+ {
+
+ if ((line[i] < gMaxPass - k + 1) && gCyan)
pos[0] |= mask;
- if ((line[i + 1] < gMaxPass - (k) + 1) && gMagenta)
+ if ((line[i + 1] < gMaxPass - k + 1) && gMagenta)
pos[1] |= mask;
- if ((line[i + 2] < gMaxPass - (k) + 1) && gYellow)
- pos[2] |= mask;
-
- mask >>= 1;
- if (mask == 0)
- {
- pos += 3;
- mask = 0x80;
+ if ((line[i + 2] < gMaxPass - k + 1) && gYellow)
+ pos[2] |= mask;
+
+ mask >>= 1;
+ if (mask == 0)
+ {
+ pos += 3;
+ mask = 0x80;
+ }
}
+
+
+
+ if (line_is_nonblank && k == 0) {
+ unsigned char *p;
+ for (p = &color[gMaxPass -1][c_off]; p <= pos; p++) {
+ if( *p) {
+ has_color = true;
+ break;
+ }
+ }
+
}
}
+ return has_color;
}
-/* Drugo */
-
/* read a line of data from the file and convert to the necessary format */
-void
+BOOLEAN
read_line (image_t * image, unsigned char *black[], int b_off,
unsigned char *color[], int c_off)
{
- static unsigned char *line, *oldline; /* take care to free these! */
+ static unsigned char *oldline = NULL; /* take care to free this! */
+ unsigned char *prevline = NULL; /* take care to free this! */
+ unsigned char *line = NULL; /* take care to free this! */
int i, j, k ;
int fread_eof = 0;
- static int have_oldline = 0;
-
- line = malloc (image->width * 3);
+ BOOLEAN line_is_nonblank = true;
+ static BOOLEAN prevline_is_nonblank = true;
+ int image_width = image->width;
+ const BOOLEAN repeat_line = (g300 && image->bufferCurLine %2);
+
+ /*
+ for 300dpi input (g300 is true) ,
+ the data is duplicated horizontally and vertically
+ to convert it to 600dpi format.
+ odd lines are copies of the preceeding even line,
+ which was stored as "oldline" :
+ */
+ if(g300) {
+ image_width /= 2;
+ if (repeat_line) {
+ /* in 300dpi input mode,
+ the data from the previous even line should be used again
+ for this odd line*/
+ assert(oldline);
+ line = oldline;
+ oldline = NULL;
+ }
+ }
- if (!line)
- {
- /* make this nicer... propagate upwards */
- snprintf(syslog_message,message_size, "read_line(): %s",
- gMessages[E_BADMALLOC]);
- wrap_syslog (LOG_CRIT,"%s",syslog_message);
- if (have_oldline)
- free (oldline);
- exit (1);
- }
-
-
+ if(!line)
+ if (!(line = malloc (image->width * gByteCount)))
+ {
+ /* make this nicer... propagate upwards */
+ snprintf(syslog_message,message_size, "read_line(): %s",
+ gMessages[E_BADMALLOC]);
+ wrap_syslog (LOG_CRIT,"%s",syslog_message);
+ if (oldline)
+ free (oldline);
+ exit (1);
+ }
+
+
/* All the six pnm input formats
- * (pbm, pbmraw, pgm, pgmraw, pbm, pbmraw )
+ * (pbm, pbmraw, pgm, pgmraw, ppm, ppmraw )
* can be read from the input, and converted to
* ppmraw format for further processing.
*/
- if (!gGammaMode && !gTerminate)
+ if (!gGammaMode && !gTerminate && !repeat_line)
{
switch (image->version)
{
/* for completeness, the non-raw pnm formats are supported */
case P1_PBM:
- for ( i = 0 ; i < image->width * 3 ; )
- switch( getc( image->fptr ) )
- {
- case EOF:
- snprintf(syslog_message,message_size, "read_line(): %s PBM\n",
- gMessages[E_IM_EOFREADLINE]);
- wrap_syslog (LOG_CRIT,"%s",syslog_message);
-
- /* input data is truncated; set gTerminate mode
- * and replace lost part of image with whitespace
- * until print run ends.
- */
- gTerminate = true ;
- break;
- case '1':
- line[i] = line[i + 1]= line[i + 2] = 0;
- i += 3 ;
- break;
- case '0':
- line[i] = line[i + 1]= line[i + 2] = 255;
- i += 3 ;
- break;
- default :
- break;
- }
- break;
- case P2_PGM:
- {
- /* This is included for completeness,
- * but this implementation s PAINFULLY slow !
- * is there a better way?
- * (YES, USE THE PGMRAW FORMAT ONLY !)
- */
- unsigned int value ;
- for ( i = 0 ; i < image->width * 3 ; i += 3 )
- {
- switch (fscanf(image->fptr, "%u ", &value ) )
- {
- case '1':
- break ;
- case EOF:
- snprintf(syslog_message,message_size,"read_line(): %s PGM\n",
- gMessages[E_IM_EOFREADLINE]);
- wrap_syslog (LOG_CRIT,"%s",syslog_message);
-
- /* input data is truncated; set gTerminate mode
- * and replace lost part of image with whitespace
- * until print run ends.
- */
- gTerminate = true ;
- break;
- default:
- snprintf(syslog_message,message_size,"read_line(): %s",
- gMessages[E_IM_BADREADLINE]);
- wrap_syslog (LOG_CRIT,"%s",syslog_message);
- free (line);
- if (have_oldline)
- free (oldline);
- exit (1);
- break;
- }
- if(value <= 255)
- line[i] = line[i + 1] = line[i + 2] = value ;
- else
- {
- snprintf(syslog_message,message_size,"read_line(): %s",
- gMessages[E_IM_BADIMAGE]);
- wrap_syslog (LOG_CRIT,"%s",syslog_message);
- free (line);
- if (have_oldline)
- free (oldline);
- exit (1);
- }
- }
- }
- break;
- case P3_PPM:
- {
+ {
+ /* read pbm format; convert to ppm format if gByteCount = 3 */
/* This is included for completeness,
* but this implementation is PAINFULLY slow !
* is there a better way?
* (YES, USE THE PPMRAW FORMAT ONLY !)
*/
+ int index = 0;
+ int incr = gByteCount;
+ if(g300)
+ incr *= 2;
+ for ( i = 0 ; i < image_width ; )
+ {
+ switch( getc( image->fptr ) )
+ {
+ case EOF:
+ snprintf(syslog_message,message_size, "read_line(pbm,ascii): %s PBM\n",
+ gMessages[E_IM_EOFREADLINE]);
+ wrap_syslog (LOG_CRIT,"%s",syslog_message);
+
+ /* input data is truncated; set gTerminate mode
+ * and replace lost part of image with whitespace
+ * until print run ends.
+ */
+ gTerminate = true ;
+ break;
+ case '1':
+ line[index] = 0;
+ index += incr;
+ i ++;
+ break;
+ case '0':
+ line[index] = 255;
+ index += incr;
+ i ++;
+ break;
+ default :
+ break;
+ }
+ }
+ if(g300) {
+ for ( j = 0 ; j < index ; j += incr )
+ line[j+gByteCount] = line[j];
+ }
+ if (gByteCount == 3) {
+ for (j = 0; j < index ; j += 3 )
+ line[j + 2]= line[j + 1] = line[j];
+ }
+ }
+ break;
+ case P2_PGM:
+ {
+ /* read pgm format; convert to ppm format if gByteCount = 3 */
+ /* This is included for completeness,
+ * but this implementation is PAINFULLY slow !
+ * is there a better way?
+ * (YES, USE THE PGMRAW FORMAT ONLY !)
+ */
+ int index = 0;
unsigned int value ;
- for ( i = 0 ; i < image->width * 3 ; i ++ )
- {
- switch (fscanf(image->fptr, "%u ", &value ) )
- {
- case '1':
+ int incr = gByteCount;
+ if(g300)
+ incr *= 2;
+ for ( i = 0 ; i < image_width ; i ++ )
+ {
+ switch(fscanf(image->fptr, "%u ", &value ))
+ {
+ case 1:
break ;
case EOF:
- snprintf(syslog_message,message_size,"read_line(): %s PPM\n",
+ snprintf(syslog_message,message_size,"read_line(pgm,ascii): %s PGM\n",
gMessages[E_IM_EOFREADLINE]);
wrap_syslog (LOG_CRIT,"%s",syslog_message);
-
+
/* input data is truncated; set gTerminate mode
* and replace lost part of image with whitespace
* until print run ends.
@@ -763,24 +884,100 @@
gTerminate = true ;
break;
default:
- snprintf(syslog_message,message_size,"read_line(): %s",
+ snprintf(syslog_message,message_size,"read_line(pgm,ascii): %s",
gMessages[E_IM_BADREADLINE]);
wrap_syslog (LOG_CRIT,"%s",syslog_message);
free (line);
- if (have_oldline)
+ line = NULL;
+ if (oldline) {
+ free (oldline);
+ oldline = NULL;
+ }
+ exit (1);
+ break;
+ }
+ if(value <= 255)
+ {
+ line[index] = value;
+ index += incr;
+ }
+ else
+ {
+ snprintf(syslog_message,message_size,"read_line(pgm,ascii): %s",
+ gMessages[E_IM_BADIMAGE]);
+ wrap_syslog (LOG_CRIT,"%s",syslog_message);
+ free (line);
+ if (oldline)
+ free (oldline);
+ exit (1);
+ }
+ }
+ if(g300) {
+ for ( j = 0 ; j < index ; j += incr )
+ line[j+gByteCount] = line[j];
+ }
+ if (gByteCount == 3) {
+ for (j = 0; j < index ; j += 3 )
+ line[j + 2]= line[j + 1] = line[j];
+ }
+ }
+ break;
+ case P3_PPM:
+ {
+ /* read pbm format */
+ /* This is included for completeness,
+ * but this implementation is PAINFULLY slow !
+ * is there a better way?
+ * (YES, USE THE PPMRAW FORMAT ONLY !)
+ */
+ unsigned int value ;
+ int index = 0;
+ assert(gByteCount == 3);
+ for ( i = 0 ; i < image_width * 3 ; i ++ )
+ {
+ switch (fscanf(image->fptr, "%u ", &value ) )
+ {
+ case 1:
+ break ;
+ case EOF:
+ snprintf(syslog_message,message_size,"read_line(ppm,ascii): %s PPM\n",
+ gMessages[E_IM_EOFREADLINE]);
+ wrap_syslog (LOG_CRIT,"%s",syslog_message);
+
+ /* input data is truncated; set gTerminate mode
+ * and replace lost part of image with whitespace
+ * until print run ends.
+ */
+ gTerminate = true ;
+ break;
+ default:
+ snprintf(syslog_message,message_size,"read_line(ppm,ascii): %s",
+ gMessages[E_IM_BADREADLINE]);
+ wrap_syslog (LOG_CRIT,"%s",syslog_message);
+ free (line);
+ if (oldline)
free (oldline);
exit (1);
break;
}
- if(value <= 255)
- line[i] = value ;
+ if(value <= 255){
+ if (g300) {
+ line[index+3] = line[index] = value;
+ index++;
+ if(!(index %3))
+ index+=3;
+ } else {
+ line[index] = value ;
+ index ++;
+ }
+ }
else
{
- snprintf(syslog_message,message_size,"read_line() %s",
+ snprintf(syslog_message,message_size,"read_line(ppm,ascii) %s",
gMessages[E_IM_BADIMAGE]);
wrap_syslog (LOG_CRIT,"%s",syslog_message);
free (line);
- if (have_oldline)
+ if (oldline)
free (oldline);
exit (1);
}
@@ -788,105 +985,116 @@
}
break;
case P4_PBMRAW:
- /* read pbmraw format and convert to ppmraw format */
- {
- int pbm_width, count, index ;
- char* pbmraw_data;
- unsigned char mask[8] =
+ /* read pbmraw format; convert to ppm format if gByteCount = 3 */
+ {
+ int pbm_width, count, index=0;
+ int incr = gByteCount;
+ char* pbmraw_data;
+ unsigned char mask[8] =
{ 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 };
- pbm_width = ( image->width + 7 ) / 8;
-
- if (! (pbmraw_data = malloc(pbm_width)) )
- {
- snprintf(syslog_message,message_size,"read_line(): %s",
- gMessages[E_BADMALLOC]);
- wrap_syslog (LOG_CRIT,"%s",syslog_message);
- if (have_oldline)
- free (oldline);
- free (line);
- exit (1);
- }
-
- count = fread(pbmraw_data, 1 , pbm_width, image->fptr);
- if (pbm_width == count)
- {
- /* success */
- /* pbm raw format: 0=white, 1=black;
- * bits are stored eight per byte, high bit
- * first, low bit last.
- */
- index = 0;
- for ( i = 0 ; i < image->width ; i ++ )
- {
- k = i % 8 ;
- j = i / 8 ;
- if ( pbmraw_data[j] & mask[k] )
- line[index] = line[index + 1] = line[index + 2] = 0 ;
- else
- line[index] = line[index + 1] = line[index + 2] = 255; ;
- index += 3;
- }
- free(pbmraw_data);
- }
- else
- {
- /* error reading line */
- free(pbmraw_data);
- fread_eof=feof(image->fptr);
- clearerr(image->fptr);
- if (fread_eof)
- {
- snprintf(syslog_message,message_size,"read_line(): %s PBMRAW\n",
+ pbm_width = ( image_width + 7 ) / 8;
+
+ if(g300)
+ incr *= 2;
+ if (! (pbmraw_data = malloc(pbm_width)) )
+ {
+ snprintf(syslog_message,message_size,"read_line(pbmraw): %s",
+ gMessages[E_BADMALLOC]);
+ wrap_syslog (LOG_CRIT,"%s",syslog_message);
+ if (oldline)
+ free (oldline);
+ free (line);
+ exit (1);
+ }
+
+ count = fread(pbmraw_data, 1 , pbm_width, image->fptr);
+ if (pbm_width == count)
+ {
+ /* success */
+ /* pbm raw format: 0=white, 1=black;
+ * bits are stored eight per byte, high bit
+ * first, low bit last.
+ */
+ index = 0;
+ for ( i = 0 ; i < image_width ; i ++ )
+ {
+ k = i % 8 ;
+ j = i / 8 ;
+ if ( pbmraw_data[j] & mask[k] )
+ line[index] = 0;
+ else
+ line[index] = 255;
+ index += incr;
+ }
+ free(pbmraw_data);
+ }
+ else
+ {
+ /* error reading line */
+ free(pbmraw_data);
+ fread_eof=feof(image->fptr);
+ clearerr(image->fptr);
+ if (fread_eof)
+ {
+ snprintf(syslog_message,message_size,"read_line(pbmraw): %s PBMRAW\n",
gMessages[E_IM_EOFREADLINE]);
wrap_syslog (LOG_CRIT,"%s",syslog_message);
-
- /* input data is truncated; set gTerminate mode
- * and replace lost part of image with whitespace
- * until print run ends.
- */
- gTerminate = true ;
- }
- else
- {
- snprintf(syslog_message,message_size,"read_line(): %s",
+
+ /* input data is truncated; set gTerminate mode
+ * and replace lost part of image with whitespace
+ * until print run ends.
+ */
+ gTerminate = true ;
+ }
+ else
+ {
+ snprintf(syslog_message,message_size,"read_line(pgmraw): %s",
gMessages[E_IM_BADREADLINE]);
wrap_syslog (LOG_CRIT,"%s",syslog_message);
- free (line);
- if (have_oldline)
- free (oldline);
- exit (1);
- }
- }
- }
-
+ free (line);
+ if (oldline)
+ free (oldline);
+ exit (1);
+ }
+ }
+ if(g300) {
+ for ( j = 0 ; j < index ; j += incr )
+ line[j + gByteCount] = line[j];
+ }
+ if (gByteCount == 3) {
+ for (j = 0; j < index ; j += 3 )
+ line[j + 2]= line[j + 1] = line[j];
+ }
+ }
break;
case P5_PGMRAW:
- /* read pgmraw format and convert to ppmraw format */
- {
- int index ;
+ /* read pgmraw format; convert to ppm format if gByteCount = 3 */
+ {
+ int index=0 ;
char* pgm_data;
-
- pgm_data = malloc(image->width);
+ int incr = gByteCount;
+ if(g300)
+ incr *= 2;
+ pgm_data = malloc(image_width);
if (!pgm_data)
{
- snprintf(syslog_message,message_size,"read_line(): %s",
+ snprintf(syslog_message,message_size,"read_line(pgmraw): %s",
gMessages[E_BADMALLOC]);
wrap_syslog (LOG_CRIT,"%s",syslog_message);
free (line);
- if (have_oldline)
+ if (oldline)
free (oldline);
exit (1);
}
- if ( 1 == fread (pgm_data, image->width , 1, image->fptr) )
+ if ( 1 == fread (pgm_data, image_width , 1, image->fptr) )
{
/* success */
index = 0 ;
- for ( i = 0 ; i < image->width ; i ++ )
- {
- line[index] = line[index + 1] = line[index + 2]
- = pgm_data[i] ;
- index += 3;
+ for ( i = 0 ; i < image_width ; i ++ )
+ {
+ line[index] = pgm_data[i] ;
+ index += incr;
}
free(pgm_data);
}
@@ -898,7 +1106,7 @@
clearerr(image->fptr);
if (fread_eof)
{
- snprintf(syslog_message,message_size,"read_line:() %s PGMRAW\n",
+ snprintf(syslog_message,message_size,"read_line:(pgmraw) %s PGMRAW\n",
gMessages[E_IM_EOFREADLINE]);
wrap_syslog (LOG_CRIT,"%s",syslog_message);
@@ -910,99 +1118,194 @@
}
else
{
- snprintf(syslog_message,message_size,"read_line(): %s",
+ snprintf(syslog_message,message_size,"read_line(pgmraw): %s",
gMessages[E_IM_BADREADLINE]);
wrap_syslog (LOG_CRIT,"%s",syslog_message);
free (line);
- if (have_oldline)
+ if (oldline)
free (oldline);
exit (1);
}
}
+
+ if(g300) {
+ for (j = 0 ; j < index ; j += incr )
+ line[j + gByteCount] = line[j];
+ }
+ if (gByteCount == 3){
+ for (j = 0; j < index ; j += 3 )
+ line[j + 2]= line[j + 1] = line[j];
+ }
}
break;
case P6_PPMRAW:
- if (1 != fread (line, image->width * 3, 1, image->fptr) )
- {
- fread_eof=feof(image->fptr);
- clearerr(image->fptr);
- if (fread_eof)
- {
- snprintf(syslog_message,message_size,"read_line(): %s PPMRAW\n",
- gMessages[E_IM_EOFREADLINE]);
- wrap_syslog (LOG_CRIT,"%s",syslog_message);
-
- /* input data is truncated; set gTerminate mode
- * and replace lost part of image with whitespace
- * until print run ends.
- */
- gTerminate = true ;
+ /* read ppmraw format */
+ {
+ assert(gByteCount == 3);
+ if (1 != fread (line, image_width * 3, 1, image->fptr) )
+ {
+ fread_eof=feof(image->fptr);
+ clearerr(image->fptr);
+ if (fread_eof)
+ {
+ snprintf(syslog_message,message_size,"read_line(ppmraw):%s \n",
+ gMessages[E_IM_EOFREADLINE]);
+ wrap_syslog (LOG_CRIT,"%s",syslog_message);
+
+ /* input data is truncated; set gTerminate mode
+ * and replace lost part of image with whitespace
+ * until print run ends.
+ */
+ gTerminate = true ;
+ }
+ else
+ {
+ snprintf(syslog_message,message_size,"read_line(ppmraw): %s",
+ gMessages[E_IM_BADREADLINE]);
+ wrap_syslog (LOG_CRIT,"%s",syslog_message);
+ free (line);
+ if (oldline)
+ free (oldline);
+ exit (1);
+ }
+ }
+ /* if input data was at 300dpi, expand it to 600dpi format */
+ if(g300) {
+ int j,k;
+ for ( i = image_width - 1 ; i > 0 ; i--) {
+ j = 3 * i ;
+ k = 2 * j;
+ line[ k + 3 ] = line[ k ] = line[ j ];
+ line[ k + 4 ] = line[ k + 1 ] = line[ j + 1 ];
+ line[ k + 5 ] = line[ k + 2 ] = line[ j + 2 ];
}
- else
- {
- snprintf(syslog_message,message_size,"read_line(): %s",
- gMessages[E_IM_BADREADLINE]);
- wrap_syslog (LOG_CRIT,"%s",syslog_message);
- free (line);
- if (have_oldline)
- free (oldline);
- exit (1);
- }
- }
+ line[3] = line[0];
+ line[4] = line[1];
+ line[5] = line[2];
+ }
+ }
break;
case none:
default:
- snprintf(syslog_message,message_size,"read_line(): %s",
+ snprintf(syslog_message,message_size,"read_line(?): %s",
gMessages[E_IM_BADFORMAT]);
wrap_syslog (LOG_CRIT,"%s",syslog_message);
free (line);
- if (have_oldline)
+ if (oldline)
free (oldline);
exit (1);
break;
- }
+ }
}
else if (gGammaMode)
ProduceGamma (image, line ) ; /* generate color calibration page */
+
+ if ( gTerminate ||
+ image->bufferCurLine < image->top ||
+ image->bufferCurLine >= image->height - image->bottom ) {
+ /*
+ * gTerminate becomes true if EOF was obtained when a line was read .
+ * The input image is incomplete .
+ * Print only previously-read complete lines.
+ * unread lines are replaced with blanks for the rest of the print run
+ *
+ * also blank out lines above the top margin,
+ * or below the bottom margin.
+ */
+ line_is_nonblank = false;
+ memset(line, 0xff, image->width * gByteCount);
+ }
+
+ if(line_is_nonblank) {
+ if (repeat_line)
+ line_is_nonblank = prevline_is_nonblank ;
+ else {
+ /* crop image to left and right margins */
+ int imin = 0, imax = image->width * gByteCount;
+ if(image->left > 0) {
+ imin = image->left * gByteCount;
+ memset(line,0xff, imin);
+ }
+ if(image->right > 0) {
+ imax = (image->width - image->right) * gByteCount;
+ memset(line + imax, 0xff, image->right * gByteCount);
+ }
+ /* check if cropped line is really nonblank */
+ line_is_nonblank = false;
+ for ( i = imin ; i < imax ; i++ ) {
+ if (line[i] != 255) {
+ line_is_nonblank = true;
+ break;
+ }
+ }
+ }
+ }
+
- if ( gTerminate )
- {
- /* this becomes true if EOF was obtained when a line was read .
- * The input image is incomplete .
- * Print only previously-read complete lines.
- * unread lines are replaced with blanks for the rest of the print run
- */
- int index ;
- index = 0 ;
- for ( i = 0 ; i < image->width ; i ++ )
- {
- line[index] = line[index + 1] = line[index + 2] = 255; ;
- index += 3;
- }
+ /* mark line as read */
+ image->LineType[image->bufferCurLine] =
+ image->LineType[image->bufferCurLine] | READLINE;
+
+
+ if (!gTerminate && g300 && !repeat_line){
+ /* in 300dpi mode, store the data when bufferCurLine is even,
+ to use it again for the next odd line at 600dpi */
+
+ if (!(prevline = malloc (image->width * gByteCount))) {
+ /* make this nicer... propagate upwards */
+ snprintf(syslog_message,message_size, "read_line(): %s",
+ gMessages[E_BADMALLOC]);
+ wrap_syslog (LOG_CRIT,"%s",syslog_message);
+ free(line);
+ if (oldline)
+ free (oldline);
+ exit (1);
}
-
+ prevline_is_nonblank = line_is_nonblank;
+ if (prevline_is_nonblank)
+ memcpy(prevline, line, image->width * gByteCount);
+ else
+ memset(prevline, 0xff, image->width * gByteCount);
+ }
- /* process ALL lines to avoid artifacts
+
+ /* just to be safe ... */
+ if(gTerminate && oldline) {
+ free(oldline);
+ oldline = NULL;
+ }
+
+ /* process ALL non-blank lines to avoid artifacts
(odd lines are only processed for black in *_Dither() functions )
hopefully, this minimal processing is quite fast */
- if (gColorMode)
- {
- if (gFastMode)
- HT_Color_Dither (image, line);
- else
- FS_Color_Dither (image, line);
- }
- else
- HT_Black_Dither (image, line);
- /* if the current line is odd, we only need to return black data */
+ if(line_is_nonblank) {
+ image->LineType[image->bufferCurLine] =
+ image->LineType[image->bufferCurLine] | NONBLANK;
+ if (gColorMode)
+ {
+ if (gFastMode)
+ HT_Color_Dither (image, line);
+ else
+ FS_Color_Dither (image, line);
+ }
+ else
+ HT_Black_Dither (image, line);
+ }
+
+
+
+ /* if the current line is odd, we only need to return black data */
if (image->bufferCurLine % 2 == 1)
{
if ( (!gEcoMode || gColorMode) && !gPixmapMode )
{
- convert_black_data (image, line, &black[0][b_off]);
+ if (convert_black_data
+ (image, line, &black[0][b_off],line_is_nonblank))
+ image->LineType[image->bufferCurLine] =
+ image->LineType[image->bufferCurLine] | BLACKLINE;
}
else
{
@@ -1013,45 +1316,64 @@
if ( image->bufferCurLine + 1 < image->height )
{
memset(&black[0] [b_off], 0x00, (image->width +7 ) / 8 );
- oldline = malloc (image->width * 3);
- memcpy(oldline, line, image->width * 3 );
- have_oldline = 1;
+ oldline = malloc (image->width * gByteCount);
+ memcpy(oldline, line, image->width * gByteCount);
}
}
-
-
}
else
{
/* return both black and color data on even lines */
/* note that convert_color_data must be called AFTER convert_black_data */
- if ( have_oldline )
+ if ( oldline )
{
/* add any black from previous unprinted odd line
to next even line */
- for ( i = 0; i < image->width * 3; i += 3 )
+ if (gByteCount == 3)
{
- if ( !oldline[i] && !oldline[i + 1] && !oldline[i + 2] )
+ for ( i = 0; i < image->width * 3; i += 3 )
{
- line[i] = line[i + 1] = line[i + 2] = 0 ;
+ if ( !oldline[i] && !oldline[i + 1] && !oldline[i + 2] )
+ line[i + 2] = line[i + 1] = line[i] = 0 ;
}
}
+ else /* gByteCount = 1 */
+ {
+ for ( i = 0; i < image->width ; i ++ )
+ {
+ if ( !oldline[i] )
+ line[i] = 0 ;
+ }
+ }
+
free(oldline);
- have_oldline = 0;
+ oldline = NULL;
}
-
-
- convert_black_data (image, line, &black[0][b_off]);
+ if (convert_black_data
+ (image, line, &black[0][b_off],line_is_nonblank))
+ image->LineType[image->bufferCurLine] =
+ image->LineType[image->bufferCurLine] | BLACKLINE;
+
if (gColorMode)
- convert_color_data (image, line, color, c_off);
+ if (convert_color_data
+ (image, line, color, c_off,line_is_nonblank))
+ image->LineType[image->bufferCurLine] =
+ image->LineType[image->bufferCurLine] | COLORLINE;
}
free (line);
-
+
+ if(prevline) {
+ assert(!oldline);
+ oldline = prevline;
+ }
+
+
image->bufferCurLine++;
-
+
+ return line_is_nonblank;
}
/* Drugo */
@@ -1063,29 +1385,43 @@
buffer_black_line (image_t *image, unsigned char *data[], int offset)
{
int lines, linesize = (image->width + 7) / 8;
+ BOOLEAN nonblank = false;
+ int curline = image->bufferCurLine;
+
/* if the current line is odd, we need to read 2 black lines */
if (image->bufferCurLine % 2 == 1)
lines = 2;
else
- lines = 1; //mocho 1
+ lines = 1;
remallocBuffer (image, linesize * lines);
/* read_line into buffer and 'data' */
read_line (image, image->buffer,
image->bufpos + image->buflines * linesize, data, offset);
+ if (image->LineType[curline] & BLACKLINE)
+ nonblank = true;
+
image->buflines++;
/* if we have to read 2 lines, then we haven't gotten any color data yet */
if (lines == 2)
{
- read_line (image, image->buffer,
- image->bufpos + image->buflines * linesize, data, offset);
- image->buflines++;
+ curline++;
+ read_line (image, image->buffer,
+ image->bufpos + image->buflines * linesize, data, offset);
+ image->buflines++;
+ if (image->LineType[curline] & BLACKLINE)
+ nonblank = true;
}
- image->buftype = bitmap;
+ /* if no black data exists in buffer, advance blackCurLine */
+ if (image->buftype == empty && !nonblank ) {
+ image->buflines = 0;
+ image->blackCurLine += lines; ;
+ } else
+ image->buftype = bitmap;
}
/* buffer a color line and return black data */
@@ -1093,6 +1429,8 @@
buffer_color_line (image_t *image, unsigned char *data[], int offset)
{
int linesize = (image->width / 2 + 7) / 8 * 3;
+ BOOLEAN nonblank = false;
+ int curline = image->bufferCurLine;
/* if the current line is odd, we don't need to buffer any color data */
if (image->bufferCurLine % 2 == 1)
@@ -1107,9 +1445,16 @@
read_line (image, data, offset, image->buffer,
image->bufpos + image->buflines * linesize);
+ if (image->LineType[curline] & COLORLINE)
+ nonblank = true;
image->buflines++;
- image->buftype = color;
+ /* if no color data exists in buffer, advance colorCurLine */
+ if (image->buftype == empty && !nonblank ) {
+ image->buflines = 0;
+ image->colorCurLine += 2;
+ } else
+ image->buftype = color;
}
/* Reads a single line of black image data into data which must be at least
@@ -1171,8 +1516,8 @@
{
for (k = 0; k < gMaxPass; k++)
memcpy (data[k] + offset,
- &image->buffer[k][image->bufpos], 3 * ((image->width / 2 + 7) / 8)); //mocho changes /2
- image->bufpos += 3 * ((image->width / 2 + 7) / 8); //mocho changes /2
+ &image->buffer[k][image->bufpos], 3 * ((image->width / 2 + 7) / 8));
+ image->bufpos += 3 * ((image->width / 2 + 7) / 8);
image->buflines--;
if (image->buflines == 0)
{
@@ -1199,3 +1544,4 @@
memcpy (image->revdata, data, (image->width + 7) / 8);
image->blackCurLine--;
}
+
diff --git a/image.h b/image.h
index 9a77768..281df1b 100644
--- a/image.h
+++ b/image.h
@@ -28,7 +28,9 @@
version;
int width, height;
int blackCurLine, colorCurLine, bufferCurLine;
- void *revdata; // used to stash a line read too early
+ unsigned char *LineType;
+ int left, right, top, bottom;
+ void *revdata; /* used to stash a line read too early */
int unread;
/* buffer */
@@ -50,6 +52,13 @@
}
image_t;
+/* values for image->LineType descriptions */
+#define READLINE 0x01 /* line has been read */
+#define NONBLANK 0x02 /* non blank line */
+#define BLACKLINE 0x04 /* line has black ink */
+#define COLORLINE 0x08 /* line has color ink */
+
+
int initImage (image_t *, FILE *);
/* reads a single line into char* */
diff --git a/lang.h b/lang.h
index 76d9872..24fea00 100644
--- a/lang.h
+++ b/lang.h
@@ -64,7 +64,7 @@
#ifdef __PNM2PPA_C__
- // only defined the once
+/* only defined the once */
char *gMessages[] = {
#ifdef LANG_CZ
@@ -93,7 +93,7 @@
};
#else
- // make the messages available to other files
+/* make the messages available to other files */
extern char *gMessages[];
#endif
diff --git a/pdq/README.pdq b/pdq/README.pdq
index d381de6..e325766 100644
--- a/pdq/README.pdq
+++ b/pdq/README.pdq
@@ -29,7 +29,7 @@
You must be root to do this:
cp gs-pnm2ppa /etc/pdq/drivers/ghostscript
- cp dummy /etc/pdq/intefaces
+ cp dummy /etc/pdq/interfaces
Then run "xpdq" to setup the printer, selecting the driver "gs-pnm2ppa",
and the interface "dummy". You must specify The local parallel printer port
diff --git a/pnm2ppa.c b/pnm2ppa.c
index 7c22951..fefda4c 100644
--- a/pnm2ppa.c
+++ b/pnm2ppa.c
@@ -52,7 +52,6 @@
snprintf(syslog_message,message_size,"%s",
gMessages[LOG_START]);
wrap_syslog (LOG_INFO,"%s",syslog_message);
-
ppa_init_job (&printer);
@@ -156,7 +155,8 @@
a user-specifed file *File_path may later be opened;
should any extra validation of this be performed now ?
*/
- path = File_path;
+ /* remember to free(path) after use! */
+ path = strdup(File_path);
return path;
}
}
@@ -177,7 +177,7 @@
void
set_printer_specific_defaults (void)
{
- if (printer.version != HP7X0 &&
+ if (printer.version != NOPRINTER && printer.version != HP7X0 &&
printer.version != HP820 && printer.version != HP1000)
{
snprintf(syslog_message,message_size, "set_printer_defaults(): %s",
@@ -222,6 +222,7 @@
printf (" --bw forces black/white output\n");
printf (" -d dumps the configuration to stdout\n");
printf (" --eco Econofast mode (uses less ink)\n");
+ printf (" --dpi300 Treat input resolution as 300dpi instead of 600dpi\n");
printf (" -f read printer settings from configuration file \n");
printf (" -F read color correction table from file \n");
printf (" --fd use fast dithering mode\n");
@@ -265,15 +266,21 @@
printf
(" the corresponding command-line parameters.\n");
printf
- (" Other keys that can be set in the configuration file include:\n");
- printf
- (" 'silent', 'verbose', 'unimode', 'blackshear', 'colorshear',\n");
- printf
- (" 'RedGammaIdx','BlueGammaIdx', 'GreenGammaIdx',\n");
- printf
- (" 'GammaR', 'GammaG', 'GammaB', 'ColOffsX', 'ColOffsY',\n");
- printf
- (" 'black_ink', 'color_ink', 'cyan_ink', 'magenta_ink', 'yellow_ink';\n");
+ (" Other keys that can be only set in the configuration file include:\n");
+ printf
+ (" 'silent', 'verbose', 'log_info',\n");
+ printf
+ (" 'unimode', 'blackshear', 'colorshear',\n");
+ printf
+ (" 'RedGammaIdx','BlueGammaIdx', 'GreenGammaIdx',\n");
+ printf
+ (" 'GammaR', 'GammaG', 'GammaB',\n");
+ printf
+ (" 'ColOffsX', 'ColOffsY',\n");
+ printf
+ (" 'black_ink', 'color_ink', 'cyan_ink', 'magenta_ink', 'yellow_ink',\n");
+ printf
+ (" 'compression';\n");
printf
(" see documentation in the sample configuration file for their usage.\n\n");
printf
@@ -293,18 +300,9 @@
void
parm_version (char *arg)
{
-
- if (!strncasecmp (arg, "error", 5))
- {
- wrap_closelog ();
- wrap_openlog ("pnm2ppa", 1);
- snprintf(syslog_message,message_size,"parm_version(): %s",
- gMessages[E_CONFIG]);
- wrap_syslog (LOG_CRIT,"%s",syslog_message);
-
- exit (1);
- }
+
+
if (!strcasecmp (arg, "hp720") || !strcmp (arg, "720") ||
!strcasecmp (arg, "hp722") || !strcmp (arg, "722") ||
!strcasecmp (arg, "hp710") || !strcmp (arg, "710") ||
@@ -329,7 +327,10 @@
parm_iversion (int arg)
{
switch (arg)
- {
+ {
+ case 0:
+ printer.version = NOPRINTER;
+ break;
case 720:
case 722:
case 710:
@@ -530,6 +531,15 @@
wrap_closelog();
}
}
+ else if (!strncmp (key, "log_info", len))
+ {
+ if (system_config_file) {
+ if ( value )
+ gLogInfo = true ;
+ else
+ gLogInfo = false ;
+ }
+ }
else if (!strncmp (key, "verbose", len))
{
gVerbose = true;
@@ -569,6 +579,13 @@
exit (1);
}
}
+ else if (!strncmp (key, "compression", len))
+ {
+ if ( value )
+ gCompress = true ;
+ else
+ gCompress = false ;
+ }
else
{
snprintf(syslog_message,message_size,"read_config_file(): %s (%s %d)\n",
@@ -612,9 +629,9 @@
char c;
BOOLEAN get_Gamma = true;
- char *gammaFile=NULL;
- char *pnm_inputFile=NULL;
- char *ppa_outputFile=NULL;
+ char gammaFile[MAXPATHLEN];
+ char pnm_inputFile[MAXPATHLEN];
+ char ppa_outputFile[MAXPATHLEN];
BOOLEAN use_stdin = false;
BOOLEAN use_stdout = false;
BOOLEAN got_Input = false;
@@ -625,11 +642,11 @@
system_config_file = true;
-#ifdef __BEOS__
+#ifdef __NO_SYSLOG__
gSilent = true;
#endif
- gammaFile = defaultgammafile;
+ strncpy(gammaFile,defaultgammafile,MAXPATHLEN);
/* activate syslog */
if (!(gSilent))
@@ -663,6 +680,9 @@
gColorMode = true;
gFastMode = false;
gUnimode = false;
+ g300 = false;
+ gCompress = true;
+ gLogInfo = false; /* no LOG_INFO syslog messages by default */
gBlack = true;
gCyan = true;
gMagenta = true;
@@ -680,7 +700,7 @@
system_config_file = false;
- // read through the optional arguments before tring to find filenames
+ /* read through the optional arguments before tring to find filenames */
while ((c = getopt_long (argc, argv, "F:B:b:df:ghi:l:o:pr:s:t:v:x:y:",
long_opts, &opt_index)) != EOF)
@@ -688,39 +708,40 @@
switch (c)
{
case 0:
- // long options
+ /* long options */
switch (opt_index)
{
case 0:
- // --bw Black & White
+ /* --bw Black & White */
gColorMode = false;
- // gEcoMode = false; //this is not needed here (?) duncan
+#if 0
+ gEcoMode = false; /*this is not needed here (?) duncan*/
+#endif
gMaxPass = 1;
break;
case 1:
- // --fd Fast Dither
+ /* --fd Fast Dither*/
gFastMode = true;
gMaxPass = 1;
break;
case 2:
- // --version
- snprintf(syslog_message,message_size, "%s %s %s %s %s\n",
+ /* --version (output to stderr, not syslog) */
+ fprintf(stderr,"%s %s %s %s %s\n",
*argv, gMessages[LOG_VERSION],
VERSION, __DATE__, __TIME__);
- wrap_syslog (LOG_INFO,"%s",syslog_message);
exit (0);
break;
case 3:
- // --help
+ /* --help */
show_usage (*argv);
return 0;
break;
case 4:
- // --verbose
+ /* --verbose */
gVerbose = true;
if (!(gSilent))
{
@@ -730,23 +751,28 @@
break;
case 5:
- // --eco
+ /* --eco */
gEcoMode = true;
break;
case 6:
- // --noGamma
+ /* --noGamma */
get_Gamma = false;
break;
case 7:
- // --uni
+ /* --uni */
gUnimode = true;
break;
case 8:
- // --bi
+ /* --bi */
gUnimode=false;
+ break;
+
+ case 9:
+ /* --dpi300 */
+ g300=true;
break;
default:
@@ -774,19 +800,23 @@
case 'f':
{
- char *configFile;
+ char *configFile=NULL;
configFile = readPath (optarg);
- if (configFile)
+ if (configFile) {
read_config_file (configFile);
+ free(configFile);
+ }
}
break;
case 'F':
{
- char *path;
+ char *path=NULL;
path = readPath (optarg);
- if (path)
- gammaFile = path;
+ if (path) {
+ strncpy(gammaFile,path,MAXPATHLEN);
+ free(path);
+ }
}
break;
@@ -807,11 +837,12 @@
}
else
{
- char *path;
+ char *path=NULL;
path = readPath (optarg);
if (path)
{
- pnm_inputFile = path;
+ strncpy(pnm_inputFile,path,MAXPATHLEN);
+ free(path);
use_stdin = false;
got_Input = true;
}
@@ -830,11 +861,12 @@
}
else
{
- char *path;
+ char *path=NULL;
path = readPath(optarg);
if (path)
{
- ppa_outputFile = path;
+ strncpy(ppa_outputFile,path,MAXPATHLEN);
+ free(path);
use_stdout = false ;
got_Output = true;
}
@@ -986,11 +1018,11 @@
}
}
-
- // if the user doesn't specify an input or output file, we make like a pipe
+ /* if no input is specified, we terminate */
+ /* if the user doesn't specify output file, we make like a pipe*/
if (in == NULL)
- in = stdin;
+ exit(0);
if (out == NULL)
out = stdout;
@@ -1097,9 +1129,17 @@
}
+ /* if printer version is set to NOPRINTER in pnm2ppa.conf */
+ if (printer.version == NOPRINTER) {
+ snprintf(syslog_message,message_size,"pnm2ppa.conf: version 0; %s",
+ gMessages[E_PPA_UNKNOWN]);
+ wrap_syslog (LOG_CRIT,"%s",syslog_message);
+
+ exit (1);
+ }
+
/* now do the work! */
return print_pnm (in);
}
-
diff --git a/pnm2ppa.conf b/pnm2ppa.conf
index 4a1a779..076533c 100644
--- a/pnm2ppa.conf
+++ b/pnm2ppa.conf
@@ -6,13 +6,16 @@
# uncomment entries by removing "#" to activate them.
#
#-----------set the printer model---------------------------
-# YOU MUST CHOOSE ONE OF THE FOLLOWING, EVEN IF YOU DO NOTHING ELSE!
+# The printer model will normally be set by a -v command
+# line argument. Otherwise, if not set in the configuration file
+# it defaults to the 710/720 series. Remove/comment out the line
+# "version 0" below to get the default choice.
#
# If there is more than one "version" entry activated, the last one
# will be used. The printer version can also be set with the command line
# option e.g., "-v 720".
-version ERROR # PNM2PPA WIIL *NOT* WORK UNTIUL THIS ENTRY IS REMOVED!!!!
+version 0 # REMOVE THIS ENTRY to make 720 the default printer model!!!
#version 720 # 710, 712, 722 also acceptable
#version 820
#version 1000
@@ -23,14 +26,26 @@
# For security reasons, no input from the user is ever sent to the syslog.
# The setting "silent 1" suppresses messages to the syslog. The
# setting "verbose 1" sends messages to the standard error stream (stderr)
-# in addition to the syslog. (Note: on BeOS, syslog messages are
+# in addition to the syslog. (Note: if pnm2ppa was compiled with the
+# -D__NO_SYSLOG__ option (e.g., for BeOS), syslog messages are
# diverted to stderr; use "silent 1" to suppress them.)
-# Note: the "silent 1" keyword is only accepted from the system
-# configuration file (/etc/pnm2ppa.conf), and not from configuration files
-# specified with the pnm2ppa option "-f".
#silent 1
#verbose 1
+
+# (NEW FEATURE:)
+# standard informational messages ( when a job starts, when each page
+# prints, job finished, etc.) will not be recorded in the System Log,
+# unless explicitly activated here with the "log_info 1" keyword.
+# (i.e., "log_info 0" is the default.)
+# (Informational messages will still always be sent to stderr in "verbose"
+# mode, even if log_info is not set.)
+
+log_info 1 # <= COMMENT THIS OUT TO GET THE NEW DEFAULT BEHAVIOR!
+
+# Note: the "silent 1" and "log_info" keywords are only accepted from the
+# system configuration file (/etc/pnm2ppa.conf), and not from configuration
+# files specified by users with the pnm2ppa option "-f".
#---------set the margins of the printed page-------------------
# Margins: these are distances from the edges of the paper in
@@ -87,8 +102,11 @@
# color and black print heads. The third and fourth lines of the
# alignment test page (see above) tests these.
# The setting is correct when alignments "0" are correct.
-# Add or subtract the + or - number shown under the best-aligned shearing
-# alignment pattern.
+# The (positive or negative) number shown under the best-aligned shearing
+# alignment pattern tells you how much to change the colorshar or blackshear
+# value by. (For, example, if you print the calibration page with
+# "colorshear 0" (the default value) and the best pattern is labelled "-2",
+# uncomment the "colorshear" value below and set it equal to -2.)
#colorshear 0
#blackshear 0
@@ -150,6 +168,14 @@
#unimode 1
+#------------switch off (color) data compression------------------
+# Previously, data compression of color data sent to the printer
+# was not enabled. It is now enabled by default, but has only
+# been tested on HP71x/72xC models. Uncomment and set "compression 0"
+# to disable color data compression if necessary.
+
+#compression 1
+
#=====================================================================
# the following are switches for debugging purposes only:
# set their values to 0 to switch off the corresponding ink type:
diff --git a/pnm2ppa.h b/pnm2ppa.h
index 8c89fca..73d41a8 100644
--- a/pnm2ppa.h
+++ b/pnm2ppa.h
@@ -35,6 +35,7 @@
{"noGamma", 0, 0, 0},
{"uni", 0, 0, 0 },
{"bi", 0, 0, 0 },
+ {"dpi300", 0, 0, 0},
{0, 0, 0, 0}
};
diff --git a/pnmtools.h b/pnmtools.h
index 3fe283c..dcbf7fd 100644
--- a/pnmtools.h
+++ b/pnmtools.h
@@ -39,7 +39,9 @@
extern int Width; /* width and height in 600ths of an inch */
extern int Height;
-//extern int Pwidth; /* width in bytes */
+#if 0
+extern int Pwidth; /* width in bytes */
+#endif
extern char *color_bitmap;
extern int BitMap_topline; /* top line of bitmap */
extern int BitMap_bottomline; /* bottom line of bitmap */
@@ -49,8 +51,10 @@
#ifdef __CALIBRATE_PPA_C__
int Width; /* width and height in 600ths of an inch */
int Height;
-//int Pwidth; /* width in bytes */
-//int Pheight; /* height for malloc */
+#if 0
+int Pwidth; /* width in bytes */
+int Pheight; /* height for malloc */
+#endif
char *color_bitmap;
int BitMap_topline; /* top line of bitmap */
int BitMap_bottomline; /* bottom line of bitmap */
diff --git a/ppa.c b/ppa.c
index 0cdd34f..5f8ac91 100644
--- a/ppa.c
+++ b/ppa.c
@@ -344,6 +344,10 @@
{
unsigned char *out = iout;
int I, len = num_lines_d2;
+ unsigned compressed_len = 0;
+
+
+ /* abandon compression if datasize expands! */
for (I = 0; I < final_len; I += num_lines_d2, in += num_lines_d2)
{
@@ -367,12 +371,19 @@
{
/* Max is 128 */
*out++ = 0x00;
+ compressed_len++;
+ if (compressed_len > final_len)
+ return 0;
i += 128;
dup_len -= 128;
}
if (dup_len >= 1)
{
*out++ = dup_len;
+ compressed_len++;
+ if (compressed_len > final_len)
+ return 0;
+
i += dup_len;
}
/* See if we have enough non-zeros to be worth compressing. */
@@ -386,6 +397,10 @@
/* Max is 64 */
*out++ = (char) 0x80;
*out++ = (char) in[i];
+ compressed_len +=2;
+ if (compressed_len > final_len)
+ return 0;
+
i += 64;
dup_len -= 64;
}
@@ -393,6 +408,10 @@
{
*out++ = dup_len + 0x80;
*out++ = in[i];
+ compressed_len +=2;
+ if (compressed_len > final_len)
+ return 0;
+
i += dup_len;
}
}
@@ -430,10 +449,14 @@
int j;
*out++ = (char) 0xc0;
+ compressed_len ++;
for (j = i; j < i + 64; j++)
{
*out++ = in[j];
}
+ compressed_len += 64;
+ if (compressed_len > final_len)
+ return 0;
i += 64;
lit_len -= 64;
}
@@ -442,15 +465,22 @@
int j;
*out++ = lit_len + 0xc0;
+ compressed_len ++;
for (j = i; j < i + lit_len; j++)
{
*out++ = in[j];
}
+ compressed_len += lit_len;
+ if (compressed_len > final_len)
+ return 0;
i += lit_len;
}
}
}
}
+ if (compressed_len > final_len)
+ return 0;
+
return out - iout;
}
@@ -475,213 +505,203 @@
#endif
}
-//#define do_compress_data (1)
+/*#define do_compress_data (1) */
void
ppa_print_sweep (ppaPrinter_t * printer, ppaSweepData_t * data)
{
- unsigned char *pc, *tpc;
- unsigned i, datasize = data->data_size;
- unsigned char sweep_packet[144];
- int sweep_packet_size;
- unsigned short HP7X0constants[] = { 0x8ca0, 0x4650, 0x12c0 };
- unsigned short HP820constants[] = { 0x4650, 0x1c20, 0x0960 };
- unsigned short HP1000constants[] = { 0x4650, 0x2328, 0x0708 };
- unsigned short *constants;
- int nozzle_data_size;
- int MF; /* Multiplicative Factor -- quick hack */
- int k;
-
- unsigned char do_compress_data;
-
- DPRINTF("ppa_print_sweep: Dir: %d Color: %d Size: %d Vpos: %d Hpos: %d,%d\n",
- data->direction, data->in_color, data->data_size, data->vertical_pos,
- data->left_margin, data->right_margin );
- assert( ((data->direction == left_to_right) || (data->direction == right_to_left)) );
-
- if (gColorMode)
- do_compress_data = 0;
- else
- do_compress_data = 1;
-
- // DPRINTF("*********k up to %d\n",(data->in_color == 1 ? gMaxPass : 1));
- for (k = 0; k < (data->in_color == 1 ? gMaxPass : 1); k++)
+ unsigned char *pc, *tpc;
+ unsigned i, datasize = data->data_size;
+ unsigned char sweep_packet[144];
+ int sweep_packet_size;
+ unsigned short HP7X0constants[] = { 0x8ca0, 0x4650, 0x12c0 };
+ unsigned short HP820constants[] = { 0x4650, 0x1c20, 0x0960 };
+ unsigned short HP1000constants[] = { 0x4650, 0x2328, 0x0708 };
+ unsigned short *constants;
+ int nozzle_data_size;
+ int MF; /* Multiplicative Factor -- quick hack */
+
+ unsigned char do_compress_data;
+
+ DPRINTF("ppa_print_sweep(): Dir: %d Color: %d Size: %d Vpos: %d Hpos: %d,%d\n",
+ data->direction, data->in_color, data->data_size, data->vertical_pos,
+ data->left_margin, data->right_margin );
+ assert( ((data->direction == left_to_right) || (data->direction == right_to_left)) );
+
+ if (data->in_color && !gCompress )
+ do_compress_data = 0;
+ else
+ do_compress_data = 1;
+
+
+
+ pc = data->image_data;
+
+ DPRINTF(" ppa_print_sweep(): datasize= %d\n", datasize);
+
+ if (do_compress_data) {
+ unsigned compressed_datasize;
+ if (!(pc = malloc ((datasize / 64 + 1) * 65)))
+ {
+ snprintf(syslog_message,message_size, "ppa_print_sweep(): %s",
+ gMessages[E_PPA_BADMALLOC]);
+ wrap_syslog (LOG_CRIT,"%s",syslog_message);
+ exit (-1);
+ }
+ compressed_datasize =
+ compress (data->image_data,
+ data->nozzle_data->pins_used_d2, datasize, pc);
+ if (!compressed_datasize) {
+ /* compression would increase datsize ! */
+ free (pc);
+ do_compress_data = 0;
+ pc = data->image_data;
+ } else {
+ datasize = compressed_datasize;
+ DPRINTF(" ppa_print_sweep():compressed datasize= %d\n", datasize);
+ }
+
+ }
+
+ /* send image data 16k at a time */
+ for (i = 0, tpc = pc; i < datasize; tpc += 16384, i += 16384)
{
- // DPRINTF("********step %d\n",k);
- pc = data->image_data[k];
-
- if (do_compress_data)
- {
- if (!(pc = malloc ((datasize / 64 + 1) * 65)))
- {
- snprintf(syslog_message,message_size, "ppa_print_sweep(): %s",
- gMessages[E_PPA_BADMALLOC]);
- wrap_syslog (LOG_CRIT,"%s",syslog_message);
- exit (-1);
- }
- datasize =
- compress (data->image_data[k],
- data->nozzle_data->pins_used_d2, datasize, pc);
- }
-
- /* send image data 16k at a time */
- for (i = 0, tpc = pc; i < datasize; tpc += 16384, i += 16384)
- {
- vlink_put (printer->fptr, 0, ((datasize - i) > 16384) ? 16384 : (datasize - i), tpc);
- }
-
- /* memory leak fix courtesy of John McKown */
- if (do_compress_data)
- free (pc);
-
- /* construct sweep packet */
- switch (printer->version)
- {
- case HP820:
- constants = HP820constants;
- MF = 1;
- break;
- case HP7X0:
- constants = HP7X0constants;
+ vlink_put (printer->fptr, 0, ((datasize - i) > 16384) ? 16384 : (datasize - i), tpc);
+ }
+
+
+ /* memory leak fix courtesy of John McKown */
+ if (do_compress_data && pc){
+ free (pc);
+ pc = NULL;
+ }
+
+ /* construct sweep packet */
+ switch (printer->version) {
+ case HP820:
+ constants = HP820constants;
+ MF = 1;
+ break;
+ case HP7X0:
+ constants = HP7X0constants;
MF = 2;
break;
- case HP1000:
- constants = HP1000constants;
- MF = 1;
- break;
- default:
- snprintf(syslog_message,message_size, "ppa_print_sweep(): %s",
- gMessages[E_PPA_UNKNOWN]);
+ case HP1000:
+ constants = HP1000constants;
+ MF = 1;
+ break;
+ default:
+ snprintf(syslog_message,message_size, "ppa_print_sweep(): %s",
+ gMessages[E_PPA_UNKNOWN]);
wrap_syslog (LOG_CRIT,"%s",syslog_message);
- return;
- }
-
- sweep_packet[0] = 0;
- sweep_packet[1] = do_compress_data;
- sweep_packet[2] = data->direction == right_to_left ? 1 : 2;
- sweep_packet[3] = data->in_color ? 14 : 1;
-
- packLong (datasize, sweep_packet + 4);
-
- memset (sweep_packet + 8, 0, 8);
-
- if (data->in_color)
- packLong (MF * (data->vertical_pos +
- /*96+ */ printer->y_offset) /*+ 1*/,
- sweep_packet + 16);
- else
- packLong (MF *
- (data->vertical_pos +
- printer->y_offset), sweep_packet + 16);
- packShort (constants[0], sweep_packet + 20);
- packShort (MF *
- (data->left_margin + printer->x_offset) /*+ 1*/,
- sweep_packet + 22);
- packShort (MF *
- (data->right_margin + printer->x_offset) /*+ 1*/,
- sweep_packet + 24);
- if (data->in_color)
- packShort (0x2ee0, sweep_packet + 26);
- else
- packShort (constants[1], sweep_packet + 26); /* 2ee0 in color on 820 */
- packShort (constants[2], sweep_packet + 28);
- packShort (0x100, sweep_packet + 30);
-
-
- if ((data->in_color) && (k < gMaxPass - 1))
- {
- sweep_packet[32] = data->direction == right_to_left ? 1 : 2;
- sweep_packet[33] = data->in_color ? 14 : 1;
- packLong (MF *
- (data->vertical_pos +
- printer->y_offset), sweep_packet + 34);
- packShort (MF *
- (data->left_margin +
- printer->x_offset), sweep_packet + 38);
- packShort (MF *
- (data->right_margin +
- printer->x_offset), sweep_packet + 40);
- packShort (0x2ee0, sweep_packet + 42);
- packShort (constants[2], sweep_packet + 44);
- }
- else
- {
- if (data->next)
- {
- sweep_packet[32] =
- data->next->direction == right_to_left ? 1 : 2;
- sweep_packet[33] = data->next->in_color ? 14 : 1;
- packLong (MF *
- (data->next->vertical_pos +
- printer->y_offset), sweep_packet + 34);
- packShort (MF *
- (data->next->left_margin +
- printer->x_offset), sweep_packet + 38);
- packShort (MF *
- (data->next->right_margin +
- printer->x_offset), sweep_packet + 40);
- if (data->in_color)
- packShort (0x2ee0, sweep_packet + 42);
- else
- packShort (constants[1], sweep_packet + 42); /* 2ee0 in color on 820 */
+ return;
+ }
+
+ sweep_packet[0] = 0;
+ sweep_packet[1] = do_compress_data;
+ sweep_packet[2] = data->direction == right_to_left ? 1 : 2;
+ sweep_packet[3] = data->in_color ? 14 : 1;
+
+ packLong (datasize, sweep_packet + 4);
+
+ memset (sweep_packet + 8, 0, 8);
+
+ if (data->in_color)
+ packLong (MF * (data->vertical_pos +
+ /*96+ */ printer->y_offset) /*+ 1*/,
+ sweep_packet + 16);
+ else
+ packLong (MF *
+ (data->vertical_pos +
+ printer->y_offset), sweep_packet + 16);
+ packShort (constants[0], sweep_packet + 20);
+ packShort (MF *
+ (data->left_margin + printer->x_offset) /*+ 1*/,
+ sweep_packet + 22);
+ packShort (MF *
+ (data->right_margin + printer->x_offset) /*+ 1*/,
+ sweep_packet + 24);
+ if (data->in_color)
+ packShort (0x2ee0, sweep_packet + 26);
+ else
+ packShort (constants[1], sweep_packet + 26); /* 2ee0 in color on 820 */
+ packShort (constants[2], sweep_packet + 28);
+ packShort (0x100, sweep_packet + 30);
+
+
+ if (data->next) {
+ sweep_packet[32] =
+ data->next->direction == right_to_left ? 1 : 2;
+ sweep_packet[33] = data->next->in_color ? 14 : 1;
+ packLong (MF *
+ (data->next->vertical_pos +
+ printer->y_offset), sweep_packet + 34);
+ packShort (MF *
+ (data->next->left_margin +
+ printer->x_offset), sweep_packet + 38);
+ packShort (MF *
+ (data->next->right_margin +
+ printer->x_offset), sweep_packet + 40);
+ if (data->in_color)
+ packShort (0x2ee0, sweep_packet + 42);
+ else
+ packShort (constants[1], sweep_packet + 42); /* 2ee0 in color on 820 */
packShort (constants[2], sweep_packet + 44);
- }
- else
- memset (sweep_packet + 32, 0, 14);
- sweep_packet[46] = 8;
- }
- nozzle_data_size = data->nozzle_data_size;
- if (nozzle_data_size > 6)
- {
- snprintf(syslog_message,message_size, "ppa_print_sweep(): %s %d\n",
- gMessages[W_PPA_NOZZLE], nozzle_data_size);
- wrap_syslog (LOG_WARNING,"%s",syslog_message);
-
- nozzle_data_size = 6;
- }
- sweep_packet[47] = nozzle_data_size;
-
- for (pc = sweep_packet + 48, i = 0;
- i < nozzle_data_size; i++, pc += 16)
- {
- packShort (data->nozzle_data[i].DPI, pc);
- packShort (data->nozzle_data[i].pins_used_d2, pc + 2);
- packShort (data->nozzle_data[i].unused_pins_p1, pc + 4);
- packShort (data->nozzle_data[i].first_pin, pc + 6);
- packShort (data->nozzle_data[i].pins_used_d2, pc + 8);
- packShort (MF * (data->nozzle_data[i].left_margin + printer->x_offset),
- pc + 10);
- packShort (MF * (data->nozzle_data[i].right_margin + printer->x_offset),
- pc + 12);
- pc[14] = data->nozzle_data[i].nozzle_delay;
- pc[15] = 0;
- }
-
- sweep_packet_size = data->in_color ? 144 : 80;
-
- /* send sweep packet */
- switch (printer->version)
- {
- case HP820:
- scp_put (printer->fptr, 18, 1, 7, sweep_packet_size, sweep_packet);
- break;
- case HP7X0:
- scp2_put (printer->fptr, 0x0180, sweep_packet_size,
+ }
+ else
+ memset (sweep_packet + 32, 0, 14);
+ sweep_packet[46] = 8;
+
+ nozzle_data_size = data->nozzle_data_size;
+ if (nozzle_data_size > 6) {
+ snprintf(syslog_message,message_size, "ppa_print_sweep(): %s %d\n",
+ gMessages[W_PPA_NOZZLE], nozzle_data_size);
+ wrap_syslog (LOG_WARNING,"%s",syslog_message);
+
+ nozzle_data_size = 6;
+ }
+ sweep_packet[47] = nozzle_data_size;
+
+ for (pc = sweep_packet + 48, i = 0;
+ i < nozzle_data_size; i++, pc += 16) {
+ packShort (data->nozzle_data[i].DPI, pc);
+ packShort (data->nozzle_data[i].pins_used_d2, pc + 2);
+ packShort (data->nozzle_data[i].unused_pins_p1, pc + 4);
+ packShort (data->nozzle_data[i].first_pin, pc + 6);
+ packShort (data->nozzle_data[i].pins_used_d2, pc + 8);
+ packShort (MF * (data->nozzle_data[i].left_margin + printer->x_offset),
+ pc + 10);
+ packShort (MF * (data->nozzle_data[i].right_margin + printer->x_offset),
+ pc + 12);
+ pc[14] = data->nozzle_data[i].nozzle_delay;
+ pc[15] = 0;
+ }
+
+ sweep_packet_size = data->in_color ? 144 : 80;
+
+
+ /* send sweep packet */
+ switch (printer->version) {
+ case HP820:
+ scp_put (printer->fptr, 18, 1, 7, sweep_packet_size, sweep_packet);
+ break;
+ case HP7X0:
+ scp2_put (printer->fptr, 0x0180, sweep_packet_size,
7, 1, datasize, sweep_packet);
- break;
- case HP1000:
- scp3_put (printer->fptr, 0x0180, sweep_packet_size,
- 7, 1, datasize, sweep_packet);
- break;
- default:
- snprintf(syslog_message,message_size,"ppa_print_sweep(): %s",
- gMessages[E_PPA_UNKNOWN]);
- wrap_syslog (LOG_CRIT,"%s",syslog_message);
-
- return;
- }
- }
-}
+ break;
+ case HP1000:
+ scp3_put (printer->fptr, 0x0180, sweep_packet_size,
+ 7, 1, datasize, sweep_packet);
+ break;
+ default:
+ snprintf(syslog_message,message_size,"ppa_print_sweep(): %s",
+ gMessages[E_PPA_UNKNOWN]);
+ wrap_syslog (LOG_CRIT,"%s",syslog_message);
+
+ return;
+ }
+}
+
void
diff --git a/ppa.h b/ppa.h
index 6f56a06..8a01d6d 100644
--- a/ppa.h
+++ b/ppa.h
@@ -1,3 +1,4 @@
+
/***************************************************************************
ppa.h - PPA protocol definitions and routines
-------------------
@@ -57,11 +58,11 @@
typedef struct ppaSweepData_s
{
- unsigned char *image_data[4];
+ unsigned char *image_data;
unsigned data_size;
BOOLEAN in_color;
enum
- { right_to_left, left_to_right }
+ { right_to_left, left_to_right, unknown}
direction;
int vertical_pos;
unsigned short left_margin;
@@ -69,8 +70,34 @@
unsigned char nozzle_data_size;
ppaNozzleData_t *nozzle_data;
struct ppaSweepData_s *next; /* NULL indicates last print sweep */
+ int first_data_line;
+ int last_data_line;
+ int pre_blanklines;
+ int post_blanklines;
}
ppaSweepData_t;
+
+typedef struct ppaSwathLimits_s
+{
+ int left;
+ int right;
+ int numlines;
+ int non_blanklines;
+ int pre_blanklines;
+ int post_blanklines;
+ int first_line;
+ int last_line;
+}
+ppaSwathLimits_t;
+
+typedef struct ppaPageLimits_s
+{
+ int left;
+ int right;
+ int top;
+ int bottom;
+}
+ppaPageLimits_t;
void ppa_init_job (ppaPrinter_t *);
void ppa_init_page (ppaPrinter_t *);
diff --git a/ppa_protocol/scp_820cse.html b/ppa_protocol/scp_820cse.html
new file mode 100644
index 0000000..414b90a
--- /dev/null
+++ b/ppa_protocol/scp_820cse.html
@@ -0,0 +1,149 @@
+
+
+PRINT_SWEEP specification
+
+
+
+
+
+
HP 820Cse SCP protocol
+
+
Following is the probable specification for the SCP protocol on 820
+printers. There seem to be minor differences with the 820Cxi printer,
+and the protocol header is changed for 720 series printers.
+
+
+
Bytes
Description
+
2
Command specifier
+
2
Command reference number
+
1
Priority
+
1
Blank
+
2
Length of data
+
n
Data, including parameters to this command
+
+
+
Several of the commands are described below:
+
+
CS=35, CR=1 (INIT_COM ?)
+
+
This is some sort of initialization command. It probably
+initializes the communications channel, since it is always the first
+packet sent by the windows driver. It's data consists of 8 bytes
+that I have only seen as:
+
00 00 01 F4 01 00 00 00
+
+
CS=101, CR=2 (INIT_DATA ?)
+
+
This is another initialization command. It is sent once at the
+beginning of each file printed, after the INIT_COM packet. It is
+preceded by a 4-byte VLink packet sent to channel 0. This suggests
+that it somehow initializes the data channel of the printer (thus our
+temporary name). This packet typically contains the values: DE AD
+BE EF. The data portion of this command usually contains the
+following 8 bytes:
+
+
DE AD BE EF 02 00 00 00
+
+
CS=21, CR=1 (INIT_PAGE ?)
+
+
This command is sent each time before a page is loaded. It appears
+to set some parameters for the page, possibly the minimum and maximum
+horizontal positions for each of the four pens (?). The only data I have
+seen it contain is the following:
+
+
28 2D 00 41 29 2E 00 42 29 2E 00 42 29 2E 00 42
+
+
CS=19, CR=1 (HANDLE_MEDIA)
+
+
This is the command that handles loading and ejecting of pages.
+
+
+
1
1=load, 2=eject
+
1
?? usually 0x01
+
2
usually 0x0960 (2400 decimal), perhaps the
+horizontal position to place the print-head while loading/ejecting the
+page. 2400 corresponds to 4" from the left, which is about the center
+of the page for 8.5" pages.
+
+
+
CS=18, CR=1 (PRINT_SWEEP)
+
+
This is the print sweep command. It causes the print head to print
+a sweep of data (which has previously been sent over channel 0).
+
+
The PRINT_SWEEP command controls the print head while printing data
+on a page. It can take on two forms, one when printing with the black
+nozzles, and one when printing with the color nozzles. The black form
+is described in the most detail here, since it is what I have devoted
+the most attention to.
+
+
Following is the format of the first 48 bytes of data for this
+command:
+
+
Bytes
Description
+
1
always 0x00
+
1
1 = compressed, 0 = not compressed
+
1
2 = left-to-right, 1 = right-to-left
+
1
1 = black, 0xE = CMY colors
+
4
Compressed size of data
+
8
Typically 0
+
+
+
4
Signed number representing vertical
+position
+
2
Usually 0x4650 (18000 decimal)
+
2
Horizontal position for left margin in
+dots
+
2
Horizontal position for right margin in
+dots
+
2
0x1C20 (7200) for black data or 0x2EE0 (12000) for
+color data
+
2
Usually 0x0960 (2400)
+
2
Usually 0x0100 - has something to do with horizontal
+placement
+
+
+
1
If 0, this is the last sweep on the page; the next
+12 bytes are ignored. Otherwise, this field predicts the print head
+direction for the next PRINT_SWEEP command
+
1
Prediction of number of colors in next PRINT_SWEEP
+(0x01 or 0x0E)
+
4
Vertical position of next sweep
+
2
Horizontal position for left margin in next
+sweep
+
2
Horizontal position for right margin in next
+sweep
+
2
Predicts the third-to-last word (2-byte value) of
+the next sweep packet - 0x1C20 for black, 0x2EE0 for color
+
2
Usually 0x0960 - predicts the second-to-last word of
+the next sweep packet
+
1
0x08
+
1
Number of 16-byte rows to follow this header. This
+is 2 for black and 6 for CMY.
+
+
+
Following this header are sets of 16-byte rows to describe how to
+handle the nozzles. The odd nozzles are described by the first row,
+and the even nozzles are described by the second row.
+
+
Bytes
Description
+
2
DPI (dots per inch) - 300 or 600
+
2
Half of the total number of pins used
+
2
Number of unused pins + 1
+
2
First pin to start printing with, typically
+1
+
2
Half of the total number of pins used
+
2
Left margin in dots. For black printing, this is
+always 0x62 greater for the odd pins (first set) than the even
+pins
+
2
Right margin in dots.
+
1
Some sort of delay before this set of nozzles starts
+firing. See code for more details.
+
1
0
+
+
+
+
+
+
+
diff --git a/ppa_protocol/sweep_data.html b/ppa_protocol/sweep_data.html
index 94fd0ae..c342da7 100644
--- a/ppa_protocol/sweep_data.html
+++ b/ppa_protocol/sweep_data.html
@@ -122,7 +122,9 @@
odd swing buffer, and the second is the even swing buffer. These
correspond to which pins will be printing the data. Thus, the odd
swing buffer for the first column in the above example would look like
-this:
+this: (Note added: from inspection of the
+pbm2ppa and pnm2mma code, this seems to be
+the even swing buffer, not the odd one (?))
Byte 0
@@ -132,6 +134,7 @@
And the even swing buffer looks like this:
+(Note added: this seems to be the odd swing buffer (?))
Byte 8
diff --git a/rpm/redhat/pnm2ppa-redhat.patch b/rpm/redhat/pnm2ppa-redhat.patch
index 887719b..e06b914 100644
--- a/rpm/redhat/pnm2ppa-redhat.patch
+++ b/rpm/redhat/pnm2ppa-redhat.patch
@@ -1,36 +1,33 @@
-diff -uNr pnm2ppa-1.04/Makefile pnm2ppa-1.04.redhat/Makefile
---- pnm2ppa-1.04/Makefile Thu Nov 2 13:33:08 2000
-+++ pnm2ppa-1.04.redhat/Makefile Sat Nov 11 13:25:28 2000
-@@ -10,7 +10,7 @@
+diff -uNr pnm2ppa-1.11/Makefile pnm2ppa-1.11-redhat/Makefile
+--- pnm2ppa-1.11/Makefile Sat Oct 5 21:27:36 2002
++++ pnm2ppa-1.11-redhat/Makefile Sat Nov 9 17:08:45 2002
+@@ -11,7 +11,7 @@
+
+ #compiler and linker options:
+ CC=gcc
+-CFLAGS=-Wall -pedantic -O2
++CFLAGS=$(RPM_OPT_FLAGS)
+ LDFLAGS=-lm
+
INSTALL=install
-
- # production build
--CFLAGS=-Wall -pedantic -O2 -g -DNDEBUG
-+CFLAGS= $(RPM_OPT_FLAGS) -DNDEBUG
- LDFLAGS=-lm
- OBJS = pnm2ppa.o syslog.o ppa.o image.o dither.o cutswath.o hash_ink.o gamma.o
- SRC = pnm2ppa.c syslog.c ppa.c image.c dither.c cutswath.c hash_ink.c gamma.c
-diff -uNr pnm2ppa-1.04/pnm2ppa.conf pnm2ppa-1.04.redhat/pnm2ppa.conf
---- pnm2ppa-1.04/pnm2ppa.conf Sat Oct 28 11:02:57 2000
-+++ pnm2ppa-1.04.redhat/pnm2ppa.conf Sat Nov 11 13:26:57 2000
-@@ -12,7 +12,7 @@
+diff -uNr pnm2ppa-1.11/pnm2ppa.conf pnm2ppa-1.11-redhat/pnm2ppa.conf
+--- pnm2ppa-1.11/pnm2ppa.conf Sat Nov 9 16:47:47 2002
++++ pnm2ppa-1.11-redhat/pnm2ppa.conf Sat Nov 9 17:11:20 2002
+@@ -15,7 +15,7 @@
# will be used. The printer version can also be set with the command line
# option e.g., "-v 720".
--version ERROR # PNM2PPA WIIL *NOT* WORK UNTIUL THIS ENTRY IS REMOVED!!!!
-+
+-version 0 # REMOVE THIS ENTRY to make 720 the default printer model!!!
++#version 0 # REMOVE THIS ENTRY to make 720 the default printer model!!!
#version 720 # 710, 712, 722 also acceptable
#version 820
#version 1000
-@@ -29,8 +29,9 @@
- # configuration file (/etc/pnm2ppa.conf), and not from configuration files
- # specified with the pnm2ppa option "-f".
+@@ -41,7 +41,7 @@
+ # (Informational messages will still always be sent to stderr in "verbose"
+ # mode, even if log_info is not set.)
--#silent 1
--#verbose 1
-+silent 1 #SYSTEM LOG MESSAGES SILENCED
-+#verbose 1
-+
+-log_info 1 # <= COMMENT THIS OUT TO GET THE NEW DEFAULT BEHAVIOR!
++#log_info 1 # <= UNCOMMENT THIS TO GET THE OLD (pre v1.11) BEHAVIOR!
- #---------set the margins of the printed page-------------------
- # Margins: these are distances from the edges of the paper in
+ # Note: the "silent 1" and "log_info" keywords are only accepted from the
+ # system configuration file (/etc/pnm2ppa.conf), and not from configuration
diff --git a/rpm/redhat/pnm2ppa.spec b/rpm/redhat/pnm2ppa.spec
index 40fe225..c4953d4 100644
--- a/rpm/redhat/pnm2ppa.spec
+++ b/rpm/redhat/pnm2ppa.spec
@@ -1,16 +1,13 @@
-%define _mandir /usr/man
+%define _mandir /usr/share/man
Name: pnm2ppa
Summary: Drivers for printing to HP PPA printers
Serial: 1
Obsoletes: ppa
-Obsoletes: pbm2ppa
-Version: 1.04
-Release: 1
+Version: 1.11
+Release: 1rh7x
URL: http://sourceforge.net/projects/pnm2ppa
Source: http://download.sourceforge.net/pnm2ppa/pnm2ppa-%{version}.tar.gz
-Source1: http://www.httptech.com/ppa/files/ppa-0.8.6.tar.gz
-Patch2: pbm2ppa-20000205.diff
Patch3: pnm2ppa-redhat.patch
Copyright: GPL
Group: Applications/Publishing
@@ -21,7 +18,7 @@
pnm2ppa is a color driver for HP PPA host-based printers such
as the HP710C, 712C, 720C, 722C, 820Cse, 820Cxi, 1000Cse, and 1000Cxi.
It accepts ghostscript output in PNM formats, and sends it to the printer
-in PPA format. The older (black only) driver pbm2ppa is also included.
+in PPA format.
Install pnm2ppa if you have a PPA printer and need to print.
@@ -33,35 +30,21 @@
%setup -q -n %{topdir}
-#pbm2ppa source
-%setup -T -D -a 1 -n %{topdir}
-%patch2 -p0
%patch3 -p1 -b .rh
%build
make
-cd pbm2ppa-0.8.6
-make
-
%install
install -d $RPM_BUILD_ROOT/usr/bin
install -d $RPM_BUILD_ROOT/etc
install -d $RPM_BUILD_ROOT%{_mandir}/man1
-make INSTALLDIR=$RPM_BUILD_ROOT/usr/bin CONFDIR=$RPM_BUILD_ROOT/etc \
+make BINDIR=$RPM_BUILD_ROOT/usr/bin CONFDIR=$RPM_BUILD_ROOT/etc \
MANDIR=$RPM_BUILD_ROOT%{_mandir}/man1 install
install -m 0755 utils/Linux/detect_ppa $RPM_BUILD_ROOT/usr/bin/
install -m 0755 utils/Linux/test_ppa $RPM_BUILD_ROOT/usr/bin/
-install -m 0755 pbm2ppa-0.8.6/pbm2ppa $RPM_BUILD_ROOT/usr/bin/
-install -m 0755 pbm2ppa-0.8.6/pbmtpg $RPM_BUILD_ROOT/usr/bin/
-install -m 0644 pbm2ppa-0.8.6/pbm2ppa.conf $RPM_BUILD_ROOT/etc
-install -m 0644 pbm2ppa-0.8.6/pbm2ppa.1 $RPM_BUILD_ROOT%{_mandir}/man1
chmod 644 docs/en/LICENSE
-mkdir -p pbm2ppa
-for file in CALIBRATION CREDITS INSTALL INSTALL-MORE LICENSE README ; do
- install -m 0644 pbm2ppa-0.8.6/$file pbm2ppa/$file
-done
#---omit this section from Official RedHat/Mandrake releases!--------------
install -d $RPM_BUILD_ROOT/usr/lib/rhs/rhs-printfilters
@@ -80,31 +63,36 @@
%doc docs/en/RELEASE-NOTES docs/en/TODO
%doc docs/en/INSTALL.REDHAT.txt docs/en/COLOR.txt docs/en/CALIBRATION.txt
%doc docs/en/INSTALL.REDHAT.html docs/en/COLOR.html docs/en/CALIBRATION.html
+%doc docs/en/PPA_networking*
%doc test.ps
-%doc pbm2ppa
/usr/bin/pnm2ppa
-/usr/bin/pbm2ppa
-/usr/bin/pbmtpg
/usr/bin/calibrate_ppa
/usr/bin/test_ppa
/usr/bin/detect_ppa
%{_mandir}/man1/pnm2ppa.1*
-%{_mandir}/man1/pbm2ppa.1*
%config /etc/pnm2ppa.conf
-%config /etc/pbm2ppa.conf
#---omit from RedHat--------------------
-%doc docs/en/INSTALL.MANDRAKE.html docs/en/INSTALL.MANDRAKE.txt
+#%doc docs/en/INSTALL.MANDRAKE.html docs/en/INSTALL.MANDRAKE.txt
#------omit from Official RedHat/Mandrake releases!
-/usr/lib/rhs/rhs-printfilters/ppaprint-latest
-/usr/lib/rhs/rhs-printfilters/printerdb-ppa
-/usr/lib/rhs/rhs-printfilters/README.ppa
+#/usr/lib/rhs/rhs-printfilters/ppaprint-latest
+#/usr/lib/rhs/rhs-printfilters/printerdb-ppa
+#/usr/lib/rhs/rhs-printfilters/README.ppa
#-----------------------------------------
%changelog
+* Sat Oct 9 2002 Duncan Haldane
+- 1.11 release
+
+* Thu Jun 27 2002 Duncan Haldane
+- removed pbm2ppa for 1.10 (pre) release
+
+* Mon Jun 11 2002 Duncan Haldane
+- updated for 1.10 (pre) release.
+
* Tue Nov 24 2000 Duncan Haldane
- updated for 1.04 release.
diff --git a/sample_scripts/lprbw b/sample_scripts/lprbw
index 2a9ecd0..17d281a 100755
--- a/sample_scripts/lprbw
+++ b/sample_scripts/lprbw
@@ -1,3 +1,3 @@
cat $1 | \
-gs -sDEVICE=ppmraw -q -sPAPERSIZE=a4 -dNOPAUSE -r600 -sOutputFile=- - | \
-./pnm2ppa --bw --eco $2 $3 $4 $5 -i - -o /dev/lp0
+gs -sDEVICE=pbmraw -q -sPAPERSIZE=a4 -dNOPAUSE -r600 -sOutputFile=- - | \
+pnm2ppa --bw --eco $2 $3 $4 $5 -i - -o /dev/lp0
diff --git a/sample_scripts/lprcolor b/sample_scripts/lprcolor
index 4d45465..b745b5b 100755
--- a/sample_scripts/lprcolor
+++ b/sample_scripts/lprcolor
@@ -1,3 +1,3 @@
cat $1 | \
gs -sDEVICE=ppmraw -q -sPAPERSIZE=a4 -dNOPAUSE -r600 -sOutputFile=- - | \
-./pnm2ppa $2 $3 $4 $5 -i - -o /dev/lp0
+pnm2ppa $2 $3 $4 $5 -i - -o /dev/lp0
diff --git a/sample_scripts/lpreco b/sample_scripts/lpreco
index 5d14a30..450cbe3 100755
--- a/sample_scripts/lpreco
+++ b/sample_scripts/lpreco
@@ -1,3 +1,3 @@
cat $1 | \
gs -sDEVICE=ppmraw -q -sPAPERSIZE=a4 -dNOPAUSE -r600 -sOutputFile=- - | \
-./pnm2ppa --eco $2 $3 $4 $5 -i - -o /dev/lp0
+pnm2ppa --eco $2 $3 $4 $5 -i - -o /dev/lp0
diff --git a/syslog.c b/syslog.c
index e70f12c..996acaf 100644
--- a/syslog.c
+++ b/syslog.c
@@ -19,36 +19,35 @@
BeOS syslog() wrapper
syslog.c
modified Duncan Haldane
- Oct 2000. all syslog messages arrive here wrapped.
+ Oct 2000. all syslog messages arrive here wrapped.
*/
#include
#include "syslog.h"
#include "global.h"
-
+BOOLEAN verbose = false ;
/*
For some reason, BeOS doesn't seem to implement syslog(), even though it is
included with the system. Wierd. This wraps the syslog functions used
- and writes the info to the stderr stream.
+ and writes the info to the stderr stream, if __NO_SYSLOG__ is defined.
*/
void
wrap_syslog(int log_pri, char *fmt, char *message )
{
- if (!(gSilent))
-#ifdef __BEOS__
- {
- gSilent = true;
+ if (!(gSilent)) {
+#ifdef __NO_SYSLOG__
gVerbose = true;
- }
#else
- {
- syslog ( log_pri , "%s", message );
+ if (gLogInfo || log_pri != LOG_INFO)
+ syslog ( log_pri , "%s", message );
+ else if(verbose)
+ fprintf(stderr,"pnm2ppa: %s",message);
+#endif
}
-#endif
if (gVerbose)
{
@@ -60,16 +59,24 @@
void wrap_openlog( char *ident, int level )
{
-#ifndef __BEOS__
- if ( level )
- {
- /* level 1 has LOG_PERROR (prints to stderr) */
+#ifndef __NO_SYSLOG__
+ if ( level ) {
+ /* level 1 also sends messages to stderr */
+#ifdef __NO_LOG_PERROR__
+ /* for systems (e.g. Solaris) where LOG_PERROR is not valid */
+ openlog ( ident, LOG_CONS | LOG_PID, LOG_LPR);
+ gVerbose = true;
+#else
openlog ( ident, LOG_PERROR | LOG_CONS | LOG_PID, LOG_LPR);
- }
- else
- {
- /* standard level 0 */
+ verbose = gVerbose;
+ gVerbose = false;
+#endif
+ }
+ else {
+ /* standard level 0, messages sent to syslog only */
openlog ( ident, LOG_CONS | LOG_PID, LOG_LPR);
+ verbose = gVerbose;
+ gVerbose = false;
}
#endif
return;
@@ -78,7 +85,7 @@
void
wrap_closelog( void)
{
-#ifndef __BEOS__
+#ifndef __NO_SYSLOG__
closelog();
#endif
return;
diff --git a/syslog.h b/syslog.h
index 7d0e436..c6da41c 100644
--- a/syslog.h
+++ b/syslog.h
@@ -24,8 +24,8 @@
#define _PNM2PPA_SYSLOG_H_
-#ifdef __BEOS__
-/* these are not actually used for BeOS messages... */
+#ifdef __NO_SYSLOG__
+/* (included only for compatibility, if syslog.h is absent): */
#define LOG_EMERG 0 /* system is unusable */
#define LOG_ALERT 1 /* action must be taken immediately */
#define LOG_CRIT 2 /* critical conditions */
diff --git a/text-cz.h b/text-cz.h
index 8e9d5ab..ea68767 100644
--- a/text-cz.h
+++ b/text-cz.h
@@ -28,19 +28,19 @@
/* 04 */ "nemohu alokovat paměť pro ppa\n",
- /* 05 */ "chyba při volání", //followed by function name
+ /* 05 */ "chyba při volání", /*followed by function name*/
/* 06 */ "neznámá návratová hodnota přepínače\n",
- // from ppa,c
+ /* from ppa.c */
- /* 07 */ "zkracuji data pro trysky na 6 řádek, (původně ", // followed by number
+ /* 07 */ "zkracuji data pro trysky na 6 řádek, (původně ", /* followed by number */
- // messages from image.c
+ /* messages from image.c */
/* 08 */ "Nemohu vytvořit gamma.ppm soubor. Zkontrolujte práva\n",
- /* 09 */ "Předčasně ukončený vstup - narazil jsem na EOF při čtení obrázku:", //followed by format
+ /* 09 */ "Předčasně ukončený vstup - narazil jsem na EOF při čtení obrázku:", /*followed by format*/
/* 10 */ "Fatální chyba - nemohu číst obrázek\n",
@@ -48,15 +48,15 @@
/* 12 */ "Fatální chyba! Nemohu alokovat paměť pro buffer!\n",
- /* 13 */ "Vstupní obrázek nemá podporovaný PNM formát\n",
+ /* 13 */ "Fatální chyba! Vstupní obrázek (pnm2ppa) nemá PNM formát\n",
- /* 14 */ // (removed)
+ /* 14 */ /* (removed) */
- /* 15 */ "Tiskárna nemůže tisknout na papír velikosti ", //followed by size
+ /* 15 */ "Tiskárna nemůže tisknout na papír velikosti ", /*followed by size*/
- /* 16 */ "maximální hodnota PNM pixlu musí být 255, ale je: ", //followed by value
+ /* 16 */ "maximální hodnota PNM pixlu musí být 255, ale je: ", /*followed by value */
- // messages from ppa.c and pnm2ppa.c
+ /* messages from ppa.c and pnm2ppa.c */
/* 17 */ "Neznámá verze tiskárny\n",
@@ -64,9 +64,9 @@
/* 19 */ "Začínám zpracovávat tiskovou úlohu\n",
- /* 20 */ "Tisknu stránku ", //followed by page number
+ /* 20 */ "Tisknu stránku ", /*followed by page number*/
- /* 21 */ "Konec zpracování stránky ", //followed by page number
+ /* 21 */ "Konec zpracování stránky ", /*followed by page number*/
/* 22 */ "Žádné stránky nebyly vytištěny!\n",
@@ -80,11 +80,11 @@
/* 27 */ "neznámá velikost papíru\n",
- /* 28 */ "neznámý parametr", // not followed by \n
+ /* 28 */ "neznámý parametr", /* not followed by \n */
- /* 29 */ "na řádce", // followed by line number
+ /* 29 */ "na řádce", /* followed by line number */
- /* 30 */ "chyba při čtení konfiguračního souboru", // not followed by \n
+ /* 30 */ "chyba při čtení konfiguračního souboru", /* not followed by \n */
/* 31 */ "Fatální chyba: neznámý argument\n" ,
@@ -92,11 +92,11 @@
/* 33 */ "Nemohu otevřít vstupní PPA soubor\n",
- /* 34 */ "verze a datum překladu:", //followed by version number and date
+ /* 34 */ "verze a datum překladu:", /*followed by version number and date*/
/* 35 */ "Color correction curve (Gamma) file exists, but is corrupt.\n",
- /* 36 */ "POSSIBLE BUFFER OVERFLOW ATTACK!!: length of a path specified as an option exceeds", //followed by maximum allowed size
+ /* 36 */ "POSSIBLE BUFFER OVERFLOW ATTACK!!: length of a path specified as an option exceeds", /*followed by maximum allowed size*/
"FATAL: Špatné chybové hlášení\n"
diff --git a/text-en.h b/text-en.h
index b8bc312..548aa7a 100644
--- a/text-en.h
+++ b/text-en.h
@@ -27,19 +27,19 @@
/* 04 */ "could not malloc ppa storage\n",
- /* 05 */ "error calling", //followed by function name
+ /* 05 */ "error calling", /*followed by function name*/
/* 06 */ "unknown return code in switch\n",
- // from ppa,c
+ /* from ppa.c */
- /* 07 */ "truncating nozzle data to 6 rows, (was ", // followed by number
+ /* 07 */ "truncating nozzle data to 6 rows, (was ", /* followed by number*/
- // messages from image.c
+ /* messages from image.c */
/* 08 */ "Could not create gamma.ppm file. Check permissions\n",
- /* 09 */ "Truncated input - EOF while reading image:", //followed by format
+ /* 09 */ "Truncated input - EOF while reading image:", /*followed by format*/
/* 10 */ "Fatal error - failed to read input image\n",
@@ -47,15 +47,15 @@
/* 12 */ "Fatal error! Unable to allocate buffer memory!\n",
- /* 13 */ "Input image is not a supported PNM format\n",
+ /* 13 */ "Fatal error! Input image (pnm2ppa) is not a PNM image\n",
- /* 14 */ // (removed)
+ /* 14 */ /* (removed) */
- /* 15 */ "Printer cannot print on paper size ", //followed by size
+ /* 15 */ "Printer cannot print on paper size ", /*followed by size*/
- /* 16 */ "maximum PNM pixel value must be 255, but is: ", //followed by value
+ /* 16 */ "maximum PNM pixel value must be 255, but is: ", /*followed by value*/
- // messages from ppa.c and pnm2ppa.c
+ /* messages from ppa.c and pnm2ppa.c*/
/* 17 */ "Unknown Printer version\n",
@@ -63,9 +63,9 @@
/* 19 */ "Starting print job\n",
- /* 20 */ "Printing page ", //followed by page number
+ /* 20 */ "Printing page ", /*followed by page number*/
- /* 21 */ "Finished rendering page ", //followed by page number
+ /* 21 */ "Finished rendering page ", /*followed by page number*/
/* 22 */ "No pages printed!\n",
@@ -79,11 +79,11 @@
/* 27 */ "unknown paper size\n",
- /* 28 */ "unrecognized parameter", //not followed by \n
+ /* 28 */ "unrecognized parameter", /*not followed by \n */
- /* 29 */ "at line", // followed by line number
+ /* 29 */ "at line", /* followed by line number */
- /* 30 */ "error parsing config file", // not followed by \n
+ /* 30 */ "error parsing config file", /* not followed by \n */
/* 31 */ "Fatal: unknown argument\n" ,
@@ -91,11 +91,11 @@
/* 33 */ "Could not open PNM input file\n",
- /* 34 */ "version and build date:", //followed by version number and date
+ /* 34 */ "version and build date:", /*followed by version number and date */
/* 35 */ "Color correction curve (Gamma) file exists, but is corrupt.\n",
- /* 36 */ "POSSIBLE BUFFER OVERFLOW ATTACK!!: length of a path specified as an option exceeds", //followed by maximum allowed size
+ /* 36 */ "POSSIBLE BUFFER OVERFLOW ATTACK!!: length of a path specified as an option exceeds", /*followed by maximum allowed size */
"FATAL: Bad error message\n"
diff --git a/text-es.h b/text-es.h
index 88af3cc..ecc7ca3 100644
--- a/text-es.h
+++ b/text-es.h
@@ -37,19 +37,19 @@
/* 04 */ "no pude reservar memoria para almacenar el ppa\n",
- /* 05 */ "error invocando", //followed by function name
+ /* 05 */ "error invocando", /*followed by function name*/
/* 06 */ "codigo devuelto por switch desconocido\n",
- // from ppa,c
+ /* from ppa.c */
- /* 07 */ "truncando datos de las boquillas a 6 filas, (era ", // followed by number
+ /* 07 */ "truncando datos de las boquillas a 6 filas, (era ", /* followed by number */
- // messages from image.c
+ /* messages from image.c */
/* 08 */ "No pude crear el archivo gamma.ppm . Comprueba los permisos\n",
- /* 09 */ "Entrada truncada - EOF mientras leia la imagen:", //followed by format
+ /* 09 */ "Entrada truncada - EOF mientras leia la imagen:", /*followed by format */
/* 10 */ "Error fatal - imposible leer imagen de entrada\n",
@@ -57,15 +57,15 @@
/* 12 */ "Error fatal! Imposible reservar buffer de memoria!\n",
- /* 13 */ "La imagen de entrada no es uno de los formatos PNM soportados\n",
+ /* 13 */ "Error fatal! La imagen de entrada (pnm2ppa) no es una imagen PNM\n",
- /* 14 */ // removed
+ /* 14 */ /* removed */
- /* 15 */ "La impresora no puede imprimir en tamańo de papel ", //followed by size
+ /* 15 */ "La impresora no puede imprimir en tamańo de papel ", /*followed by size */
- /* 16 */ "el maximo calor para un pixel PNM debe ser 255, pero es: ", //followed by value
+ /* 16 */ "el maximo calor para un pixel PNM debe ser 255, pero es: ", /*followed by value */
- // messages from ppa.c and pnm2ppa.c
+ /* messages from ppa.c and pnm2ppa.c */
/* 17 */ "Version de impresora desconocida\n",
@@ -73,9 +73,9 @@
/* 19 */ "Comenzando trabajo de impresion\n",
- /* 20 */ "Imprimiendo pagina ", //followed by page number
+ /* 20 */ "Imprimiendo pagina ", /*followed by page number */
- /* 21 */ "Terminado renderizado de la pagina ", //followed by page number
+ /* 21 */ "Terminado renderizado de la pagina ", /*followed by page number*/
/* 22 */ "No imprimi ninguna pagina!\n",
@@ -89,11 +89,11 @@
/* 27 */ "tamańo de papel desconocido\n",
- /* 28 */ "parametro desconocido", //not followed by \n
+ /* 28 */ "parametro desconocido", /*not followed by \n*/
- /* 29 */ "en la linea", // followed by line number
+ /* 29 */ "en la linea", /* followed by line number */
- /* 30 */ "error procesando el archivo de configuracionco", // not followed by \n
+ /* 30 */ "error procesando el archivo de configuracionco", /* not followed by \n */
/* 31 */ "Critico: argumento desconocido\n" ,
@@ -101,9 +101,9 @@
/* 33 */ "No pude abrir el archivo de entrada PNM\n",
- /* 34 */ "version y fecha de compilacion:", //followed by version number and date
+ /* 34 */ "version y fecha de compilacion:", /*followed by version number and date */
/* 35 */ "El archivo de correcion de color (gamma) existe, pero esta corrupto.\n",
- /* 36 */ "POSSIBLE BUFFER OVERFLOW ATTACK!!: length of a path specified as an option exceeds", //followed by maximum allowed size
+ /* 36 */ "POSSIBLE BUFFER OVERFLOW ATTACK!!: length of a path specified as an option exceeds", /*followed by maximum allowed size */
"CRITICO: Mensaje de error incorrecto\n"
diff --git a/text-fr.h b/text-fr.h
index b1fc5e9..44a378c 100644
--- a/text-fr.h
+++ b/text-fr.h
@@ -28,19 +28,19 @@
/* 04 */ "ne peut allouer de mémoire pour ppa\n",
- /* 05 */ "erreur lors de l'appel ŕ", //suivi du nom de la fonction
+ /* 05 */ "erreur lors de l'appel ŕ", /*suivi du nom de la fonction*/
/* 06 */ "code retour inconnu lors du switch\n",
- // from ppa,c
+ /* from ppa.c */
- /* 07 */ "troncature des données buses ŕ 6 lignes, (initiallement ", //suivi du nombre
+ /* 07 */ "troncature des données buses ŕ 6 lignes, (initiallement ", /*suivi du nombre */
- // messages de image.c
+ /* messages de image.c */
/* 08 */ "ne peut créer le fichier gamma.ppm . Vérifiez les permissions\n",
- /* 09 */ "Entrée tronquée - EOF pendant la lecture de l'image:", //suivi du format
+ /* 09 */ "Entrée tronquée - EOF pendant la lecture de l'image:", /*suivi du format */
/* 10 */ "Erreur fatale - impossible de lire l'image en entrée\n",
@@ -48,15 +48,15 @@
/* 12 */ "Erreur fatale! Impossible d'allouer un buffer mémoire!\n",
- /* 13 */ "L'image en entrée n'est pas ŕ un format PNM supporté\n",
+ /* 13 */ "Erreur fatale! L'image en entrée (pnm2ppa) n'est pas un image PNM\n",
- /* 14 */ // removed
+ /* 14 */ /* removed */
- /* 15 */ "L'imprimante ne peut imprimer sur cette taille de papier ", //suivi de la taille
+ /* 15 */ "L'imprimante ne peut imprimer sur cette taille de papier ", /*suivi de la taille */
- /* 16 */ "la valeur maximale d'un pixel PNM devrait ętre 255, mais est : ", //suivi de la valeur
+ /* 16 */ "la valeur maximale d'un pixel PNM devrait ętre 255, mais est : ", /*suivi de la valeur */
- // messages de ppa.c et pnm2ppa.c
+ /* messages de ppa.c et pnm2ppa.c */
/* 17 */ "Version d'imprimante inconnue\n",
@@ -64,9 +64,9 @@
/* 19 */ "Début de la tâche d'impression\n",
- /* 20 */ "Impression de la page ", //suivi du numéro de page
+ /* 20 */ "Impression de la page ", /*suivi du numéro de page*/
- /* 21 */ "Fin du rendu de la page ", //suivi du numéro de page
+ /* 21 */ "Fin du rendu de la page ", /*suivi du numéro de page*/
/* 22 */ "Aucune page imprimée!\n",
@@ -80,11 +80,11 @@
/* 27 */ "taille de papier inconnue\n",
- /* 28 */ "paramčtre non reconnu", //non suivi de \n
+ /* 28 */ "paramčtre non reconnu", /*non suivi de \n*/
- /* 29 */ "ŕ la ligne", // suivi du numéro de ligne
+ /* 29 */ "ŕ la ligne", /* suivi du numéro de ligne*/
- /* 30 */ "erreur de traitement du fichier de configuration", //non suivi de \n
+ /* 30 */ "erreur de traitement du fichier de configuration", /*non suivi de \n */
/* 31 */ "Fatal: argument inconnu\n" ,
@@ -92,11 +92,11 @@
/* 33 */ "Ne peut ouvrir le fichier PNM en entrée\n",
- /* 34 */ "version et date de création:", //suivi du numéro de version et de sa date
+ /* 34 */ "version et date de création:", /*suivi du numéro de version et de sa date */
/* 35 */ "Color correction curve (Gamma) file exists, but is corrupt.\n",
- /* 36 */ "POSSIBLE BUFFER OVERFLOW ATTACK!!: length of a path specified as an option exceeds", //followed by maximum allowed size
+ /* 36 */ "POSSIBLE BUFFER OVERFLOW ATTACK!!: length of a path specified as an option exceeds", /*followed by maximum allowed size */
"FATAL: mauvais message d'erreur\n"
diff --git a/text-it.h b/text-it.h
index 641af3f..a37b4a7 100644
--- a/text-it.h
+++ b/text-it.h
@@ -25,42 +25,42 @@
/* 01 */ "impossibile leggere il margine superiore\n",
- /* 02 */ "impossibile espellere il margine inferiore\n", // FIXME: che vuol dire "clear bottom margin"?
+ /* 02 */ "impossibile espellere il margine inferiore\n", /* FIXME: che vuol dire "clear bottom margin"? */
/* 03 */ "impossibile leggere la riga successiva\n",
/* 04 */ "impossibile allocare memoria per il PPA\n",
- /* 05 */ "errore invocando la funzione", //followed by function name
+ /* 05 */ "errore invocando la funzione", /*followed by function name*/
- /* 06 */ "codice di ritorno dello scambio sconosciuto\n", // FIXME: "switch" = "scambio"??
+ /* 06 */ "codice di ritorno dello scambio sconosciuto\n", /* FIXME: "switch" = "scambio"?? */
- // from ppa.c
+ /* from ppa.c */
- /* 07 */ "troncati i dati del beccuccio a 6 righe, (erano ", // followed by number // FIXME: nozzle data??
+ /* 07 */ "troncati i dati del beccuccio a 6 righe, (erano ", /* followed by number */ /* FIXME: nozzle data?? */
- // messages from image.c
+ /* messages from image.c */
/* 08 */ "impossibile creare il file gamma.ppm. Controllare i permessi.\n",
- /* 09 */ "Input troncato - File terminato durante la lettura dell'immagine:", //followed by format
+ /* 09 */ "Input troncato - File terminato durante la lettura dell'immagine:", /*followed by format */
/* 10 */ "Errore critico - impossibile leggere l'immagine in ingresso\n",
/* 11 */ "Errore critico - l'immagine in ingresso ha pixel con valore > 255\n",
- /* 12 */ "Errore critico! Impossibile allocare memoria per il buffer!\n", // FIXME: "memoria tampone"?
+ /* 12 */ "Errore critico! Impossibile allocare memoria per il buffer!\n", /* FIXME: "memoria tampone"? */
- /* 13 */ "L'immagine in ingresso non č in un formato PNM riconosciuto\n",
+ /* 13 */ "Errore critic! L'immagine in ingresso (pnm2ppa) non č un immagine PNM\n",
- /* 14 */ // removed
+ /* 14 */ /* removed */
- /* 15 */ "La stampante non puň stampare su carta in formato ", //followed by size
+ /* 15 */ "La stampante non puň stampare su carta in formato ", /*followed by size*/
- /* 16 */ "indice colore errato: il massimo č 255, il file contiene ", //followed by value
+ /* 16 */ "indice colore errato: il massimo č 255, il file contiene ", /*followed by value */
- // messages from ppa.c and pnm2ppa.c
+ /* messages from ppa.c and pnm2ppa.c */
/* 17 */ "Versione della stampante sconosciuta\n",
@@ -68,9 +68,9 @@
/* 19 */ "Comincia il lavoro di stampa\n",
- /* 20 */ "Stampa in corso, pagina ", //followed by page number
+ /* 20 */ "Stampa in corso, pagina ", /*followed by page number*/
- /* 21 */ "Composta la pagina ", //followed by page number
+ /* 21 */ "Composta la pagina ", /*followed by page number*/
/* 22 */ "Nessuna pagina stampata!\n",
@@ -82,13 +82,13 @@
/* 26 */ "impossibile aprire il file di configurazione\n",
- /* 27 */ "formato della carta sconosciuto\",
+ /* 27 */ "formato della carta sconosciuto\n",
- /* 28 */ "parametro non riconosciuto", //not followed by /n
+ /* 28 */ "parametro non riconosciuto", /*not followed by /n */
- /* 29 */ "alla linea", // followed by line number
+ /* 29 */ "alla linea", /* followed by line number */
- /* 30 */ "errore nel file di configurazione", // not followed by \n
+ /* 30 */ "errore nel file di configurazione", /* not followed by \n */
/* 31 */ "Errore critico: argomento sconosciuto\n" ,
@@ -96,10 +96,14 @@
/* 33 */ "Impossibile aprire il file di ingresso PNM\n",
- /* 34 */ "versione e data di compilazione:", //followed by version number and date
+ /* 34 */ "versione e data di compilazione:", /*followed by version number and date */
/* 35 */ "Color correction curve (Gamma) file exists, but is corrupt.\n",
- /* 36 */ "POSSIBLE BUFFER OVERFLOW ATTACK!!: length of a path specified as an option exceeds", //followed by maximum allowed size
+ /* 36 */ "POSSIBLE BUFFER OVERFLOW ATTACK!!: length of a path specified as an option exceeds", /*followed by maximum allowed size */
"ERRORE CRITICO: messaggio di errore impossibile (bug nel programma)\n"
+
+
+
+
diff --git a/text-nl.h b/text-nl.h
index ab3ec76..00dfc07 100644
--- a/text-nl.h
+++ b/text-nl.h
@@ -33,23 +33,23 @@
/* 04 */ "er kon geen geheugen toewijzen worden voor de ppa opslag\n",
/* error calling */
-/* 05 */ "fout tijdens het aanroepen van ", //followed by function name
+ /* 05 */ "fout tijdens het aanroepen van ", /*followed by function name*/
/* unknown return code in switch */
/* 06 */ "onbekende return code in switch\n",
-// from ppa,c
+ /* from ppa.c */
/* truncating nozzle data to 6 rows, (was */
-/* 07 */ "spuitgat gegevens worden afgekapt tot 6 rijen, (het waren ", // followed by number
+ /* 07 */ "spuitgat gegevens worden afgekapt tot 6 rijen, (het waren ", /* followed by number*/
-// messages from image.c
+ /* messages from image.c */
/* Could not create gamma file. Check permissions */
/* 08 */ "gamma.ppm bestand kon niet worden gemaakt. Controleer de toegangsrechten\n",
/* Truncated input - EOF while reading image: */
-/* 09 */ "Afgekapte invoer - EOF tijdens het lezen van de afbeelding: ", //followed by format
+ /* 09 */ "Afgekapte invoer - EOF tijdens het lezen van de afbeelding: ", /*followed by format*/
/* Fatal error - failed to read input image */
/* 10 */ "Fatale fout - invoer afbeelding kon niet gelezen worden\n",
@@ -61,19 +61,19 @@
/* 12 */ "Fatale fout! Kan geen buffer geheugen toewijzen!\n",
/* Input image is not a supported PNM format */
-/* 13 */ "Invoer afbeelding is niet van een door PNM ondersteunde indeling\n",
+/* 13 */ "Fatale fout! Invoer afbeelding (pnm2ppa) is niet een PNM indeling\n",
/* Unknown PNM magic */
- /* 14 */ //removed
+ /* 14 */ /*removed*/
/* Printer cannot print on paper size */
-/* 15 */ "De printer kan niet afdrukken op de papiergrootte ", //followed by size
+ /* 15 */ "De printer kan niet afdrukken op de papiergrootte ", /*followed by size */
/* maximum PNM pixel value must be 255, but is: */
-/* 16 */ "maximale PNM pixel waarde moet 255 zijn, maar het is: ", //followed by value
+ /* 16 */ "maximale PNM pixel waarde moet 255 zijn, maar het is: ", /*followed by value*/
-// messages from ppa.c and pnm2ppa.c
+ /* messages from ppa.c and pnm2ppa.c */
/* Unknown Printer version */
/* 17 */ "Onbekende printer versie\n",
@@ -85,10 +85,10 @@
/* 19 */ "Afdruk opdracht wordt gestart\n",
/* Printing page */
-/* 20 */ "Bezig met afdrukken van pagina ", //followed by page number
+ /* 20 */ "Bezig met afdrukken van pagina ", /*followed by page number */
/* Finished rendering page */
-/* 21 */ "Klaar met afbeelden van pagina ", //followed by page number
+ /* 21 */ "Klaar met afbeelden van pagina ", /*followed by page number */
/* No pages printed! */
/* 22 */ "Geen pagina's afgedrukt!\n",
@@ -109,13 +109,13 @@
/* 27 */ "onbekende papiergrootte\n",
/* unrecognized parameter */
- /* 28 */ "onbekende parameter", //not followed by \n
+ /* 28 */ "onbekende parameter", /*not followed by \n */
/* at line */
-/* 29 */ "in rij ", // followed by line number
+ /* 29 */ "in rij ", /* followed by line number */
/* error parsing config file */
-/* 30 */ "fout bij het interpreteren van het configuratie bestand", // not followed by \n
+ /* 30 */ "fout bij het interpreteren van het configuratie bestand", /* not followed by \n */
/* Fatal: unknown argument */
/* 31 */ "Fataal: onbekend argument\n",
@@ -127,12 +127,12 @@
/* 33 */ "PNM invoer bestand kon niet geopend worden\n",
/* version and build date: */
-/* 34 */ "versie en compileer datum: ", //followed by version number and date
+ /* 34 */ "versie en compileer datum: ", /*followed by version number and date*/
/* 35 */ "Color correction curve (Gamma) file exists, but is corrupt.\n",
- /* 36 */ "POSSIBLE BUFFER OVERFLOW ATTACK!!: length of a path specified as an option exceeds", //followed by maximum allowed size
+ /* 36 */ "POSSIBLE BUFFER OVERFLOW ATTACK!!: length of a path specified as an option exceeds", /*followed by maximum allowed size*/
/* FATAL: Bad error message */
diff --git a/utils/Linux/detect_ppa b/utils/Linux/detect_ppa
index 5c81e2c..8803e64 100755
--- a/utils/Linux/detect_ppa
+++ b/utils/Linux/detect_ppa
@@ -1,21 +1,33 @@
#!/bin/sh
# script for testing installation of a PPA printer, v0.5 20000908
-# (C) 2000 The pnm2ppa project
+# (C) 2000,2001 The pnm2ppa project
# Requires Linux 2.2.x kernels with parport autoprobe support.
-# assumes all parallel ports are in the range 0-7
-# (as linux/include/parport.h sets PARPORT_MAX=8)
+# Now updated for 2.4.x kernels too.
+# assumes all parallel ports are in the range 0-7 (0-15 in 2.4 kernels)
+# (as linux/include/parport.h sets PARPORT_MAX=8) (=16 in 2.4)
MODPROBE="/sbin/modprobe"
+PROC_PARPORT="/proc/parport"
+PARPORT=""
+PARPORT_LIST="0 1 2 3 4 5 6 7"
echo "*** Script for testing installation of PPA printers on Linux "
echo " (requires 2.2.x kernel or later)"
supported="710 720 820 1000"
-if [ "$($MODPROBE -l parport_probe.o )" = "" ] ; then
- echo "*** kernel module parport_probe.o not found:"
- echo "*** IEEE-1284 autodetection not supported by this Linux kernel"
- exit 1
+if [ -e /proc/sys/dev/parport ] ; then
+ echo "*** 2.4.x kernel: found /proc/sys/dev/parport/"
+ PROC_PARPORT="/proc/sys/dev/parport"
+ PARPORT="parport"
+ PARPORT_LIST="0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15"
+else
+
+ if [ "$($MODPROBE -l parport_probe.o )" = "" ] ; then
+ echo "*** kernel module parport_probe.o not found:"
+ echo "*** IEEE-1284 autodetection not supported by this Linux kernel"
+ exit 1
+ fi
fi
if ! $($MODPROBE -r ) ; then
@@ -33,18 +45,18 @@
done
$MODPROBE lp
-if [ -e /proc/parport ] ; then
+if [ -e $PROC_PARPORT ] ; then
found=0
found_ppa=0
ppa_printer=""
- for n in 0 1 2 3 4 5 6 7 ; do
- if [ -e /proc/parport/$n/autoprobe ] ; then
+ for n in $PARPORT_LIST ; do
+ if [ -e $PROC_PARPORT/$PARPORT$n/autoprobe ] ; then
found=1
echo " "
- echo "Printer found at parallel port $n (usually /dev/lp$n )"
+ echo "Device found at parallel port $n (usually /dev/lp$n )"
echo "IEEE-1284 autoprobe reports:"
- cat /proc/parport/$n/autoprobe
- report=$(cat /proc/parport/$n/autoprobe)
+ cat $PROC_PARPORT/$PARPORT$n/autoprobe
+ report=$(cat $PROC_PARPORT/$PARPORT$n/autoprobe)
for printer in $supported ; do
if $(echo $report |grep -e "DESKJET $printer" >/dev/null) ; then
found_ppa=1