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