source: trunk/xgraph/jpgraph/Examples/qrexample07.php@ 42

Last change on this file since 42 was 42, checked in by marrucho, 11 years ago
File size: 826 bytes
Line 
1<?php
2 // Example 7 : QR Barcode with multiple manually specified encodation schemas
3 // (Note: Normally there would be no need to ever use manually specified encodation)
4
5 // Include the library
6 require_once ('jpgraph/QR/qrencoder.inc.php');
7
8 // Data to be encoded
9 $data = array(
10 array(QREncoder::MODE_ALPHANUM,'01234567'),
11 array(QREncoder::MODE_NUMERIC,'89012345')
12 );
13
14 // Create a new instance of the encoder (automatically determined QR version and
15 // error correction level)
16 $encoder = new QREncoder();
17
18 // Use the image backend
19 $backend = QRCodeBackendFactory::Create($encoder, BACKEND_IMAGE);
20
21 // Set the module size
22 $backend->SetModuleWidth(4);
23
24 // Store the barcode in the specifed file
25 $backend->Stroke($data);
26?>
Note: See TracBrowser for help on using the repository browser.