| Line | |
|---|
| 1 | <?php
|
|---|
| 2 | // Example 2 : QR Barcode with specified version
|
|---|
| 3 |
|
|---|
| 4 | // Include the library
|
|---|
| 5 | require_once ('jpgraph/QR/qrencoder.inc.php');
|
|---|
| 6 |
|
|---|
| 7 | // Data to be encoded
|
|---|
| 8 | $data = '01234567';
|
|---|
| 9 | $version = 4; // Use QR version 4
|
|---|
| 10 |
|
|---|
| 11 | // Create a new instance of the encoder and let the library
|
|---|
| 12 | // decide a suitable error level
|
|---|
| 13 | $encoder = new QREncoder($version);
|
|---|
| 14 |
|
|---|
| 15 | // Use the image backend
|
|---|
| 16 | $backend = QRCodeBackendFactory::Create($encoder, BACKEND_IMAGE);
|
|---|
| 17 |
|
|---|
| 18 | // Set the module size (quite big)
|
|---|
| 19 | $backend->SetModuleWidth(5);
|
|---|
| 20 |
|
|---|
| 21 | // .. send the barcode back to the browser for the data
|
|---|
| 22 | $backend->Stroke($data);
|
|---|
| 23 | ?>
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.