+ @param Boolean $saveandprint (optional) if __true__ code is outputed to browser and saved to file, otherwise only saved to file. It is effective only if $outfile is specified.
+ */
+
public static function png($frame, $filename = false, $pixelPerPoint = 4, $outerFrame = 4,$saveandprint=FALSE)
+ public $version; ///< __Integer__ QR code version. Size of QRcode is defined as version. Version is from 1 to 40. Version 1 is 21*21 matrix. And 4 modules increases whenever 1 version increases. So version 40 is 177*177 matrix.
+ public $width; ///< __Integer__ Width of code table. Because code is square shaped - same as height.
+ public $data; ///< __Array__ Ready, masked code data.
+
+ /** Canvas JS include flag.
+ If canvas js support library was included, we remember it static in QRcode.
+ @param Boolean $saveandprint (optional) if __true__ code is outputed to browser and saved to file, otherwise only saved to file. It is effective only if $outfile is specified.
+ */
+
public static function png($text, $outfile = false, $level = QR_ECLEVEL_L, $size = 3, $margin = 4, $saveandprint=false)
+ @param Boolean $autoInclude (optional) if __true__, required qrcanvas.js lib will be included (only once)
+ @return String containing JavaScript creating the code, Canvas element (when $elemId is __false__) and script tag with required lib (when $autoInclude is __true__ and not yet included)
+ $html .= '<canvas id="'.$elemId.'" width="'.$width.'" height="'.$width.'">Your browser does not support CANVAS tag! Please upgrade to modern version of FireFox, Opera, Chrome or Safari/Webkit based browser</canvas>';
+ }
+
+ if ($width !== false) {
+ $extra .= ', '.$width.', '.$width;
+ }
+
+ if ($margin !== false) {
+ $extra .= ', '.$margin.', '.$margin;
+ }
+
+ $html .= '<script>if(eval("typeof "+\'QRdrawCode\'+"==\'function\'")){QRdrawCode(QRdecompactOps(\''.$area->getCanvasOps().'\')'."\n".', \''.$elemId.'\', '.$area->getWidth().' '.$extra.');}else{alert(\'Please include qrcanvas.js!\');}</script>';
+ Encoder is used by QRCode to create simple static code generators. */
class QRencode {
- public $casesensitive = true;
- public $eightbit = false;
+ public $casesensitive = true; ///< __Boolean__ does input stream id case sensitive, if not encoder may use more optimal charsets
+ public $eightbit = false; ///< __Boolean__ does input stream is 8 bit
- public $version = 0;
- public $size = 3;
- public $margin = 4;
+ public $version = 0; ///< __Integer__ code version (total size) if __0__ - will be auto-detected
+ public $size = 3; ///< __Integer__ pixel zoom factor, multiplier to map virtual code pixels to image output pixels
+ public $margin = 4; ///< __Integer__ margin (silent zone) size, in code pixels
- public $structured = 0; // not supported yet
+ public $structured = 0; ///< Structured QR codes. Not supported.
- public $level = QR_ECLEVEL_L;
- public $hint = QR_MODE_8;
+ public $level = QR_ECLEVEL_L; ///< __Integer__ error correction level __QR_ECLEVEL_L__, __QR_ECLEVEL_M__, __QR_ECLEVEL_Q__ or __QR_ECLEVEL_H__
+ public $hint = QR_MODE_8; ///< __Integer__ encoding hint, __QR_MODE_8__ or __QR_MODE_KANJI__, Because Kanji encoding is kind of 8 bit encoding we need to hint encoder to use Kanji mode explicite. (otherwise it may try to encode it as plain 8 bit stream)
- public function encodePNG($intext, $outfile = false,$saveandprint=false)
+ /** Encodes input into PNG image.
+ @param String $intext input text
+ @param String $outfile (optional) output file name, if __false__ outputs to browser with required headers
+ @param Boolean $saveandprint (optional) if __true__ code is outputed to browser and saved to file, otherwise only saved to file. It is effective only if $outfile is specified.
+ */
+ public function encodePNG($intext, $outfile = false, $saveandprint=false)