Download the PHP package dsiddharth2/php-zxing without Composer
On this page you can find all versions of the php package dsiddharth2/php-zxing. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package php-zxing
PHPZxing - Wrapper for Zxing Java Library
PHPZxing is a small php wrapper that uses the Zxing library to Create and read Barcodes. Under the hood it still uses the Zxing library to encode and decode data.
Install using composer
Note
- Only Decoder is programmed right now. Needs programming of Encoder.
- The Default location of java that is configured is /usr/bin/java
Changes in version 1.0.3
- Functionality added for possible_formats to work
Changes in version 1.0.2
- Updated the new jars and tested on windows system
Changes in version 1.0.1
- Added a isFound function that will tell if the bar code is found.
- If the image has one bar code detected, then it returns the object instead of array of a single object.
Basic Usage
The Decoded data is an Array of Objects of PHPZxing\ZxingImage if the bar code is found. If not found then it is an array of Objects PHPZxing\ZxingBarNotFound.
Checking for existence of Barcode
The Existance of bar code can be found using the functoin isFound()
You can also check using the instanceof object,
The Public methods that we can use in PHPZxing\ZxingImage are,
Method Name | Function |
---|---|
getImageValue | Get the value decoded in the image passed |
getFormat | Get the format of the image that is encoded, example : CODE_39 |
getType | Get the type of the image decoded, example : URL, TEXT etc |
getImagePath | Get Path of the image |
The Public methods that we can use in PHPZxing\ZxingImage are,
Method Name | Function |
---|---|
getImageErrorCode | Get the error code for the image not found |
getErrorMessage | Error Message |
getImagePath | Get Path of the image |
Setting the configurations
You can also use it with configurations. The Decoder has 4 configurations,
Config Name | Function |
---|---|
try_harder | If the image has bar/Qr code at unknown locations, then use this non mobile mode. |
multiple_bar_codes | If the image has multiple bar codes you want to read. |
crop | Crop the image and it will read only the cropped portion |
possible_formats | List of formats to decode, where format is any value in BarcodeFormat |
More Examples
You can pass array of images too,
Reading multiple bar codes,
Set Java Path
If your java PATH is not set properly, the decoder will not work. You need to set path of java variable.
Where is my java located ?
If you do not know the path to java, then you can use the following on *nix enviromnents
On Windows environment,
For more info, on Windows read the follwoing stackoverflow Link
Acknowledgments
Contibution
Please Contribute or suggest changes.