=== Intro ==============================

dvibj is a dvi driver for Canon BJ-200 printers.  It does

  1-sided or manual 2-sided
  1-up, 2-up or 4-up
  portrait or landscape
  draft or letter quality (i.e., gray or black)

You should have Metafont installed, then it will generate the fonts
it needs.  It uses the same MakeTeXPK script that dvips does.

It needs 360 dpi fonts, which are not a standard size in common TeX
distributions.  2-up and 4-up output require yet more oddball sizes:

    mode	magstep	   resolution	

    normal        0	      360
    2-up	 -1.5	      274
    4-up	 -3.5	      190	

Keeping up with this by hand would be cumbersome, so get MakeTeXPK
working first.


=== dvibj .vs. dvips | gs ==============================

You must use dvips and gs if the document imports postscript graphics --
dvibj does not do postscript.  dvips also does TPIC and EMTEX and others.

dvibj is faster, produces sharper reduced output, and supports things
like 2-sided 2-up draft mode.

If you use dvips, be sure it is configured correctly for the Bubblejet --
config.ps should include 'D 360' and 'r'.  Distributed configurations
often use 300dpi bitmaps which are then scaled to 360dpi by ghostscript,
which is suboptimal.

(While you're at it, if your xdvi is older than mid-93, get a new one
from say ftp.x.org that does grayscale anti-aliasing.  MUCH superior.)


=== About 1-sided and 2-sided printing ==============================

By default dvibj prints 1-sided.  It prints the last page first so the
output ends up with the first page on top.

For 2-sided printing, there are two flags, -even and -odd.  First
print the file with -odd.  Put the output back into the printer, top
edge down with the blank side forward.  Print the file again with
-even.  [ Mnemonic: first print page 1 etc, then print page 2 etc. ]


=== About draft mode ==============================

Use -draft to get gray instead of black printing.  This saves ink
and prints a little faster. By default, output is letter quality, 
i.e., black.


=== About 2-up and 4-up and landscape ==============================

dvibj can print two or four page images per side of paper.  It uses
the TeX magnification facility to shrink the page image.

Vanilla TeX's print area is 6.5 x 9 inches, which gives 1-inch margins
all around on an 8.5 x 11 page.  Reduced output uses equal left,
right, and center margins (and equal top, middle, and bottom margins),
which looks better than a straight 50% reduction.  But documents that
stick out into the margins may have problems because the margins overlap.

Printable width is fixed at 8 inches, that's a hardware restriction,
so you can't print within 1/4 inch of the edge of an 8.5 inch page.
Paper length is 11 inches by default, it can be changed with the
-paper-length flag, which specifies the length inches (in floating
point).  You can't print within 1/4 inch of the top or bottom either,
this is also a hardware restriction.

The -landscape flag produces landscape output.  You need to swap
\hsize and \vsize in the tex document for this to be useful.


=== About font paths ==============================

There are many standard names for the environment variable telling
drivers where the fonts are.  dvibj uses PKFONTS, which is the only
one acceptable to both xdvi and dvips.  For interactive use, you
can define it with the usual colon-separated list of directory names.

dvibj is primarily meant to be used as an lpd filter, and for
that environment you can define PKFONTS in the script that runs
dvibj or just put the path in the Makefile.

dvibj also needs the path to MakeTeXPK, in the Makefile.


=== Man page ==============================

Usage is
    dvibj -flags < infile > outfile

Flgs are

   -silent suppresses non-error messages on stderr

   -draft produces light output using less ink

   -two-up prints two pages side by side on each physical page

   -four-up prints four pages per page

   -landscape prints in landscape mode (use appropriate \hsize, \vsize)

   -odd prints every other sheet starting at the first.

   -even prints every other sheet starting at the second, followed by
     a blank page if the last sheet was not even.

   -paper-length N.N gives the height of the physical paper in inches.

   -xoffset N.N moves the output right N.N inches (may be negative)

   -yoffset N.N moves the output down N.N inches (may be negative)

   -magnification N.N multiplies the image size by N.N


=== Installation ==============================

The details depend on how your current TeX setup is organized.  I have
included some files that I use as examples; they are not meant to work
out of the box.  Some fiddling will be required.

You will need to know these things:
					    (example)
    where is metafont			/usr/TeX/bin/mf
    where is modes.mf			/usr/TeX/lib/mf/inputs/modes.mf
    where is MakeTeXPK			/usr/TeX/bin/MakeTeXPK
    where are the tfm's			/usr/TeX/lib/tex/tfm
    where are the pk's			/usr/TeX/lib/tex/pk

First, locate or install metafont.  Find mf/inputs/modes.mf.  See if
it includes a mode for the BJ-200.  If it does not, add one; the def I
use is in modes.mf.bj200.  Change it around if you like, and add it to
modes.mf.

[ Note: the name 'bj' is not canonical, but it will do for me.  If you
have a recent distribution or have installed dvips, there will
probably be a suitable mode under another name.  Just find the name. ]

Second, locate or install MakeTeXPK.  The one I use is included for
reference.  MakeTeXPK is part of dvips, you may want to start with
that version instead.  You will have to change the paths and mode name
('bj') to match your system.

Next, test MakeTeXPK.  Example, should create /path/to/cmr10.360pk:

    /path/to/MakeTeXPK cmr10 360 360 1.0

Third, configure dvibj by editing the makefile.  It needs to know
the path to MakeTeXPK and the path to the pk's.

Build dvibj ('make') and test it with some trivial dvi file:

    dvibj trivial.dvi | lpr

You can now install it as an lpd filter and more or less forget about it.


=== /etc/printcap ==============================

I am no expert, and will offer no advice to people contemplating
complicated setups.  But I will tell you what I did.

I use printer names to encode useful flag combinations.  For example,
to print something two-up with ordinary margins, I would use

    lpr -Pdvi-2 file.dvi

My printcap defines a large number of these 'printers', like this:

    dvi:if=/usr/etc/dvif:tc=raw:
    dvi-e:if=/usr/etc/dvif-e:tc=raw:
    dvi-o:if=/usr/etc/dvif-o:tc=raw:
    dvi-2:if=/usr/etc/dvif-2:tc=raw:
    dvi-2e:if=/usr/etc/dvif-2e:tc=raw:
    dvi-2o:if=/usr/etc/dvif-2o:tc=raw:

'raw' is the real printer, which just passes the data straight through:

    raw:lp=/dev/lp1:sd=/usr/spool/lp1:sh:mx#0:

The filter scripts /usr/etc/dvifxxxxx are all something like

    #!/bin/sh
    exec /usr/etc/dvibj -silent -draft -two-up

You can bang out the filter scripts (and the printcap entries) by the
gross with a trivial program.  Just come up with a consistent, memorable
representation for the main options: sides/even/odd, draft/letter.

For occasional special cases, run it by hand with

      dvibj -flags file.dvi | lpr
or    dvibj -flags file.dvi > /dev/lp1
