承接 duna/qrcode 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

duna/qrcode

Composer 安装命令:

composer require duna/qrcode

包简介

QR code generator for Duna

README 文档

README

A versatile QR code generation library that supports HTML, PNG, and SVG output formats.

GitHub repo stars

Overview

The Duna QR Code Library is a QR code generation tool originally based on the QrCode library bundled with Duna until v8.0, developed by Laurent Minguet. It is distributed under the LGPL license, providing a flexible and open-source solution for QR code generation.

Installation

To install the library, use Composer:

$ composer require duna/qrcode

Usage

Here's a quick guide to using the Duna QR Code Library:

Generating QR Codes

First, include the necessary classes and create a QR code instance:

<?php

use Duna\Helpers\QrCode\QrCode;
use Duna\Helpers\QrCode\Output;

$qrCode = new QrCode('Lorem ipsum dolor sit amet');

Output Formats

PNG Output

To generate a PNG image of the QR code, specifying dimensions and colors, use:

// Create PNG output
$output = new Output\Png();

// Generate PNG data with a specified width, background color (white), and foreground color (black)
$data = $output->output($qrCode, 100, [255, 255, 255], [0, 0, 0]);

// Save the PNG data to a file
file_put_contents('file.png', $data);

SVG Output

For SVG output, which is useful for scalable vector graphics:

// Create SVG output
$output = new Output\Svg();

// Generate SVG data with a specified width, background color (white), and foreground color (black)
echo $output->output($qrCode, 100, 'white', 'black');

HTML Output

To display the QR code as an HTML table:

// Create HTML output
$output = new Output\Html();

// Generate HTML table representation of the QR code
echo $output->output($qrCode);

License

This library is provided under the GNU Lesser General Public License (LGPL) v3.0. See the LICENSE file for details.

Contributing

Contributions are welcome! Please refer to our CONTRIBUTING guidelines for more information.

Issues and Support

For issues and support, please refer to our issue tracker or reach out to the community.

统计信息

  • 总下载量: 45
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: HTML

其他信息

  • 授权协议: LGPL-2.1-or-later
  • 更新时间: 2024-09-18