<!doctype linuxdoc system>
<article>

<!-- Title information -->

<title>PPA Printer calibration for pnm2ppa
<author>The pnm2ppa project team 
<htmlurl url="mailto:ppa-rpms@sourceforge.net"
name="ppa-rpms@users.sourceforge.net">
<date>v0.4, October 28,  2000
<abstract>
Information and instructions
for printer calibration using  pnm2ppa.
<htmlurl 
url="http://sourceforge.net/projects/pnm2ppa"
name="http://sourceforge.net/projects/pnm2ppa">
(Updated for pnm2ppa-1.02 and later.)
</abstract>

<!-- Begin the document -->


<p>
<bf> Overview of Printer Calibration.</bf>

There are three main tasks you may need to carry out to fine-tune
your PPA printer:
<itemize>
<item>Adjust the x-offset and y-offset to <bf>correctly center
the printed page on the paper</bf>
<item>Adjust the relative offsets between black and colored ink
printing - <bf>this should be done each time you replace an ink
cartridge</bf>.
<item> Match the colors of printed images to some other output device
- this is <bf>color correction</bf> and is
described in 
<htmlurl 
url="./COLOR.html"
name="COLOR.html"> (or COLOR.txt).
</itemize>

These instructions assume that you are already able to print postscript
files with your PPA printer.   If your print filters
are properly configured, something like &quot;<tt>lpr test.ps</tt>&quot; 
will successfully invoke ghostscript and pnm2ppa
to print the postscript file test.ps.   Alternatively, you may be using 
shell scripts like &quot;lprbw&quot;, &quot;lprcolor&quot; 
and &quot;lpreco&quot; supplied with the
pnm2ppa source code, and modified by you for your defaults; you may also
have defined special printing devices in <tt>/etc/printcap</tt>, e.g.
a &quot;coloreco&quot; device so you print
with  <tt>lpr -P coloreco  test.ps</tt>.    These details vary with
the operating system and distribution you use.

<p>
<bf> (1) Centering the printed page on the paper. </bf>

This is done by adjusting the x-offset and y-offset parameters
<bf>xoffset</bf> and <bf>yoffset</bf>
in the <tt>pnm2ppa</tt> configuration file (usually
<tt>/etc/pnm2ppa.conf</tt>).   The parameters are given in units of
1/600 inch; increasing <tt>xoffset</tt>  moves the image
to the right, and increasing <tt>yoffset</tt> moves it downwards.
These offsets now have default values defined for each printer model,
and you will probably not need to adjust them.
Uncomment and make small adjustments to the default
values for these in the configuration file, until the printout is satisfactory.
(You can also  use the '-x' and '-y'
command-line parameters.)    


There are two ways to check the offsets.
<itemize>
<item>either <bf>using the "<tt>calibrate_ppa</tt>" program.</bf>  
<item>or   <bf>printing a suitable test page</bf>.

</itemize>

<p>
The "<tt>calibrate_ppa</tt>" program  is a
stand-alone program distributed with <tt>pnm2ppa</tt> which
creates various test patterns in the raw
pixmap  format accepted by pnm2ppa. (The three paper sizes,
US Letter,  US Legal, and A4, are supported).
If your paper size is A4, and your printer filter accepts
the "<tt>-l</tt>" (direct output) option to <tt>lpr</tt>, 
the command to run is:
<tscreen><verb>
 calibrate_ppa -s a4  --center  | pnm2ppa --bw  -i -  -o - | lpr -l
</verb></tscreen>
(Substitute "letter"  or "legal" for "a4" to change
the papersize; if no paper size is specified, it is assumed to
be <tt>letter</tt>.)   


 
If "<tt>lpr -l</tt>" is not valid, you need to know  which port your
printer is attached to.   Assuming it is <tt>/dev/lp0</tt>, the above 
command becomes
<tt> calibrate_ppa  -s a4 --center | pnm2ppa --bw  -i -  -o  /dev/lp0</tt>.


