INSTALLATION
------------
Unpack:
    $ wget -O foo2zjs.tar.gz http://foo2zjs.rkkda.com/foo2zjs.tar.gz
    $ tar zxf foo2zjs.tar.gz
    $ cd foo2zjs

(Optional) Uninstall:
    $ su		OR	$ sudo make uninstall
    # make uninstall

Compile:
    $ make

Get extra files from the web, such as .ICM profiles (for color correction)
and firmware.  Select the model number for your printer:
    $ ./getweb 2600n	# Get HP Color LaserJet 2600n .ICM files
    $ ./getweb 1600	# Get HP Color LaserJet 1600 .ICM files

    $ ./getweb 2530	# Get Konica Minolta magicolor 2530 DL .ICM files
    $ ./getweb 2490	# Get Konica Minolta magicolor 2490 MF .ICM files
    $ ./getweb 2480	# Get Konica Minolta magicolor 2480 MF .ICM files
    $ ./getweb 6115	# Get Xerox Phaser 6115MFP .ICM files

    $ ./getweb 2430	# Get Konica Minolta magicolor 2430 DL .ICM files
    $ ./getweb 2300	# Get Minolta/QMS magicolor 2300 DL .ICM files
    $ ./getweb 2200	# Get Minolta/QMS magicolor 2200 DL .ICM files
    $ ./getweb cpwl	# Get Minolta Color PageWorks/Pro L .ICM files

    $ ./getweb 300      # Get Samsung CLP-300 .ICM files
    $ ./getweb 600      # Get Samsung CLP-600 .ICM files
    $ ./getweb 2160     # Get Samsung CLX-2160 .ICM files
    $ ./getweb 3160     # Get Samsung CLX-3160 .ICM files
    $ ./getweb 6110     # Get Xerox Phaser 6110 and 6110MFP .ICM files

    $ ./getweb 500      # Get Lexmark C500 .ICM files

    $ ./getweb 1020	# Get HP LaserJet 1020 firmware file
    $ ./getweb 1018	# Get HP LaserJet 1018 firmware file
    $ ./getweb 1005	# Get HP LaserJet 1005 firmware file
    $ ./getweb 1000	# Get HP LaserJet 1000 firmware file

Install driver, foomatic XML files, PPD files, and extra files:
    $ su		OR	$ sudo make install
    # make install

(Optional) Install hotplug (for HP LJ 1000/1005/1018/1020):
    $ su		OR	$ sudo make install-hotplug
    # make install-hotplug

If you use CUPS to manage your printers, you must restart cupsd:
    # make cups		OR	$ sudo make cups

Test operation of programs. Skip this if you don't have the exact same
version of Ghostscript that I have, ghostscript 8.57, because it will
not pass since different versions of Ghostscript generate different
raster images:
    # make test

Create printers (Redhat 7.2/7.3/8.0/9.0, Fedora Core 1-5):
    # printconf-gui
	    Create at least one queue for monochrome, and another queue
	    for color printing.  Create the queues, then edit them and
	    set the "device options" as desired.

	    For a networked Minolta/QMS 2300 DL, I used a "Queue Type"
	    of "Unix Printer (LPD)", and set the "Server" to the IP address
	    of the printer, and the "Queue" to "lp".

	    For a networked HP Color Laserjet 2600n, I used a "Queue Type"
	    of "Networked JetDirect", and set the "Printer" to the IP address
	    of the printer, and the "Port" to "9100".

For Fedora Core 6 and Fedora 7 users:
    # system-config-printer

Create printers (Mandrake/Manrivia)
    # printerdrake

Create printers (Suse 10.0)
    # yast2 printer

Create printers (Ubuntu)
    $ sudo gnome-cups-manager
    $ sudo make cups		# Ubuntu has a bug in gnome-cups-manager

	NOTE: to edit a queue hit "Properties" (click right mouse button).

Create printers (Debian)
    Connect with a web browser to:
	http://localhost:631
    And configure printer (HP example shown) to:
	HP LaserJet 2600n, Foomatic + foo2zjs (en)
    Then edit "Manage Printers->Configure Printer" to suit you,
    such as "Page Size" or "Color Mode".

BUGS
----
    * Well Tempered Screening (WTS) works with ghostscript 8.54-8.60+.
      So if you want BEST COLORS, you'll have to install gs 8.54 or
      better if you don't have it.

	$ gs --version
	8.15.2
	
	$ wget "http://mirror.cs.wisc.edu/pub/mirrors/ghost/GPL/gs860/ghostscript-8.60.tar.gz"
	$ tar zxf ghostscript-8.60.tar.gz
	$ cd ghostscript-8.60
	$ ./autogen.sh
	$ make
	$ su				OR $ sudo cp bin/gs /usr/bin/gs.foo
	# cp bin/gs /usr/bin/gs.foo

