comFAX.doc
==========

In compliance with the GNU GPL and under respect to the clarification done within commprod.doc
this document describes the interaction between comfax and Ghostscript.


SOURCE CODE
===========

As stated within the printed documentation you can get the complete source code necessary to build
the comFAX Ghostscript interface at a nominal handling charge for physically performing source 
code distribution.

You may either chose to get

- The complete, unmodified Ghostscript source distribution
  This distribution allows to build Ghostscripts for many different OS including
  Windows and OS/2.

or

- the complete comFAX Ghostscript source distribution.
  This distribution contains only the source code necessary to build all Ghostscript files that
  have been aggregated with comFAX.
  Especially, 
  - it will only come with the drivers that have been compiled into the binary.
  - it does not contain the different types of Makefiles, but will use an Imakefile with support
    for all UNIX systems comFAX is delivered on.
  - it contains all changes done to the original Ghostscript source. All these changes have been
    annotated through remarks /* comFAX extension MM/DD/YY */
  - it contains an additional file gdevmisc.c that provide additional operators for
    specifying faxspecific things like transmission time, delays, resolution etc.
  - it contains an additional driver gdevcfax.c necessary to interface with the comFAX software.


Directory Structure, comFAX removal
===================================

$FAXROOT)/etc   I- ...
	        I   
	        I
        	I- postscript
        	I           I
        	I           I- ghostscript
		I	    I             I- fonts
		I	    I- ...
  		I
		I
        	I- ...
        	I- ...

The Ghostscript binaries aggegrated with comFAX reside in the directory(ies) ghostscript/...
If you would like to remove comFAX but retain Ghostscript you may savely remove all directories
with the only exception of the ghostscript directories as stated above. In that case you may
for sure move the ghostscript directories to any other convenient place on your file system.

All drivers compiled into Ghostscript - with the exception of the comFAX driver - will continue to
work properly.

There are two executables within the ghostscript directory:

the executable named 'gs' contains drivers as shown below:

    comfaxhigh comfaxlow cdeskjet cdjcolor cdjmono cdj500 cdj550
    deskjet djet500 djet500c epson eps9high epsonc ibmpro laserjet
    ljet2p ljet3 ljetplus paintjet pj pjxl pjxl300 pbm
    pbmraw pgm pgmraw ppm ppmraw bit

the executable named 'gs_x' contains drivers ss shown below:

    comfaxhigh comfaxlow x11 cdeskjet cdjcolor cdjmono cdj500 cdj550
    deskjet djet500 djet500c epson eps9high epsonc ibmpro laserjet
    ljet2p ljet3 ljetplus paintjet pj pjxl pjxl300 pbm
    pbmraw pgm pgmraw ppm ppmraw bit

!!! Please note !!!
In order to run 'gs_x' on a system using shared libraries, you have to provide access to the shared X
libraries.


Ghostscript substitution
========================
If you decide to substitute the comFAX supplied Ghostscript binaries with another Postscript package
you may freely do so provided that this package provides support for the fax extension compiled into
the Ghostscript binaries.

The easiest way should be to get the comFAX Ghostscript distribution to see about the implementation of
the different language extension contained within gdevmisc.c

The second thing is to provide a communication channel between the new Posscript product and comFAX
as it is done within gdevcfax.c. This communication is done through a pipe opened to the program
$FAXROOT/etc/postscript/faxpr2.

The data sent through this channel consists of

- data aquired through Postscript extensions in gdevmisc.c
- graphical bitmap data
- control information f.i. END_PAGE, END_DOC

Below we list all communication elements used by the comFAX driver for Ghostscript

Parameter:
A = alpha
# = numerisch
B = boolean (0/1)
D = Data (binary)
T = Time Value TT.MM.JJ HH.MM.SS

communication elements used:

ALPHAHOST=A
	Name of alphahost, where document shall be stored. If none is given the default alphahost is used instead

USERNAME=A
	Name of user, for which document is created. If none is given the default username is used instead

LOGFILE=A
	Filename, into which document ids are stored.

COMMENT=A
	Document comment. Put to document on completion.

TEMPORARY=B
	Indicates a temporary document.

TELEXMODE=B
	Telexmode ist set to true

CUTPAGE=B
	empty lines in document shall be cut starting at bottom of document 

INCOMING_ID=#
	names the comFAX id, by which incoming documents (e.h. telex) shall be stored in the gamma transport directory

INIT_PHONE=B
	Resets receiver table. Initialized once per document

PHONE=A
	Defines single receiver (either key or direct dial)

INIT_RECEIVERGROUP=B
	Resets receivergroup table. Initialized once per document

RECEIVERGROUP=A
	Defines single receivergroup (either key or direct dial)

SENDTIME=T
	Defines transmission time for document

DELAYED=B
	Defines timedelayed transmission (alternatively for SENDTIME)

PRIORITY=#
	Defines transmission priority for document

DIAL_RETRY=#
	Defines dial retries for document

ERROR_RETRY=#
	Defines error retries for dcoument

SEND_RESOLUTION=B
	Defines transmission resolution for document (0=normal, 1=fine)

ASCII_DATA=#
	Defines number of bytes for ASCII data. ASCII data will immediately follow up this entry.

RESOLUTION=B
	Defines document resolution (0=normal, 1=fine)

BINARY_DATA=# # #
	Defines graphical document data (number of bytes, width, height).
	Graphical data will immediately follow up this entry

BARCODE_AT=# #
	Insert barcode for USER at position x,y

SPECIAL_BARCODE=A
	Generate special barcode from alpha entry

SPECIAL_BARCODE_AT=# #
	Insert special barcode at position x,y

DELETE_AFTER_TRANSMISSION=B
	Delete document after transmission

SIGN_AT=# #
	Insert sign at position x,y

PAPER=#
	Merge paper (0..9) defined for user

PAPERID=#
	Merge paper from pooltray (defined by number). If not needed anymore paper should be set to 0.

END_PAGE=B
	Finish page. Document will be stored to disk.

END_DOC=B
	Finish document. All transmission jobs will be scheduled.

TERMINATE=B
	Terminate comFAX piping daemon.

NOTE=A
	Write note to comFAX logging daemon

WARNING=A
	Write warning to comFAX logging daemon

FATAL=A
	Write fatal error to comFAX logging daemon

TRACE=B
	Write protocol data to /tmp/faxpr2.log

INIT_ATTACH_DOC=B
	Reset attach doc list

ATTACH_DOC=#
	Attach document number from pool tray do current document. Document will be attached after page completion.

