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

Last change on this file since 42 was 42, checked in by marrucho, 10 years ago
File size: 839 bytes
Line 
1<?php
2    // Example 10 : Specified error correction level
3
4    // Include the library
5    require_once ('jpgraph/QR/qrencoder.inc.php');
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
11    // Create a new instance of the encoder using the specified
12    // QR version and error correction
13    $encoder = new QREncoder($version,$corrlevel);
14
15    // Use the image backend
16    $backend = QRCodeBackendFactory::Create($encoder, BACKEND_IMAGE);
17
18    // Set the module size
19    $backend->SetModuleWidth(3);
20
21    // Set color
22    $backend->SetColor('brown','white');
23
24    // Store the barcode in the specifed file
25    $backend->Stroke($data);
26?>
Note: See TracBrowser for help on using the repository browser.