Rev | Line | |
---|
[42] | 1 | <?php
|
---|
| 2 | // Example 4 : QR Barcode with specified version and error correction level
|
---|
| 3 |
|
---|
| 4 | // Include the library
|
---|
| 5 | require_once ('jpgraph/QR/qrencoder.inc.php');
|
---|
| 6 |
|
---|
| 7 | // Data to be encoded
|
---|
| 8 | $data = '01234567';
|
---|
| 9 | $version = 12; // Use QR version 4
|
---|
| 10 | $corrlevel = QRCapacity::ErrH ; // Level H error correction (the highest possible)
|
---|
| 11 |
|
---|
| 12 | // Create a new instance of the encoder using the specified
|
---|
| 13 | // QR version and error correction
|
---|
| 14 | $encoder = new QREncoder($version,$corrlevel);
|
---|
| 15 |
|
---|
| 16 | // Use the image backend
|
---|
| 17 | $backend = QRCodeBackendFactory::Create($encoder, BACKEND_IMAGE);
|
---|
| 18 |
|
---|
| 19 | // Set the module size
|
---|
| 20 | $backend->SetModuleWidth(3);
|
---|
| 21 |
|
---|
| 22 | // Store the barcode in the specifed file
|
---|
| 23 | $backend->Stroke($data);
|
---|
| 24 | ?>
|
---|
Note:
See
TracBrowser
for help on using the repository browser.