Table of Contents
i-fax.com Architecture
The i-fax.com Plug-In is split into two parts:
The Barcode Generator
The Barcode Generator takes a value to encode and generates a barcode that can be inserted into a document generated by your application.
i-fax.com also provides plug-ins in various languages for many document types as well as utilities for merging barcodes with existing PDF documents and for creating sheets of barcoded laser address labels for barcoding existing paper documents. Please visit http://www.i-fax.com/plugin.html for a full list of our plug-ins.
Your Website
When an end user sends a barcoded document to the i-fax.com server (by fax or scanner), the barcode is interpreted by i-fax.com’s server. The i-fax.com server renames the document with the encoded identifier found in the barcode and sends the document to you by FTP file transfer or as an email.
Perl Version of the i-fax.com Plug-In
Installing the Perl Version of the i-fax.com Plug-In onto your Website
- Put the .pl files in a directory where your application can find them (e.g. a directory with execution permission).
These Perl scripts may work in conjunction with your web application but they are not a cgi application. We recommend that you keep the i-fax.com scripts in a directory outside your web directory tree if possible. Make sure that the files have the correct ownership and permissions to be accessible by your application.
The following is a list of the script files provided by i-fax.com:
ifaxgif64.pl
Also included in the package is a deprecated version of the barcode generator:
ifaxgif.pl
An example CGI script is also included. This script shows how to use the barcoder to create barcoded web pages:
ifaxgif64wrapper.cgi
Description of the Perl Version of the i-fax.com Plug-In
The i-fax.com Perl plug-in contains ifaxgif64.pl which creates i-fax.com barcodes as gif images, allowing you to quickly and simply add the i-fax.com barcode to your web documents. The i-fax.com plugin encodes numbers as big as 64 bits in length (not greater than 18,446,744,073,709,551,615) and is compatible with the HTML and PDF versions of the i-fax.com Plug-In.
Using the ifaxgif64 Script
i-fax.com provides you with one simple method of encoding a unique identifier in Perl, using the ifaxgif64 script.
To encode your identifier, call the ifaxgif64 script, passing it a unique identifier on the command line. The unique identifier must be a number between 0 and 18,446,744,073,709,551,615.
The ifaxgif64 script outputs a binary string containing a fully formed Gif image to be used within documents generated by your application. If you’re developing your application in Perl or a Perl-like language (such as PHP), you should use "backticks" which redirects STDOUT to a variable in your code. C code should use popen() to redirect STDOUT .
Syntax: ifaxgif64 transid
Note:
The Perl version of the i-fax.com barcode generator will accept values as large as 64 bit by using the bigint module. Normal integers in Perl are only 32 bit (decimal value not greater than 4,294,967,295), so be careful that, when creating your transaction IDs, you don't exceed this unless you use the bigint module, too. In the event that you input a number out of range, Perl will return a usage message, sends an error message to STDERR, and set a return code of 2.
|
Placing the Gif Barcode
The Gif image produced by the ifaxgif64 script should be inserted in your document carefully.
Placement of the Gif Barcode must follow these rules:
- The Gif Barcode must be at the top of the page, with a margin of empty space on three sides (approximately ¾ above, right and left).
- The Gif Barcode should appear above all logos and graphics on the page.
Warning:
Failure to place the Gif Barcode in the correct area of a document may cause the Barcode to be rejected by i-fax.com’s Server.
|
Your Website
When an end user sends a barcoded document to the i-fax.com server (by fax or scanner), the barcode is interpreted by i-fax.com's server. The i-fax.com server renames the document with the encoded identifier found in the barcode and sends the document to your website by FTP file transfer or as an email.
File Types
i-fax.com will deliver files to your server by FTP or Email. Every file sent from the i-fax.com server will follow this naming convention:
i-fax.com File Naming Convention
aaaaaaaaaaaaaaaa_bbbbbbbbbbbbbbbb_999.TTT
|
aaaaaaaaaaaaaaaa |
The unique identifier found in the i-fax.com Barcode (created by the i-fax.com barcode generator by your application).
|
bbbbbbbbbbbbbbbb |
A transaction key assigned by i-fax.com.
|
999 |
The page number (000 is reserved for the thumbnail) for JPEG files only.
|
TTT |
The file extension of different output formats, e.g. pdf, tif, jpg, udt.
|
Unique Identifier |
The unique identifier is the value that your application assigned at the time the i-fax.com Barcode was created using the i-fax.com barcode generator.
|
Transaction Key |
i-fax.com assigns a unique transaction key to every transaction that is processed by a server. This transaction key ensures that each file that your web server receives is unique and is not overwritten in the event that a user sends the same document twice.
|
Page Number |
The JPEG standard does not support multi-page documents. As a result, i-fax.com will deliver a separate JPEG file for each page in the document. These files will be numbered from 001 ... 999. Please note that number 000 is reserved for a JPEG thumbnail page that is explained below.
|
File Formats
The following file types are produced by the i-fax.com server:
-
The first page of the document is provided in a miniature version in JPEG format (240 x 345 pixels). The "thumbnail" allows your application to display a small version of the document (e.g. as a search result).
-
When you sign-up for the i-fax.com service you will be given the option of selecting one or more image formats for your documents. i-fax.com supports 3 image formats. The format you choose will depend on your application:
-
-
Adobe PDF
The i-fax.com server can produce a multi-page PDF file containing the document. The document is compressed in Group IV format to conserve storage space.
-
TIFF
The i-fax.com server can produce a multi-page Group IV TIFF file containing the document.
-
JPEG
The i-fax.com server will produce a series of JPEG file, each containing a page of the document.
-
If you have elected to receive files from i-fax.com using FTP (File Transfer Protocol), i-fax.com will send a file with a .udt extension to indicate that your document has been sent. This file will not appear on your server until the JPEG thumbnail and the document images in PDF, TIFF and/or JPEG have been delivered. Note: Your application should not start processing an FTP transfer until the .udt file is detected on your server.
The .udt file contains information about the files received by i-fax.com.
Field Name |
Description |
CallerID |
The caller id of the fax machine that the document was faxed from. If the document was not faxed or there was no caller id then the field is set to "Unknown". |
TransID |
The unique identifier encoded in the barcode on the document. This is the same unique id used in the returned file names. |
Pages |
The count of pages processed for the document. |
Orientation |
"0" if the document was scanned or faxed with the barcode right side up, or "1" if the barcode was upside down. When a document is faxed or scanned in upside down, the i-fax.com server rotates them before sending them on for ease of handling. |
To |
If the document was efiled instead of faxed, the "To:" line of the email is put here |
From |
If the document was efiled instead of faxed, the "From:" line of the email is put here |
Subject |
If the document was efiled instead of faxed, the "Subject:" line of the email is put here |
Senddate |
If the document was efiled instead of faxed, the "Date:" line of the email header is put here |
A two-page document encoded with a "unique identifier" of 639787744 that is faxed upside down would have the following in the .udt file:
CallerID=Unknown
TransID=63978744
Pages=2
Orientation=1
Note:
You will find examples of the Adobe PDF, TIFF, JPEG and .udt files with the files you receive when you Download the Plug-In.
File Transfer Options
i-fax.com can deliver files to your server in one of two formats:
-
FTP
i-fax.com will transfer a group of files to the FTP server you specify when you sign-up for the i-fax.com service. You will be asked to provide a directory on your site that is accessible to an FTP transfer.
It is recommended that you design your application to poll this directory looking for files with the .udt extension. i-fax.com always sends a .udt file when a transaction has been fully transferred.
A number of strategies can be used to initiate the polling process. The strategy you chose will depend on the tools available to you on the web server you are using for your website:
-
- On Unix or Linux servers, you can schedule a job in the crontab that will capture transactions in your FTP directory and incorporate them with your web database. (This will not be possible in most hosted web environments.)
-
On a Windows NT®/2000 server, you can schedule a task in the Task Scheduler that will capture transactions in your FTP directory and incorporate them with your web database. (This will not be possible in most hosted web environments.)
- You can imbed a CGI script in a web page that is executed when the page is accessed. The CGI script can be designed to detect the arrival of a .udt file in the FTP directory and process the incoming document. The CGI script can be placed within a page that runs when users wish to access a document or in a page that is run frequently.
-
Email
i-fax.com will email a group of files to the email address you specify when you sign-up for the i-fax.com service.
Each email sent by the i-fax.com server will contain all of the files pertaining to a specific document. In the event that an end user sends multiple documents in one fax or scan (each document having a unique i-fax.com Barcode), the i-fax.com server will transmit each document and its associated files in a separate email.
Emails sent by the i-fax.com server will contain the relevant files for a given document as attachments. Each email will contain the following entry in the "subject" line:
Document for transaction #{unique identifier from i-fax.com Barcode}
A number of strategies can be used to incorporate documents that have arrived by email. These include programs such as Procmail (for Unix and Linux environments) and Microsoft Exchange (for Windows NT®/2000).
|