Made to Order Software Corporation Logo

PHP eFax: eFaxBarcode Class Reference

eFaxBarcode Class Reference

A barcode object. More...

Public Member Functions

 eFaxBarcode ($barcode)
 Build a barcode object. More...
 
 get_key ()
 Get the barcode key. More...
 
 get_page ()
 Get the page number. More...
 
 get_sequence ()
 Get the number of the barcode on the page. More...
 
 get_direction ()
 Get the direction of the barcode. More...
 
 get_symbology ()
 Get the symbology or protocol used. More...
 
 get_points (&$x_start_a, &$y_start_a, &$x_start_b, &$y_start_b, &$x_end_a, &$y_end_a, &$x_end_b, &$y_end_b)
 Get the location points. More...
 

Detailed Description

Whenever you receive a fax that includes one or more barcodes and you have the Barcode support from eFax, the eFax::parse_inbound_message() function reads them and saves them in a set of eFaxBarcode objects.

Note that barcode technology has many redundancies which makes them very robust even with relatively poor transmission and an area of 1 square inch can define 500 Mb of text (7 bits per byte.)

See also
eFax::parse_inbound_message()
eFax::get_result_barcodes()

Member Function Documentation

eFaxBarcode::eFaxBarcode (   $barcode)

This function parses the specified barcode control node.

The function reads the Key, AdditionalInfo, ReadSequence, ReadDirection, Symbology, Location, PageNumber, and the Start & End Points.

Parameters
[in]$barcodeThe XML node with the BarcodeControl tag.
eFaxBarcode::get_direction ( )

The barcode can be found going in any direction (left to right, bottom to top, etc.) This function returns that information.

The direction is defined as a string and can be any of the following:

  • "2-Dimensional"
  • "Left/Right"
  • "Top/Bottom"
  • "Right/Left"
  • "Bottom/Top"
Returns
A string with the direction or null.
eFaxBarcode::get_key ( )

This function is used to retrieve the barcode key. The key is the actual value of the barcode. In most cases, this is the only function you need to call (assuming you can have only one barcode per fax.)

Returns
The barcode key or null.
eFaxBarcode::get_page ( )

This number represents the page on which the barcode was found. It starts at 1 and grows incrementally.

Note that there can be several barcodes on a single page. To know which barcode it is, you may need to use the sequence number or the coordinates.

Returns
The page number on which the barcode was found or null.
See also
eFaxBarcode::get_sequence()
eFaxBarcode::get_points ( $x_start_a,
$y_start_a,
$x_start_b,
$y_start_b,
$x_end_a,
$y_end_a,
$x_end_b,
$y_end_b 
)

This function is used to get the start and end points of the two barcode areas detected and defining this barcode.

The coordinates may be defined in inches. However, the documentation does not say. You will need to test with a few faxes to make sure that they represent what you think they are.

Note
If the points were not defined for that barcode, then this function sets them to null. Any one coordinate can be set to null.
Parameters
[out]$x_start_aA reference to a variable to hold the horizontal start point A
[out]$y_start_aA reference to a variable to hold the vertical start point A
[out]$x_start_bA reference to a variable to hold the horizontal start point B
[out]$y_start_bA reference to a variable to hold the vertical start point B
[out]$x_end_aA reference to a variable to hold the horizontal end point A
[out]$y_end_aA reference to a variable to hold the vertical end point A
[out]$x_end_bA reference to a variable to hold the horizontal end point B
[out]$y_end_bA reference to a variable to hold the vertical end point B
eFaxBarcode::get_sequence ( )

Each barcode on a single page is given a different sequence number. This can be used to know which barcode is being worked on.

The sequence starts at 1 (TBD) and grows incrementally.

Returns
The sequence number of this barcode or null.
See also
eFaxBarcode::get_page()
eFaxBarcode::get_symbology ( )

This function returns the name of the symbology or protocol used to generate the barcode. The names are not defined in the eFax Developer documentation.

Returns
The symbology used for this barcode or null.

The documentation for this class was generated from the following file: