xxggabriel / certificate
证书和文凭生成器。PHP 7+
v1.1.0
2019-08-18 14:05 UTC
Requires
- ext-gd: *
Requires (Dev)
- chillerlan/php-qrcode: dev-master
This package is auto-updated.
Last update: 2024-09-14 01:47:43 UTC
README
Certificate是一个使用PHP自动生成证书的库,并且还可以在证书上创建二维码。
服务器需求
- ext-gd
- etx-curl
Composer安装
composer require xxggabriel/certificate:1.1
生成证书
<?php
require_once "vendor/autoload.php";
header("Content-Type: image/jpeg");
use Certificate\App;
$cert = new App('img/background.jpg');
$cert->createImage([
['Certificado', 32, 330, 150,"#333", "/fonts/Bevan/Bevan-Regular.ttf", 0],
// ['Texto', tamanho da fonte, posição X, posição Y,
// Cor da font em hexadecimal, arquivo da font, Angulo do texto],
]);
$cert->QRCode('https://github.com/xxggabriel', 150, 650, 450);
// $cert->QRCode( Informação para o QR code(como link, codigo ou texto),
// Tamanho em pixel, Posição X, Posição Y);
$cert->run();
保存证书
$cert->run(__DIR__);
依赖关系
使用了Goqr的API来生成二维码。
许可证
Certificate库是一个开源软件,许可协议为MIT。
