4 * PHP GD2 extension with JPEG and PNG support
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
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)
19 Notice: probably you should'nt use all of this in same script :)
23 //include only that one, rest required files will be included from it
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
30 QRcode::png('PHP QR Code :)', 'test.png', 'L', 4, 2);
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 :)');
39 QRtools::timeBenchmark();
42 QRtools::buildCache();
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);
49 == TCPDF INTEGRATION ==
51 Inside bindings/tcpdf you will find slightly modified 2dbarcodes.php.
52 Instal phpqrcode liblaty inside tcpdf folder, then overwrite (or merge)
55 Then use similar as example #50 from TCPDF examples:
62 'fgcolor' => array(0,0,0),
63 'bgcolor' => false, //array(255,255,255)
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');