]> git.wh0rd.org - tt-rss.git/blame - lib/phpqrcode/INSTALL
support disabling of e-mail digests entirely
[tt-rss.git] / lib / phpqrcode / INSTALL
CommitLineData
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
8If you want to recreate cache by yourself make sure cache directory is\r
9writable and you have permisions to write into it. Also make sure you are\r
10able to read files in it if you have cache option enabled\r
11 \r
12== CONFIGURATION ==\r
13\r
14Feel free to modify config constants in qrconfig.php file. Read about it in\r
15provided comments and project wiki page (links in README file)\r
16\r
17== QUICK START ==\r
18\r
19Notice: 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
24include "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
30QRcode::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
36QRcode::png('PHP QR Code :)');\r
37\r
38//show benchmark\r
39QRtools::timeBenchmark();\r
40\r
41//rebuild cache\r
42QRtools::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
47QRspec::debug($tab, true);\r
48\r
49== TCPDF INTEGRATION ==\r
50\r
51Inside bindings/tcpdf you will find slightly modified 2dbarcodes.php.\r
52Instal phpqrcode liblaty inside tcpdf folder, then overwrite (or merge)\r
532dbarcodes.php \r
54\r
55Then 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