INSTALL 2.0 KB

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