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