The pattern shows  distances from the edge of the printed page
in units of 50 dots (1/12 inch), and diagonal lines that should
point to the corners.  Change <tt>xoffset</tt> and <tt>yoffset</tt>
in the configuration file (usually <tt>/etc/pnm2ppa.conf</tt>
to center the pattern.    The configuration file is
supplied with commented-out entries like
<tt>#xoffset 160</tt> showing the default value.  Remove
the &quot;<tt>#</tt>&quot to activate the entry.

In Red Hat or Mandrake Linux distributions, a suitable test  page is 
<tt>/usr/lib/rhs/rhs-printfilters/testpage.ps</tt>
(US Letter paper) or
<tt>/usr/lib/rhs/rhs-printfilters/testpage-a4.ps</tt>
(A4 paper).   (If these are not available, similar test pages
are supplied in the pnm2ppa source  distribution.)
These pages have margins drawn at standard distances from the
edges of the paper, and can also be used to check the centering,
but are not as accurate




<bf> (2) Calibrating the X and Y Color Head Offsets. </bf>

The color ink offsets now have to be calibrated with respect to the black ink.
Because the relative position of the two ink cartridges
can move slightly,
<bf>this must be done whenever an ink cartridge is removed and replaced</bf>.

To print an alignment calibration pattern on a4 paper, run
<tscreen><verb>
calibrate_ppa -s a4  --align | pnm2ppa --fd  -i - -o - | lpr -l
</verb></tscreen>

On the printed page, there are four  alignment patterns,
corresponding to configuration file
parameters  <bf>ColOffsX</bf>, <bf>ColOffsY</bf>, <bf>colorshear</bf>
and <bf>blackshear</bf>.   The central alignment patterns,
labelled &quot;0&quot; should be perfectly aligned.   If they are
not, first
correct the shearing patterns, (see below).
Then identify the best-aligned  <bf>ColOffsX</bf>
and <bf>ColOffsY</bf> patterns, and  add or subtract the 
positive or negative number below the pattern from the value in
the configuration file. 
 
Check the result  by printing the alignment test pattern:
<tscreen><verb>
calibrate_ppa  --test | pnm2ppa -fd  -i - -o - | lpr -l
</verb></tscreen>
The lines in the cross and square should be perfectly straight now.

The calibration can also be done by printing the test page 
<tt>test.ps</tt> (found in the tarball
<tt>pnm2ppa-1.0.tar.gz</tt>; or installed 
with the <tt>pnm2ppa</tt> documentation. (This is often in 
<tt>/usr/doc/pnm2ppa*/</tt>.)

On the printout you see several images:
<itemize>
<item>top left, you see a square with both black and colored items. 
These should align correctly, or you have to change your settings.
<item>You see a large vertical bar, and also a horizontal bar.
On the sides of the vertical  bar there are a blue and a green line. 
These should align with the 0 mark.
<item> You also see a small vertical, and horizontal, bar, with a 
red bar on its side.
</itemize>

If these items do NOT line up, you should take the following steps:
<itemize>
<item>
(1) take for the large bar the number of the tickmark just smaller
than the place where the green and blue lines point to. The minor
tick marks are 25 points.
<item>
(2) To this number, add the number of the tick mark at which a red tick
mark exactly lines up. This might not work if the offsets are way off;
in that case, apply the correction of step 1, and print again.
<item>
(3) Add the horizontal offset to the value 
of <bf>ColOffsX</bf>, and the vertical offset to 
the value of <bf>ColOffsY</bf> in the configuration file.
</itemize>

Now you can print test.ps again to see whether this procedure worked.


<bf>Shearing  adjustments</bf>

If bidirectional printing causes &quot;shearing&quot; of vertical lines
(horizontal offsets of those parts of the line printed
by left-to-right print-head sweeps relative to those printed on
right-to-left sweeps) you can make small adjustments (in 1/600 inch)
units using the <bf>blackshear</bf> and <bf>colorshear</bf>
parameters in the configuration file.  You can also suppress
bidirectional printing with a  <bf>unimode  1</bf> 
configuration file entry.

The third and fourth lines on the color head offset calibration page 
(see above) correspond to color and black print head  shearing corrections. 
If the central alignment patterns  (labeled &quot;0&quot;)
are not aligned,  add  or subtract the  positive or negative number
below the best-aligned pattern from the <tt>colorshear</tt>
and <tt>blackshear</tt> values in the configuration file.

<bf>Cleaning the Print Heads</bf>

You can use <tt>calibrate_ppa</tt> to clean the print heads by 
printing patterns that exercise  all the ink nozzles:
<tscreen><verb>
calibrate_ppa  --clean | pnm2ppa -p   -i - -o - | lpr -l
calibrate_ppa  --clean | pnm2ppa --bw  -i - -o - | lpr -l
</verb></tscreen>
The first of these commands prints a cleaning pattern
with colored ink, the second uses black ink.


<bf>Other  adjustments</bf>

The parameter <bf>blackness</bf> adjusts the number of black ink
drops printed per pixel.  It takes values 1, 2, 3, or 4 (2 is the
default).  Other values, like 0, suppress black ink.

Inks can also be suppressed by configuration file
entries 
<tt>black_ink 0</tt>,
<tt>color_ink 0</tt>,
<tt>cyan_ink 0</tt>,
<tt>magenta_ink 0</tt>,
or <tt>yellow_ink 0</tt>.
These  are mainly useful for debugging
the printer driver.

</article>














