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 610      # Get Samsung CLP-610 .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 3200     # Get Okidata C3200 .ICM files
    $ ./getweb 3300     # Get Okidata C3300 .ICM files
    $ ./getweb 3400     # Get Okidata C3400 .ICM files
    $ ./getweb 5100     # Get Okidata C5100 .ICM files
    $ ./getweb 5200     # Get Okidata C5200 .ICM files
    $ ./getweb 5500     # Get Okidata C5500 .ICM files
    $ ./getweb 5600     # Get Okidata C5600 .ICM files
    $ ./getweb 5800     # Get Okidata C5800 .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

    $ ./getweb P1505	# Get HP LaserJet P1505 firmware file
    $ ./getweb P1006	# Get HP LaserJet P1006 firmware file
    $ ./getweb P1005	# Get HP LaserJet P1005 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/P1005/P1006/P1505):
    $ su		OR	$ sudo make install-hotplug
    # make install-hotplug

    Unplug and re-plug the USB printer

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.60 (2007-08-01), 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/8 and Ubuntu 7.10 users:
    # system-config-printer

Create printers (Mandrake/Manrivia)
    # printerdrake

Create printers (Suse 10.x)
    # yast2 printer

Create printers (Ubuntu 5.10/6.06/6.10/7.04)
    $ 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".

Create printers (Solaris 11+)
    # printmgr

BUGS
----
    * Well Tempered Screening (WTS) works with ghostscript 8.54-8.62+.
      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/gs862/ghostscript-8.62.tar.gz"
	$ tar zxf ghostscript-8.62.tar.gz
	$ cd ghostscript-8.62
	$ ./autogen.sh
	$ make
	$ su				OR $ sudo cp bin/gs /usr/bin/gs.foo
	# cp bin/gs /usr/bin/gs.foo

	(Optional)
	# make install			OR $ sudo make install

	$ gs.foo --version
	8.62

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

	For 7.10 and later users:
	    $ sudo system-config-printer

	For 5.10/6.06/6.10/7.04 users:
	    $ 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

	$ firefox http://localhost:631

OpenSUSU 10.3 NOTES
-------------------
    Do this:

	# zypper sa \
	    http://download.opensuse.org/repositories/Printing/openSUSE_10.3/ \
	    Printing
    
    Then install using the above instructions.

ASUS EEE PC NOTES
-----------------

    It is a version of Xandros.  First:

	Get a shell by typing ctrl-alt-T
	$ sudo su -
	# vi or kwrite /etc/apt/sources.list
	    add the following line:
		deb ftp://ftp.us.debian.org/debian stable main contrib non-free
	# apt-get -f install
	# apt-get install wget
	# apt-get install build-essential
	<ctrl-d>

	$ 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, e.g. 2600n
        $ sudo make install install-hotplug cups

    Then use the "Add Printer" GUI.

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".

OPENSOLARIS, SOLARIS EXPRESS DEVELOPER EDITION 9/07, Solaris 11+ NOTES
----------------------------------------------------------------------
    Use "bash" for your shell.  Only network printers are supported.

    $ export PATH=$PATH:/sbin:/usr/sbin:/usr/sfw/bin:/opt/sfw/bin
    
    [ Load CD Solaris_Software_Companion]
    $ cd /media/S10_807_SOFTWARE_COMPANION/Solaris_Software_Companion/Solaris_i386/Packages
    $ su root -c "/usr/bin/bash"
    # pkgadd -d `pwd` SFWgroff
    # pkgadd -d `pwd` SFWgawk

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

    $ gmake
    $ ./getweb 2530
	OR other printer

    $ su root -c "/usr/bin/bash"
    # gmake install
    # printmgr

    To see a screen to the GUI:
	http://foo2lava.rkkda.com/solaris/

    NOTE: you cannot see the printer options (Paper Source, Paper Type,
    Paper Media, Color Mode, ICM, etc.).  There is NO GUI to do it!!!
    Sorry.

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, P1005/P1006/P1505 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

	    Unplug and re-plug the USB printer.

	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 ONE of these:

		cat /usr/share/foo2zjs/firmware/sihp1000.dl > /dev/usb/lp0
		cat /usr/share/foo2zjs/firmware/sihp1005.dl > /dev/usb/lp0
		cat /usr/share/foo2zjs/firmware/sihp1018.dl > /dev/usb/lp0
		cat /usr/share/foo2zjs/firmware/sihp1020.dl > /dev/usb/lp0
		cat /usr/share/foo2xqx/firmware/sihpP1005.dl > /dev/usb/lp0
		cat /usr/share/foo2xqx/firmware/sihpP1006.dl > /dev/usb/lp0
		cat /usr/share/foo2xqx/firmware/sihpP1505.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, there is a GNOME gui in:

	Applications -> System Tools -> HPLJ 10xx Replaced Paper

    or, you can simulate this by reloading the paper and doing:

	$ usb_printerid /dev/usb/lp0

    or, you can open the print cartridge door and then close it.

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:

	${URLZJS}/
	wget ${URLZJS}/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.
    OR, simple copy the file to /dev/usb/lp0 (USB) or nc (netcat) the
    file (network).

    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
	    OR
	cp testpage.zm /dev/usb/lp0
	    OR
	nc 192.168.1.NNN 9100 < testpage.zm

    Same thing for the other drivers, e.g. ...

	foo2hiperc-wrapper testpage.ps > testpage.hc
	hipercdecode < testpage.hc
	nc 192.168.1.NNN 9100 < testpage.hc

    If the printer is an HP LaserJet 10xx or P1xxx and needs to have the
    firmware downloaded, this will tell you (P1006):
	Before:
	    usb_printerid /dev/usb/lp0
	    MFG:Hewlett-Packard;MDL:HP LaserJet P1006;CMD:ACL;CLS:PRINTER;\
		DES:HP LaserJet P1006;

	After:
	    usb_printerid /dev/usb/lp0
	    MFG:Hewlett-Packard;MDL:HP LaserJet P1006;CMD:ACL;CLS:PRINTER;\
		DES:HP LaserJet P1006;FWVER:20070910;

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

    I need:
	Samsung CLP-600
	Samsung CLP-610
    at the default resolution!

    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/
