INSTALL (2042B)
1 == REQUIREMENTS == 2 3 * PHP5 4 * PHP GD2 extension with JPEG and PNG support 5 6 == INSTALLATION == 7 8 If you want to recreate cache by yourself make sure cache directory is 9 writable and you have permisions to write into it. Also make sure you are 10 able to read files in it if you have cache option enabled 11 12 == CONFIGURATION == 13 14 Feel free to modify config constants in qrconfig.php file. Read about it in 15 provided comments and project wiki page (links in README file) 16 17 == QUICK START == 18 19 Notice: probably you should'nt use all of this in same script :) 20 21 <?phpb 22 23 //include only that one, rest required files will be included from it 24 include "qrlib.php" 25 26 //write code into file, Error corection lecer is lowest, L (one form: L,M,Q,H) 27 //each code square will be 4x4 pixels (4x zoom) 28 //code will have 2 code squares white boundary around 29 30 QRcode::png('PHP QR Code :)', 'test.png', 'L', 4, 2); 31 32 //same as above but outputs file directly into browser (with appr. header etc.) 33 //all other settings are default 34 //WARNING! it should be FIRST and ONLY output generated by script, otherwise 35 //rest of output will land inside PNG binary, breaking it for sure 36 QRcode::png('PHP QR Code :)'); 37 38 //show benchmark 39 QRtools::timeBenchmark(); 40 41 //rebuild cache 42 QRtools::buildCache(); 43 44 //code generated in text mode - as a binary table 45 //then displayed out as HTML using Unicode block building chars :) 46 $tab = $qr->encode('PHP QR Code :)'); 47 QRspec::debug($tab, true); 48 49 == TCPDF INTEGRATION == 50 51 Inside bindings/tcpdf you will find slightly modified 2dbarcodes.php. 52 Instal phpqrcode liblaty inside tcpdf folder, then overwrite (or merge) 53 2dbarcodes.php 54 55 Then use similar as example #50 from TCPDF examples: 56 57 <?php 58 59 $style = array( 60 'border' => true, 61 'padding' => 4, 62 'fgcolor' => array(0,0,0), 63 'bgcolor' => false, //array(255,255,255) 64 ); 65 66 //code name: QR, specify error correction level after semicolon (L,M,Q,H) 67 $pdf->write2DBarcode('PHP QR Code :)', 'QR,L', '', '', 30, 30, $style, 'N');