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

Last change on this file since 42 was 42, checked in by marrucho, 10 years ago
File size: 792 bytes
Line 
1<?php
2// Include the library
3require_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  = 3;
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_PS);
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
25echo '<pre>'.$ps_str.'</pre>';
26?>
Note: See TracBrowser for help on using the repository browser.