Table of Contents
i-fax.com Architecture
The i-fax.com Plug-In is split into two parts:
The Email Tag Generator
The Email Tag Generator takes a value to encode and generates a email tag 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 and email tags 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 emails a tagged document to the i-fax.com server, the email tag is interpreted by i-fax.com’s server. The i-fax.com server renames the document with the encoded identifier found in the email tag and sends the document to you by FTP file transfer or as an email.
ASP Version of the i-fax.com Plug-In
Installing the ASP Version of the i-fax.com Plug-In onto your Website
Find the class path for your ASP version and create a subdirectory of it called /com/Ifax/EmailTag/. For instance, in a normal Windows desktop environment the classpath is c:\windows\java\CLASSES, so you would create a directory called c:\windows\java\CLASSES\com\Ifax\EmailTag. Other platforms and installations will have classpaths in different locations, please see your system or application documentation for details.
The PDF i-fax.com Plug-In may work in conjunction with your web application but it is not a web application. We recommend that you keep the i-fax.com classes in a directory outside your web directory tree if possible. Make sure that the class files have the correct ownership and permissions to be accessible by your application.
Put the class files in the newly created directory. The following is a list of the class files in the i-fax.com ASP PDF Plug-in:
UDT.class
TextMergeUDT.class
ASPTextMergeUDT.class
- When you have signed up with i-fax.com you will be given an encryption key file. The tag contents are encrypted to ensure that the tag was generated by your account. Since this is an encryption key, it must be kept in a secure location.
- Example ASP files are included and should be placed in a testing area of your website.
ifaxtextmergeudtexample.asp
Description of the ASP Version of the i-fax.com Plug-In
The i-fax.com Plug-In encodes any identifying text that you wish to represent as a email tag and generates an Email Tag to insert in an Text document .
Prior to creating an Email Tag, your application must select a unique identifier and encode it for inclusion in the Email Tag. A unique identifier can be any number or text that your application will find meaningful; a transaction ID, a sequence number, an account number, or a form number.
When an end user returns a document encoded with an i-fax.com Email Tag, you will use this unique identifier to link the returned documents to the data on your website or in your database.
You do not need to encode large amounts of data in the i-fax.com Email Tag. You can use a record identifier that will link the tagged document or Text page to data that was captured while a user was on-line.
Warning:
This unique identifier value is leaving your site and your control.
It is important that you use the least amount of information necessary. For example, it is not recommended that you use a person’s account number when you can use a transaction identifier for a specific transaction.
|
The com.Ifax.EmailTag.TextMergeUDT class requires three parameters:
- the full path and filename of the public encryption key file provided by i-fax.com.
- The value you want to encode in the barcode.
- the full path and filename of the pdf file to add the tag to.
Syntax: public void getTextMerge (String textfile, OutputStream output, String publickey, String transid) throws IOException
Where publickeypath is the location of the i-fax.com plug-in encryption key and transactionid is the value to be encoded in the barcode.
The com.Ifax.EmailTag.TextMergeUDT class outputs the tagged text file to the OutputStream output .
Your Website
When an end user sends a tagged document to the i-fax.com server, the email tag is interpreted by i-fax.com's server. The i-fax.com server renames the document with the encoded identifier found in the email tag 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_origionalfilename.origionalfileext
|
aaaaaaaaaaaaaaaa |
The unique identifier found in the i-fax.com Email Tag (created by the i-fax.com email tag generator by your application).
|
bbbbbbbbbbbbbbbb |
A transaction key assigned by i-fax.com.
|
origionalfilename and origionalfileext |
The origional file names and extensions of whatever documents showed up as attachments to the email containing the Email Tag.
|
Unique Identifier |
The unique identifier is the value that your application assigned at the time the i-fax.com Email Tag was created using the i-fax.com email tag 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.
|
Origional File Name and Extension |
When a user sends an email containing an Email Tag (whether within the email body itself or in an attached document), the i-fax.com server renames and delivers all the files attached to the email.
|
Information Files
Two extra files are sent along with the origional email's file attachments:
-
The body of the email is returned in a file with a .txt extension and no origional file name (e.g. "123456789_0000123456ABCDEF.txt")
-
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 |
TransID |
The unique identifier encoded in the email tag on the document. This is the same unique id used in the returned file names. |
Pages |
The count of pages processed for the document. |
To |
The "To:" line of the email is put here |
From |
The "From:" line of the email is put here |
Subject |
The "Subject:" line of the email is put here |
Senddate |
The "Date:" line of the email header is put here |
A document encoded with a "unique identifier" of 639787744 would have the following in the .udt file:
TransID=63978744
To=redirect_to_ifax_account@example.com
From=example@example.com
Subject=Returned documents
Senddate=Sat, 01 Jan 2005 00:00:00 +0000 (UT)
Note:
You will find examples of the .udt file 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 Email Tag), 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 Email Tag}
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).
|