barcode = $barcode; } /** * @return string */ public function getText() { return $this->barcode->getText(); } /** * Returns the QR code as array representation * * @return array */ public function toArray() { return $this->barcode->getBarcodeArray(); } /** * Returns the QR code as HTML representation * * @param int $width Width of a single rectangle element in pixels. * @param int $height Height of a single rectangle element in pixels. * @param string $color Foreground color for bar elements (background is transparent). * * @return string HTML code */ public function toHtml($width = 10, $height = 10, $color = 'black') { return $this->barcode->getBarcodeHtml($width, $height, $color); } /** * Returns the QR code as SVG document * * @param int $width Width of a single rectangle element in user units * @param int $height Height of a single rectangle element in user units * @param string $color Foreground color (in SVG format) for bar elements (background is transparent) * * @return string SVG document */ public function toSvg($width = 10, $height = 10, $color = 'black') { return $this->barcode->getBarcodeSvg($width, $height, $color); } /** * Returns the QR code as PNG image (requires GD or Imagick library) * * @param int $width Width of a single rectangle element in pixels * @param int $height Height of a single rectangle element in pixels * @param array $color RGB-Array (0-255) foreground color for bar elements (background is transparent) * * @return string Image as string */ public function toPng($width = 10, $height = 10, $color = [0, 0, 0]) { return $this->barcode->getBarcodePng($width, $height, $color); } }