Download Latest Version faxView.zip (27.1 kB)
Email in envelope

Get an email when there's a new version of Fax Viewer in Python

Home / OldFiles
Name Modified Size InfoDownloads / Week
Parent folder
settings.py 2005-05-04 4.0 kB
readme.txt 2005-05-04 7.4 kB
PSDraw.py 2005-05-04 6.0 kB
layout14.py 2005-05-04 44.3 kB
image14.py 2005-05-04 38.8 kB
faxView.py 2005-05-04 548 Bytes
Totals: 6 Items   101.2 kB 0
The accompanying Program, a fax viewer originally written for pharmacies, is distributed under the General Public License.
The files it consists of are:

readme.txt (this file)
faxView.py
settings.py
layout14.py
image14.py

This program also depends on the installation of several other programs and libraries.
The version indicated is the version the code was tested with.
Later versions will probably also allow this Program to function.
Earlier versions will probably not.

python 2.4
PIL 1.1.5
libTiff 3.7.1

Finally, I am using a bugfix for PIL 1.1.5 that I have written.
It is included in the following files:

PSDraw.py

This needs to be compiled optimized, to generate the following two files:

PSDraw.pyc
PSDraw.pyo

All three of these files should replace their original versions in PIL's install directory.

This program comes with no guarantees whatsoever, and all restrictions and warnings inherent in the General Public License.
To sum up the GPL, you are free to modify this program in any way and use it yourself without distributing it.
The only major restriction is that, if you distribute this program, you must include the source and the license.
Of course, since this is a Python program, it would be hard not to distribute the source unless you ported the code.

So, enjoy your fax viewer, and if you have any questions, contact the copyright holder:
Eric Arthur Etheridge
etherson@yahoo.com
214-207-8031 mobile




This is a rather finicky application.  First, it requires the Python runtime environment, the Python Imaging Library, and LibTiff.  Second, it requires a patch to the current version of the Python Imaging Library (PIL), because a bug in that library's PSDraw module can cause images written to a postscript file to have a width of zero (thus not appearing at all).  Third, this program expects the fax server to behave in a certain way: it expects it to move its files into a dated subfolder every night.  More on that below.  Fourth, the directory in which the fax server puts the fax images needs to be world-writeable, since we have to delete the tif files from it in order to prevent multiple users from acquiring the same fax image.  Because of all of this, there is as much 'glue' as there is 'application', although there is a nice user interface.  Even so, it can be handy.

Multipage tiffs are handled.



These are the current installation instructions for the Pharmacy Fax Viewer Client as of April 10, 2005.  There are more setup issues for an administrator to handle.  Those are listed below.

1. Install Python24.  You can change the install directory to be anything you want.


2. Install PIL, the Python Imaging Library.  During the install it should find the directory where python was installed.  Have it install in that directory.


3. Copy the contents of the PIL_files directory over the files in python24\lib\site-packages\pil.  These three files contain a bugfix I created that fixes postscript printing issues.


4. Install LibTiff.  The installation will ask you if you want to download sources.  You don't need to.  This program calls itself GnuWin32.


5. Copy the pyPharm directory to your hard drive somewhere.  I suggest the Program Files directory.


6. Edit pyPharm\settings.py to alter the folders where it looks for things.  Four folders must be altered:

	infileDir, where the fax server puts faxes
	tempDir, a folder on the local machine for temporary storage
	saveDir, the final network folder for faxes
	convertExePath, the folder where 'tiffcp' is located
		'tiffcp' is part of GnuWin32, and is usually in GnuWin32\bin

	Don't forget to use double backslashes '\\' for the directory strings.


7. Set up a local printer port for the network printer:

A. Go to the printer control panel and right-click on the ip printer's icon.  Click the 'Sharing' menu option.  See if a share name is listed.  If no share name is listed, give it a name, like 'nethp' or something.

B. Go to a command prompt and type the following, where 'comp_name' is your own computer's network name and 'nethp' is the share name you found or created:

net use lpt4 \\comp_name\nethp /persistent:yes


8. Make a shortcut to pyPharm\faxView.py on your desktop, or whereever you prefer.








Setup for the administrator so that the Client will work:
The fax server needs to have a nightly cron job (or something similar) set up that moves faxes into a subfolder with a date for a name.  If that date format doesn't match what is already is settings.py, then that settings file needs to be updated with the new date format.  The target folder for the fax server needs to be world-writable, since the application removes the faxes from there.

This application also saves fax images in a date-named folder, but it uses python's iso format for dates and makes the folders itself, so that shouldn't be an issue.

This program currently assumes a Win32 interface to the folder where faxes are placed by the fax server and the folder where the faxes should finally be stored.  It was written to make use of the Samba interface to dedicated servers (Unix/Linux).  I'm not sure what would happen if linux folders were accessed in a more direct method, but something would probably go wrong.  Of course, if you need that, you could just try it and see what breaks.



GUI Usage:
Every so often (currently once a minute), the application re-reads the list of fax images in the server folder and displays this list in a listbox on the left.

If you click on one of these, the fax will be read from the server and stored in a temporary directory on the local machine.  The fax is not editable in this state.

If you 'acquire' the fax (a button or a keyboard shortcut), four things happen: the fax is saved in the appropriately named subdirectory in the storage location, the fax is deleted from the fax server directory, the subdirectory name and filename of the newly stored fax is copied to the clipboard, and the editting tools activate.

This is the part where you might switch over to a pharmacy tracking application and run a macro that pastes the filepath into a comment.

Now that the fax is 'acquired', it can be editted.  This means currenty that you can add text to it (with a large font), say for noting that a prescription has been filled.  Also, you can rotate the image, since faxes sometimes come in upside down.  There is also undo/redo functionality, although when you save, your changes are frozen.  The program currently auto-saves on termination without asking for confirmation, although this can be altered in settings.py.

Once the user is done with the fax, they can close it, which (currently) saves that fax automatically if there are any edits.

There is also another way to open faxes: there is a text box where you can type the subdirectory and filename of a stored fax.  There is a button and a keyboard shortcut that will take data from the clipboard, paste it into this text box, and do the lookup.  This can be used to retrieve a file whose filepath was stored as a comment in a different tracking program.



Error Reporting:
This program has try-catch blocks around most user-controlled actions, so if anything goes wrong, it will probably get appended to an error log in the same directory where faxView.py is.

Source: readme.txt, updated 2005-05-04