UBUNTU NOTES
------------
    Install build-essential FIRST:
	$ sudo apt-get install build-essential
	$ wget -O foo2zjs.tar.gz http://foo2zjs.rkkda.com/foo2zjs.tar.gz
	$ tar zxf foo2zjs.tar.gz
	$ cd foo2zjs
	$ sudo make uninstall
	$ make
	$ ./getweb 1020
	    OR other printer
	$ sudo make install install-hotplug cups

	$ sudo gnome-cups-manager
	[configure ColorMode = Color if a color printer]
	$ sudo make cups

    Ubuntu has a bug in gnome-cups-manager with Color, so you must
    restart cups.  No other distro has this bug.

    If that doesn't work, then fire up:
	$ firefox http://localhost:631

    And click on:
	Printers -> Set Printer Options -> Color Mode -> Color
    Then click on:
	Set Printer Options

DEBIAN NOTES
------------
    Install build-essential, foomatic-filters, cupsys FIRST:
	$ su
	# apt-get install build-essential
	# apt-get install foomatic-filters
	# apt-get install cupsys

	$ wget -O foo2zjs.tar.gz http://foo2zjs.rkkda.com/foo2zjs.tar.gz
        $ tar zxf foo2zjs.tar.gz
        $ cd foo2zjs
        $ make
        $ ./getweb 1020
            OR other printer
        $ su
        # make install install-hotplug cups

MINOLTA-QMS 2200/2300 DL NOTES
------------------------------
    Use the network interface if you can.  These printers understand Unix
    LPD printer server protocol.  So when setting up the printer queue,
    you can select "UNIX Printer (lpd queue)", set the lpd queue name to
    "lp" (arbitrary), and set the "Server" to the IP address of the
    printer.

    These printers also understand several other printer server protocols,
    such as JetDirect and IPP, but I have not tried them.  In any case,
    I'm not aware of any advantages of using them over LPD.

    The USB interface on this printer will work if your printer is at
    firmware revision 2.55 or later.  Mine was not, but I was able to
    get this firmware from the Konica Minolta Europe web site.  The USA
    site doesn't have it.  Upgrading the firmware on your printer can
    be dangerous and might turn your printer into a paperweight, so I do
    not recommend it unless you need USB and are a computer expert.  To
    get the v2.55 firmware upgrade, try:
	./getweb 2300dl_fw

HP LASERJET 1000/1005/1018/1020 NOTES
-------------------------------------
    These printers need their firmware downloaded to them every time they
    are powered up.

	On Linux with USB connected printer:
	    If you are running Linux and the printer is connected via USB, you
	    can arrange for the firmware to be automatically downloaded to the
	    printer by performing one more installation step:

	    # make install-hotplug

	On another OS or with a parallel port connected printer:

	    You must send a firmware file to the printer each time you power it
	    up.  If you downloaded the extra files for the HP above, a typical
	    command line to load the firmware would be:

		cat /usr/share/foo2zjs/firmware/sihp1000.dl > /dev/usb/lp0
	    or:
		cat /usr/share/foo2zjs/firmware/sihp1005.dl > /dev/usb/lp0
	    or:
		cat /usr/share/foo2zjs/firmware/sihp1018.dl > /dev/usb/lp0
	    or:
		cat /usr/share/foo2zjs/firmware/sihp1020.dl > /dev/usb/lp0

	On Mac OS X:

	    You must send a firmware file to the printer each time you power it
	    up.  If you downloaded the extra files for the HP above, a typical
	    command line to load the firmware would be:

		lp -oraw /usr/share/foo2zjs/firmware/sihp1018.dl
		lp -oraw /usr/share/foo2zjs/firmware/sihp1020.dl

    NOTE: The original HP files are named '*.img'.  Sometimes HP supplies
    these files ready-to-download to the printer, sometimes they are raw
    ARM executables and need to have a special header added to them before
    they can be downloaded.  The "make install" step will use the supplied
    "arm2hpdl" program to automatically detect which kind of file they are
    and convert them (if needed) to the downloadable '*.dl' format.

    These printers do not have a "button" when you run out of paper. But you
    can simulate this by reloading the paper and doing:

	$ usb_printerid /dev/usb/lp0

MAC OS X NOTES
---------------
    Please read the detailed installation instructions by Clint Morgan
    and Rick Richardson in the file INSTALL.osx.

FREEBSD NOTES
-------------
    You need the following packages before you start the "make":
	# pkg_add -r wget
	# pkg_add -r gmake
	# pkg_add -r ghostscript-gnu
	# pkg_add -r cups
	# pkg_add -r foomatic-filters

    Use "gmake" instead of "make".

    USB NOTES FOR HP LJ 1018/1020
	- Build the kernel without the ulpt driver. 
	- cat /usr/share/foo2zjs/firmware/sihp1018.dl > /dev/ugen0.1
	    or
	- cat /usr/share/foo2zjs/firmware/sihp1020.dl > /dev/ugen0.1

	- sauron_the_evil_bastard in Linux, FreeBSD, Solaris:1 on Yahoo! chat.
	- Alexander Sashurin a.k.a. ZetRooT or WinterSilence 

