PHP eFax
|
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... | |
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.)
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.
[in] | $barcode | The 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:
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.)
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.
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.
[out] | $x_start_a | A reference to a variable to hold the horizontal start point A |
[out] | $y_start_a | A reference to a variable to hold the vertical start point A |
[out] | $x_start_b | A reference to a variable to hold the horizontal start point B |
[out] | $y_start_b | A reference to a variable to hold the vertical start point B |
[out] | $x_end_a | A reference to a variable to hold the horizontal end point A |
[out] | $y_end_a | A reference to a variable to hold the vertical end point A |
[out] | $x_end_b | A reference to a variable to hold the horizontal end point B |
[out] | $y_end_b | A 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.
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.