Navigation Menu

Skip to content

Commit

Permalink
Cleaned readme
Browse files Browse the repository at this point in the history
  • Loading branch information
dsiddhath2 committed Sep 11, 2017
1 parent 0c2dd09 commit b43e01f
Show file tree
Hide file tree
Showing 3 changed files with 65 additions and 3 deletions.
File renamed without changes.
62 changes: 62 additions & 0 deletions README.md
@@ -0,0 +1,62 @@
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](https://github.com/zxing/zxing) to encode and decode data.

Note
--------------------
* Only Decoder is programmed right now. Needs programming of Encoder.

Basic Configuration
--------------------

Html Code:

```json
{
"require": {
"sid/php-zxing": "dev-master"
}
}
```

How to Use
----------
```php

use PHPZxing\PHPZxingDecoder;

$decoder = new PHPZxingDecoder();
$decodedData = $decoder->decode('../images/Code128Barcode.jpg');
print_r($decodedData);

$config = array(
'try_harder' => true, // Non mobile mode
'multiple_bar_codes' => true, // If the image contains muliple bar codes
'crop' => '100,200,300,300', // If you want to crop image in pixels
);
$decoder = new PHPZxingDecoder($config);
$decodedData = $decoder->decode('../images/'); // Reads images in complete directory
print_r($decodedData);

$decoder = new PHPZxingDecoder();
// Images can be sent as an array
$imageArrays = array(
'../images/Code128Barcode.jpg',
'../images/Code39Barcode.jpg'
);
$decodedData = $decoder->decode($imageArrays);
print_r($decodedData);

$config = array(
'try_harder' => true,
'multiple_bar_codes' => true
);
$decoder = new PHPZxingDecoder($config);
$decodedData = $decoder->decode('../images/multiple_bar_codes.jpg');
print_r($decodedData);
```

Contibution
--------------------
Please Contribute or suggest changes.
6 changes: 3 additions & 3 deletions composer.json
@@ -1,8 +1,8 @@
{
"name": "sid/php-zxing",
"name": "dsiddharth2/php-zxing",
"description": "Wrapper for zxing using php",
"type": "library",
"license": "MIT",
"license": "MIT",
"authors": [
{
"name": "Siddharth",
Expand All @@ -11,7 +11,7 @@
],
"autoload": {
"psr-0" : {
"sid/php-zxing" : "src"
"dsiddharth2/php-zxing" : "src"
}
}
}

0 comments on commit b43e01f

Please sign in to comment.