OPENBSD NOTES
-------------
    You need the following packages before you start the "make":
	# pkg_add wget
	# pkg_add gmake
	# pkg_add -i ghostscript
	# pkg_add cups
	# pkg_add unzip

    Use "gmake" instead of "make".

64-bit GHOSTSCRIPT
------------------
Ghostscript before 8.55 has a problem with ICM files and 64-bit gcc.
It causes a segfault with km2430_2.icm. So don't select that one.

PSUTILS AND 2/4-UP CAPABILITY
-----------------------------
    If you would like to use the 2-up/4-up capability, then you need to
    get and install Angus Duggan's excellent psutils package.  You can
    find the source code for psutils here:

	http://knackered.knackered.org/angus/psutils/index.html

    Or an RPM here:

	http://rpmfind.net/linux/rpm2html/search.php?query=psutils

CUSTOM PAGE SIZE
----------------

    Append "PageSize=Custom.MMMxNNNin" to the lpr command.  E.G.

    $ lpr -P hp2600 -o PageSize=Custom.4x6in ~/testpage.ps
    $ lpr -P hp2600 -o PageSize=Custom.10x15cm ~/testpage.ps
    $ lpr -P hp1020 -o PageSize=Custom.4x6in ~/testpage.ps

    Or, use a GUI that allows the custom size parameters, e.g.
    "evince" - PostScript and PDF File Viewer.

UPDATE
------
    Here are handy lines you can click on to get the latest version:

	http://foo2zjs.rkkda.com/
	wget http://foo2zjs.rkkda.com/foo2zjs.tar.gz

    My advice: update early and often!!!!

UNINSTALLING
------------
    This will uninstall everything from your system.

    $ su
    # make uninstall

SET DEFAULT MEDIA WITH CUPS
---------------------------
    $ sudo
    # lpoptions -o media=A4
	-OR-
    # lpoptions -o media=Letter

BUG REPORTS
-----------
    PLEASE use the forums at:
	http://foo2zjs.rkkda.com/forum/index.php

    I do not read or reply to HTML email or messages sent under an alias.
    I failed out of french class, so don't even think about sending
    me email in anything but English.

    Rick Richardson

DEVELOPER AND DEBUGGING TIPS
----------------------------
    If you want to work on this program, I recommend creating a "raw"
    printer queue directed at the printer, with no protocol conversions.

    Then, you can use the "foo2zjs-wrapper" program to convert Postscript
    test programs to ZjS format, and inspect them with "zjsdecode" before
    deciding whether to print them or not.  For example:

	foo2zjs-wrapper testpage.ps > testpage.zm
	foo2zjs-wrapper -c testpage.ps > testpage.zc

	zjsdecode < testpage.zm
	zjsdecode < testpage.zc

	lpr -Praw testpage.zm

CUSTOM ICC/ICM COLOR PRINTER PROFILE
------------------------------------

    0)	Pick a vendor, e.g.
	    "Custom ICC ICM colour printer profile RGB or CMYK"
	    Seller: personalised101
	    http://stores.ebay.ie/The-Graphics-Depot 
	    Cost: 10 pounds

	    "We Create a Custom ICC Profile for Your Printer-"
	    Seller: fotojimbo
	    http://cgi.ebay.com/ws/eBayISAPI.dll?ViewItem&rd=1&item=200162943572&ssPageName=STRK:MEWN:IT&ih=010
	    Cost: 10 dollars


    1)	Convert the vendor sheet(s) from *.tif to *.ps (OPTIONAL)

	    $ gimp

		OR

	    Preferred, using ImageMagick's "convert"
	    $ convert Color\ Patch\ RGB\ \(Page\ 1\).tif page1.ps
	    $ convert Color\ Patch\ RGB\ \(Page\ 2\).tif page2.ps

    2)	Print the Postscript vendor sheet(s) with NO color correction:

	    $ foo2hp2600-wrapper -c -C10 -Gnone.icm \
		    test_sheets_from_icc_vendor.ps > test.prn

	    $ nc 192.168.1.xxxxxxx 9100 < test.prn
		OR
	    $ cp test.prn /dev/usb/lp0

    3)	Send them to the vendor by POSTAL MAIL

    4)	Get back *.icc/*.icm profile by EMAIL or WEB

    5)	Put it in /usr/share/foo2hp/icm/testing.icm

    6)	Print a test picture:

	    $ foo2hp2600-wrapper -c -C10 -Gtesting.icm \
		picture.ps > picture.prn

	    $ nc 192.168.1.xxxxxxx 9100 < picture.prn
		OR
	    $ cp picture.prn /dev/usb/lp0

    7)	If it is OK, send "testing.icm" to rick.richardson@comcast.net
	for inclusion in foo2zjs.

    Other printers: use foo2qpdl-wrapper and /usr/share/foo2qpdl/icm/
    Other printers: use foo2lava-wrapper and /usr/share/foo2lava/icm/
