Rev | Line | |
---|
[42] | 1 | <?php
|
---|
| 2 | // Include the library
|
---|
| 3 | require_once ('jpgraph/QR/qrencoder.inc.php');
|
---|
| 4 |
|
---|
| 5 | // Example 11 : Generate postscript output
|
---|
| 6 |
|
---|
| 7 | $data = 'ABCDEFGH01234567'; // Data to be encoded
|
---|
| 8 | $version = -1; // -1 = Let the library decide version (same as default)
|
---|
| 9 | $corrlevel = QRCapacity::ErrH; // Error correction level H (Highest possible)
|
---|
| 10 | $modulewidth = 1;
|
---|
| 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_ASCII);
|
---|
| 18 |
|
---|
| 19 | // Set the module size
|
---|
| 20 | $backend->SetModuleWidth($modulewidth);
|
---|
| 21 |
|
---|
| 22 | // Store the barcode in the specifed file
|
---|
| 23 | $ps_str = $backend->Stroke($data);
|
---|
| 24 |
|
---|
| 25 | echo '<pre>'.$ps_str.'</pre>';
|
---|
| 26 | ?>
|
---|
Note:
See
TracBrowser
for help on using the repository browser.