QR Platba
parent
9a03931e24
commit
4471344edc
|
|
@ -24,13 +24,15 @@ final class FakturaPdf
|
||||||
*/
|
*/
|
||||||
public function render(object $faktura, array $polozky, bool $autoPrint = false): string
|
public function render(object $faktura, array $polozky, bool $autoPrint = false): string
|
||||||
{
|
{
|
||||||
$view = $this->view($faktura, $polozky);
|
[$view, $imageVars] = $this->view($faktura, $polozky);
|
||||||
|
|
||||||
return $this->pdfSestava->render(
|
return $this->pdfSestava->render(
|
||||||
$this->templateFile(),
|
$this->templateFile(),
|
||||||
$view,
|
$view,
|
||||||
'Faktura ' . (string) ($faktura->CISLO ?? ''),
|
'Faktura ' . (string) ($faktura->CISLO ?? ''),
|
||||||
$autoPrint,
|
$autoPrint,
|
||||||
|
'P',
|
||||||
|
$imageVars,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -44,7 +46,7 @@ final class FakturaPdf
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array<int, object> $polozky
|
* @param array<int, object> $polozky
|
||||||
* @return array<string, mixed>
|
* @return array{0: array<string, mixed>, 1: array<string, string>}
|
||||||
*/
|
*/
|
||||||
private function view(object $faktura, array $polozky): array
|
private function view(object $faktura, array $polozky): array
|
||||||
{
|
{
|
||||||
|
|
@ -64,9 +66,29 @@ final class FakturaPdf
|
||||||
}
|
}
|
||||||
|
|
||||||
$cinnosti = trim((string) ($faktura->CINNOSTI ?? ''));
|
$cinnosti = trim((string) ($faktura->CINNOSTI ?? ''));
|
||||||
|
$cislo = (string) ($faktura->CISLO ?? '');
|
||||||
|
$ucet = trim((string) ($faktura->D_BANKA ?? ''));
|
||||||
|
$splatnost = self::asDate($faktura->DATUM_SPLATNOSTI ?? null);
|
||||||
|
|
||||||
|
$imageVars = [];
|
||||||
|
$qrPlatba = false;
|
||||||
|
if ($ucet !== '') {
|
||||||
|
$png = SpaydQr::png(
|
||||||
|
$ucet,
|
||||||
|
$celkem,
|
||||||
|
$cislo,
|
||||||
|
$splatnost,
|
||||||
|
'Faktura ' . $cislo,
|
||||||
|
);
|
||||||
|
if ($png !== null) {
|
||||||
|
$imageVars['qrplatba'] = $png;
|
||||||
|
$qrPlatba = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'cislo' => (string) ($faktura->CISLO ?? ''),
|
[
|
||||||
|
'cislo' => $cislo,
|
||||||
'dodavatel' => [
|
'dodavatel' => [
|
||||||
'nazev' => (string) ($faktura->D_PRAJM ?? ''),
|
'nazev' => (string) ($faktura->D_PRAJM ?? ''),
|
||||||
'ulice' => (string) ($faktura->D_ULICE ?? ''),
|
'ulice' => (string) ($faktura->D_ULICE ?? ''),
|
||||||
|
|
@ -76,7 +98,7 @@ final class FakturaPdf
|
||||||
'email' => (string) ($faktura->D_EMAIL ?? ''),
|
'email' => (string) ($faktura->D_EMAIL ?? ''),
|
||||||
'web' => (string) ($faktura->D_WEB ?? ''),
|
'web' => (string) ($faktura->D_WEB ?? ''),
|
||||||
'ic' => (string) ($faktura->D_IC ?? ''),
|
'ic' => (string) ($faktura->D_IC ?? ''),
|
||||||
'ucet' => (string) ($faktura->D_BANKA ?? ''),
|
'ucet' => $ucet,
|
||||||
],
|
],
|
||||||
'odberatel' => [
|
'odberatel' => [
|
||||||
'nazev' => (string) ($faktura->O_PRAJM ?? ''),
|
'nazev' => (string) ($faktura->O_PRAJM ?? ''),
|
||||||
|
|
@ -92,9 +114,25 @@ final class FakturaPdf
|
||||||
'polozky' => $radky,
|
'polozky' => $radky,
|
||||||
'celkem' => 'Celkem: ' . self::formatMoney($celkem),
|
'celkem' => 'Celkem: ' . self::formatMoney($celkem),
|
||||||
'cinnosti' => $cinnosti === '' ? [] : (preg_split("/\R/u", $cinnosti) ?: []),
|
'cinnosti' => $cinnosti === '' ? [] : (preg_split("/\R/u", $cinnosti) ?: []),
|
||||||
|
'qrPlatba' => $qrPlatba,
|
||||||
|
],
|
||||||
|
$imageVars,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static function asDate(mixed $value): ?\DateTimeInterface
|
||||||
|
{
|
||||||
|
if ($value instanceof \DateTimeInterface) {
|
||||||
|
return $value;
|
||||||
|
}
|
||||||
|
if (!is_string($value) || trim($value) === '') {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
$timestamp = strtotime($value);
|
||||||
|
|
||||||
|
return $timestamp ? (new \DateTimeImmutable())->setTimestamp($timestamp) : null;
|
||||||
|
}
|
||||||
|
|
||||||
private function templateFile(): string
|
private function templateFile(): string
|
||||||
{
|
{
|
||||||
return __DIR__ . DIRECTORY_SEPARATOR . 'faktura.latte';
|
return __DIR__ . DIRECTORY_SEPARATOR . 'faktura.latte';
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ final class PdfSestava
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array<string, mixed> $params
|
* @param array<string, mixed> $params
|
||||||
|
* @param array<string, string> $imageVars binární data obrázků pro src="var:nazev"
|
||||||
*/
|
*/
|
||||||
public function render(
|
public function render(
|
||||||
string $templateFile,
|
string $templateFile,
|
||||||
|
|
@ -31,10 +32,14 @@ final class PdfSestava
|
||||||
string $title,
|
string $title,
|
||||||
bool $autoPrint = false,
|
bool $autoPrint = false,
|
||||||
string $orientation = 'P',
|
string $orientation = 'P',
|
||||||
|
array $imageVars = [],
|
||||||
): string {
|
): string {
|
||||||
$html = $this->latteFactory->create()->renderToString($templateFile, $params);
|
$html = $this->latteFactory->create()->renderToString($templateFile, $params);
|
||||||
|
|
||||||
$mpdf = $this->create($orientation === 'L');
|
$mpdf = $this->create($orientation === 'L');
|
||||||
|
foreach ($imageVars as $name => $binary) {
|
||||||
|
$mpdf->imageVars[$name] = $binary;
|
||||||
|
}
|
||||||
$mpdf->SetHTMLFooter($this->footer());
|
$mpdf->SetHTMLFooter($this->footer());
|
||||||
$mpdf->SetTitle($title);
|
$mpdf->SetTitle($title);
|
||||||
$mpdf->SetAuthor('Kufřík');
|
$mpdf->SetAuthor('Kufřík');
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,175 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace App\Model\Faktura;
|
||||||
|
|
||||||
|
use Mpdf\QrCode\Output\Png;
|
||||||
|
use Mpdf\QrCode\QrCode;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Český QR platební kód (SPD / SPAYD).
|
||||||
|
*/
|
||||||
|
final class SpaydQr
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Binární PNG QR kódu pro mPDF imageVars, nebo null pokud nelze sestavit.
|
||||||
|
*/
|
||||||
|
public static function png(
|
||||||
|
string $ucetNeboIban,
|
||||||
|
float $castka,
|
||||||
|
string $vs = '',
|
||||||
|
?\DateTimeInterface $splatnost = null,
|
||||||
|
string $zprava = '',
|
||||||
|
int $size = 240,
|
||||||
|
): ?string {
|
||||||
|
$spd = self::spd($ucetNeboIban, $castka, $vs, $splatnost, $zprava);
|
||||||
|
if ($spd === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (new Png())->output(new QrCode($spd), $size, [255, 255, 255], [0, 0, 0]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function spd(
|
||||||
|
string $ucetNeboIban,
|
||||||
|
float $castka,
|
||||||
|
string $vs = '',
|
||||||
|
?\DateTimeInterface $splatnost = null,
|
||||||
|
string $zprava = '',
|
||||||
|
): ?string {
|
||||||
|
$iban = self::toIban($ucetNeboIban);
|
||||||
|
if ($iban === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
$parts = [
|
||||||
|
'SPD',
|
||||||
|
'1.0',
|
||||||
|
'ACC:' . $iban,
|
||||||
|
];
|
||||||
|
|
||||||
|
if ($castka > 0) {
|
||||||
|
$parts[] = 'AM:' . number_format($castka, 2, '.', '');
|
||||||
|
}
|
||||||
|
$parts[] = 'CC:CZK';
|
||||||
|
|
||||||
|
if ($splatnost !== null) {
|
||||||
|
$parts[] = 'DT:' . $splatnost->format('Ymd');
|
||||||
|
}
|
||||||
|
|
||||||
|
$msg = self::spdText($zprava, 60);
|
||||||
|
if ($msg !== '') {
|
||||||
|
$parts[] = 'MSG:' . $msg;
|
||||||
|
}
|
||||||
|
|
||||||
|
$vsDigits = self::variableSymbol($vs);
|
||||||
|
if ($vsDigits !== '') {
|
||||||
|
$parts[] = 'X-VS:' . $vsDigits;
|
||||||
|
}
|
||||||
|
|
||||||
|
return implode('*', $parts) . '*';
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* IBAN z IBAN řetězce nebo českého formátu „účet/kód banky“.
|
||||||
|
*/
|
||||||
|
public static function toIban(string $value): ?string
|
||||||
|
{
|
||||||
|
$value = strtoupper(preg_replace('/\s+/', '', trim($value)) ?? '');
|
||||||
|
if ($value === '') {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (preg_match('/^CZ\d{22}$/', $value)) {
|
||||||
|
return self::isValidIban($value) ? $value : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!preg_match('/^(?:(\d{1,6})-)?(\d{2,10})\/(\d{4})$/', $value, $m)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
$prefix = str_pad($m[1] !== '' ? $m[1] : '0', 6, '0', STR_PAD_LEFT);
|
||||||
|
$number = str_pad($m[2], 10, '0', STR_PAD_LEFT);
|
||||||
|
$bank = $m[3];
|
||||||
|
$bban = $bank . $prefix . $number;
|
||||||
|
|
||||||
|
// CZ = 12 35 → kontrolní číslo z BBAN + "123500"
|
||||||
|
$checkBase = $bban . '123500';
|
||||||
|
$mod = self::mod97($checkBase);
|
||||||
|
if ($mod === null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
$check = 98 - $mod;
|
||||||
|
|
||||||
|
return 'CZ' . sprintf('%02d', $check) . $bban;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function variableSymbol(string $value): string
|
||||||
|
{
|
||||||
|
$digits = preg_replace('/\D+/', '', $value) ?? '';
|
||||||
|
if ($digits === '') {
|
||||||
|
return '';
|
||||||
|
}
|
||||||
|
if (strlen($digits) > 10) {
|
||||||
|
$digits = substr($digits, -10);
|
||||||
|
}
|
||||||
|
|
||||||
|
return ltrim($digits, '0') !== '' ? $digits : '';
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function spdText(string $value, int $maxLen): string
|
||||||
|
{
|
||||||
|
$value = self::bezDiakritiky(trim($value));
|
||||||
|
$value = preg_replace('/[^A-Za-z0-9 \/?:().,+\-]/', '', $value) ?? '';
|
||||||
|
$value = trim(preg_replace('/\s+/', ' ', $value) ?? '');
|
||||||
|
|
||||||
|
return mb_substr($value, 0, $maxLen);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function bezDiakritiky(string $value): string
|
||||||
|
{
|
||||||
|
$ascii = @iconv('UTF-8', 'ASCII//TRANSLIT//IGNORE', $value);
|
||||||
|
if ($ascii === false) {
|
||||||
|
return $value;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $ascii;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function isValidIban(string $iban): bool
|
||||||
|
{
|
||||||
|
$rearranged = substr($iban, 4) . substr($iban, 0, 4);
|
||||||
|
$numeric = '';
|
||||||
|
$length = strlen($rearranged);
|
||||||
|
for ($i = 0; $i < $length; $i++) {
|
||||||
|
$ch = $rearranged[$i];
|
||||||
|
if ($ch >= 'A' && $ch <= 'Z') {
|
||||||
|
$numeric .= (string) (ord($ch) - 55);
|
||||||
|
} elseif ($ch >= '0' && $ch <= '9') {
|
||||||
|
$numeric .= $ch;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$mod = self::mod97($numeric);
|
||||||
|
|
||||||
|
return $mod === 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static function mod97(string $number): ?int
|
||||||
|
{
|
||||||
|
if ($number === '' || !ctype_digit($number)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
$remainder = 0;
|
||||||
|
$length = strlen($number);
|
||||||
|
for ($i = 0; $i < $length; $i++) {
|
||||||
|
$remainder = ($remainder * 10 + (int) $number[$i]) % 97;
|
||||||
|
}
|
||||||
|
|
||||||
|
return $remainder;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -28,6 +28,12 @@
|
||||||
.cinnosti { margin-top: 5mm; }
|
.cinnosti { margin-top: 5mm; }
|
||||||
.cinnosti .label { font-weight: bold; margin: 0 0 1mm 0; }
|
.cinnosti .label { font-weight: bold; margin: 0 0 1mm 0; }
|
||||||
.cinnosti .text { margin: 0; }
|
.cinnosti .text { margin: 0; }
|
||||||
|
.qr-platba { margin-top: 8mm; }
|
||||||
|
.qr-platba td { vertical-align: middle; }
|
||||||
|
.qr-platba .code { width: 30mm; }
|
||||||
|
.qr-platba .code img { width: 28mm; height: 28mm; }
|
||||||
|
.qr-platba .hint { padding-left: 4mm; font-size: 8.5pt; color: #333; line-height: 1.35; }
|
||||||
|
.qr-platba .hint strong { font-size: 9pt; }
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
@ -117,5 +123,16 @@
|
||||||
<p class="text">{foreach $cinnosti as $radek}{$radek}{sep}<br>{/sep}{/foreach}</p>
|
<p class="text">{foreach $cinnosti as $radek}{$radek}{sep}<br>{/sep}{/foreach}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<table n:if="$qrPlatba" class="qr-platba">
|
||||||
|
<tr>
|
||||||
|
<td class="code"><img src="var:qrplatba" width="112" height="112" alt="QR platba"></td>
|
||||||
|
<td class="hint">
|
||||||
|
<strong>QR platba</strong><br>
|
||||||
|
Naskenujte kód v mobilním bankovnictví.<br>
|
||||||
|
Částka, účet i VS se vyplní automaticky.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,8 @@
|
||||||
"nette/utils": "^4.0",
|
"nette/utils": "^4.0",
|
||||||
"latte/latte": "^3.0",
|
"latte/latte": "^3.0",
|
||||||
"tracy/tracy": "^2.10",
|
"tracy/tracy": "^2.10",
|
||||||
"mpdf/mpdf": "^8.3"
|
"mpdf/mpdf": "^8.3",
|
||||||
|
"mpdf/qrcode": "^1.2"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"nette/tester": "^2.5",
|
"nette/tester": "^2.5",
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@
|
||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "04d8602ccd11da64fa89499e47cd7d43",
|
"content-hash": "24c4bb884549c460e62ab6e49dfbfc27",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "latte/latte",
|
"name": "latte/latte",
|
||||||
|
|
@ -266,6 +266,74 @@
|
||||||
},
|
},
|
||||||
"time": "2023-05-03T06:19:36+00:00"
|
"time": "2023-05-03T06:19:36+00:00"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "mpdf/qrcode",
|
||||||
|
"version": "v1.2.2",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/mpdf/qrcode.git",
|
||||||
|
"reference": "d4fa19117a7241c30ac84902b6236a02c7a3f268"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/mpdf/qrcode/zipball/d4fa19117a7241c30ac84902b6236a02c7a3f268",
|
||||||
|
"reference": "d4fa19117a7241c30ac84902b6236a02c7a3f268",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"paragonie/random_compat": "^1.4|^2.0|^9.99.99",
|
||||||
|
"php": "^5.6 || ^7.0 || ^8.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"mockery/mockery": "^0.9.5 || ^1.0",
|
||||||
|
"squizlabs/php_codesniffer": "^3.4",
|
||||||
|
"tracy/tracy": "^2.5",
|
||||||
|
"yoast/phpunit-polyfills": "^1.0"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"ext-gd": "To output QR codes to PNG files",
|
||||||
|
"ext-simplexml": "To output QR codes to SVG files"
|
||||||
|
},
|
||||||
|
"type": "library",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Mpdf\\QrCode\\": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"LGPL-2.1-or-later"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Matěj Humpál",
|
||||||
|
"role": "maintainer"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Laurent Minguet",
|
||||||
|
"role": "author"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "QR code generator for mPDF",
|
||||||
|
"keywords": [
|
||||||
|
"mpdf",
|
||||||
|
"pdf",
|
||||||
|
"php",
|
||||||
|
"qr",
|
||||||
|
"qrcode"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/mpdf/qrcode/issues",
|
||||||
|
"source": "https://github.com/mpdf/qrcode/tree/v1.2.2"
|
||||||
|
},
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://www.paypal.me/mpdf",
|
||||||
|
"type": "custom"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"time": "2025-12-19T16:21:49+00:00"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "myclabs/deep-copy",
|
"name": "myclabs/deep-copy",
|
||||||
"version": "1.14.0",
|
"version": "1.14.0",
|
||||||
|
|
|
||||||
|
|
@ -27,10 +27,11 @@ set('writable_dirs', [
|
||||||
'temp',
|
'temp',
|
||||||
'data/sdf',
|
'data/sdf',
|
||||||
]);
|
]);
|
||||||
// sticky = www-data group + g+rwxs (plain chmod 0755 nestačí pro Apache)
|
// ACL: nové soubory od www-data zůstane deploy smět mazat (bez sudo hesla)
|
||||||
set('writable_mode', 'sticky');
|
set('writable_mode', 'acl');
|
||||||
set('http_user', 'www-data');
|
set('http_user', 'www-data');
|
||||||
set('http_group', 'www-data');
|
set('http_group', 'www-data');
|
||||||
|
set('cleanup_use_sudo', false);
|
||||||
|
|
||||||
set('composer_options', '--verbose --prefer-dist --no-progress --no-interaction --no-dev --optimize-autoloader');
|
set('composer_options', '--verbose --prefer-dist --no-progress --no-interaction --no-dev --optimize-autoloader');
|
||||||
|
|
||||||
|
|
@ -44,7 +45,8 @@ host('production')
|
||||||
|
|
||||||
desc('Vyčistí Nette temp cache v aktuální release');
|
desc('Vyčistí Nette temp cache v aktuální release');
|
||||||
task('deploy:clear_cache', function () {
|
task('deploy:clear_cache', function () {
|
||||||
run('rm -rf {{release_path}}/temp/cache/*');
|
// Nová release patří deploy — sudo není potřeba
|
||||||
|
run('rm -rf {{release_path}}/temp/cache/* {{release_path}}/temp/mpdf');
|
||||||
});
|
});
|
||||||
|
|
||||||
after('deploy:symlink', 'deploy:clear_cache');
|
after('deploy:symlink', 'deploy:clear_cache');
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ return array(
|
||||||
'Psr\\Log\\' => array($vendorDir . '/psr/log/src'),
|
'Psr\\Log\\' => array($vendorDir . '/psr/log/src'),
|
||||||
'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src'),
|
'Psr\\Http\\Message\\' => array($vendorDir . '/psr/http-message/src'),
|
||||||
'Psr\\Container\\' => array($vendorDir . '/psr/container/src'),
|
'Psr\\Container\\' => array($vendorDir . '/psr/container/src'),
|
||||||
|
'Mpdf\\QrCode\\' => array($vendorDir . '/mpdf/qrcode/src'),
|
||||||
'Mpdf\\PsrLogAwareTrait\\' => array($vendorDir . '/mpdf/psr-log-aware-trait/src'),
|
'Mpdf\\PsrLogAwareTrait\\' => array($vendorDir . '/mpdf/psr-log-aware-trait/src'),
|
||||||
'Mpdf\\PsrHttpMessageShim\\' => array($vendorDir . '/mpdf/psr-http-message-shim/src'),
|
'Mpdf\\PsrHttpMessageShim\\' => array($vendorDir . '/mpdf/psr-http-message-shim/src'),
|
||||||
'Mpdf\\' => array($vendorDir . '/mpdf/mpdf/src'),
|
'Mpdf\\' => array($vendorDir . '/mpdf/mpdf/src'),
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,7 @@ class ComposerStaticInit9c49a418f02ffb235919088891200a26
|
||||||
),
|
),
|
||||||
'M' =>
|
'M' =>
|
||||||
array (
|
array (
|
||||||
|
'Mpdf\\QrCode\\' => 12,
|
||||||
'Mpdf\\PsrLogAwareTrait\\' => 22,
|
'Mpdf\\PsrLogAwareTrait\\' => 22,
|
||||||
'Mpdf\\PsrHttpMessageShim\\' => 24,
|
'Mpdf\\PsrHttpMessageShim\\' => 24,
|
||||||
'Mpdf\\' => 5,
|
'Mpdf\\' => 5,
|
||||||
|
|
@ -119,6 +120,10 @@ class ComposerStaticInit9c49a418f02ffb235919088891200a26
|
||||||
array (
|
array (
|
||||||
0 => __DIR__ . '/..' . '/psr/container/src',
|
0 => __DIR__ . '/..' . '/psr/container/src',
|
||||||
),
|
),
|
||||||
|
'Mpdf\\QrCode\\' =>
|
||||||
|
array (
|
||||||
|
0 => __DIR__ . '/..' . '/mpdf/qrcode/src',
|
||||||
|
),
|
||||||
'Mpdf\\PsrLogAwareTrait\\' =>
|
'Mpdf\\PsrLogAwareTrait\\' =>
|
||||||
array (
|
array (
|
||||||
0 => __DIR__ . '/..' . '/mpdf/psr-log-aware-trait/src',
|
0 => __DIR__ . '/..' . '/mpdf/psr-log-aware-trait/src',
|
||||||
|
|
|
||||||
|
|
@ -397,6 +397,77 @@
|
||||||
},
|
},
|
||||||
"install-path": "../mpdf/psr-log-aware-trait"
|
"install-path": "../mpdf/psr-log-aware-trait"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"name": "mpdf/qrcode",
|
||||||
|
"version": "v1.2.2",
|
||||||
|
"version_normalized": "1.2.2.0",
|
||||||
|
"source": {
|
||||||
|
"type": "git",
|
||||||
|
"url": "https://github.com/mpdf/qrcode.git",
|
||||||
|
"reference": "d4fa19117a7241c30ac84902b6236a02c7a3f268"
|
||||||
|
},
|
||||||
|
"dist": {
|
||||||
|
"type": "zip",
|
||||||
|
"url": "https://api.github.com/repos/mpdf/qrcode/zipball/d4fa19117a7241c30ac84902b6236a02c7a3f268",
|
||||||
|
"reference": "d4fa19117a7241c30ac84902b6236a02c7a3f268",
|
||||||
|
"shasum": ""
|
||||||
|
},
|
||||||
|
"require": {
|
||||||
|
"paragonie/random_compat": "^1.4|^2.0|^9.99.99",
|
||||||
|
"php": "^5.6 || ^7.0 || ^8.0"
|
||||||
|
},
|
||||||
|
"require-dev": {
|
||||||
|
"mockery/mockery": "^0.9.5 || ^1.0",
|
||||||
|
"squizlabs/php_codesniffer": "^3.4",
|
||||||
|
"tracy/tracy": "^2.5",
|
||||||
|
"yoast/phpunit-polyfills": "^1.0"
|
||||||
|
},
|
||||||
|
"suggest": {
|
||||||
|
"ext-gd": "To output QR codes to PNG files",
|
||||||
|
"ext-simplexml": "To output QR codes to SVG files"
|
||||||
|
},
|
||||||
|
"time": "2025-12-19T16:21:49+00:00",
|
||||||
|
"type": "library",
|
||||||
|
"installation-source": "dist",
|
||||||
|
"autoload": {
|
||||||
|
"psr-4": {
|
||||||
|
"Mpdf\\QrCode\\": "src/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
|
"license": [
|
||||||
|
"LGPL-2.1-or-later"
|
||||||
|
],
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Matěj Humpál",
|
||||||
|
"role": "maintainer"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Laurent Minguet",
|
||||||
|
"role": "author"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"description": "QR code generator for mPDF",
|
||||||
|
"keywords": [
|
||||||
|
"mpdf",
|
||||||
|
"pdf",
|
||||||
|
"php",
|
||||||
|
"qr",
|
||||||
|
"qrcode"
|
||||||
|
],
|
||||||
|
"support": {
|
||||||
|
"issues": "https://github.com/mpdf/qrcode/issues",
|
||||||
|
"source": "https://github.com/mpdf/qrcode/tree/v1.2.2"
|
||||||
|
},
|
||||||
|
"funding": [
|
||||||
|
{
|
||||||
|
"url": "https://www.paypal.me/mpdf",
|
||||||
|
"type": "custom"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"install-path": "../mpdf/qrcode"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"name": "myclabs/deep-copy",
|
"name": "myclabs/deep-copy",
|
||||||
"version": "1.14.0",
|
"version": "1.14.0",
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@
|
||||||
'name' => 'nette/web-project',
|
'name' => 'nette/web-project',
|
||||||
'pretty_version' => 'dev-master',
|
'pretty_version' => 'dev-master',
|
||||||
'version' => 'dev-master',
|
'version' => 'dev-master',
|
||||||
'reference' => '6192b1e012f08cb7c407c731b8218bc6346c4a41',
|
'reference' => '9a03931e2427601911164d4593f905e877de0802',
|
||||||
'type' => 'project',
|
'type' => 'project',
|
||||||
'install_path' => __DIR__ . '/../../',
|
'install_path' => __DIR__ . '/../../',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
|
|
@ -64,6 +64,15 @@
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
'dev_requirement' => false,
|
'dev_requirement' => false,
|
||||||
),
|
),
|
||||||
|
'mpdf/qrcode' => array(
|
||||||
|
'pretty_version' => 'v1.2.2',
|
||||||
|
'version' => '1.2.2.0',
|
||||||
|
'reference' => 'd4fa19117a7241c30ac84902b6236a02c7a3f268',
|
||||||
|
'type' => 'library',
|
||||||
|
'install_path' => __DIR__ . '/../mpdf/qrcode',
|
||||||
|
'aliases' => array(),
|
||||||
|
'dev_requirement' => false,
|
||||||
|
),
|
||||||
'myclabs/deep-copy' => array(
|
'myclabs/deep-copy' => array(
|
||||||
'pretty_version' => '1.14.0',
|
'pretty_version' => '1.14.0',
|
||||||
'version' => '1.14.0.0',
|
'version' => '1.14.0.0',
|
||||||
|
|
@ -229,7 +238,7 @@
|
||||||
'nette/web-project' => array(
|
'nette/web-project' => array(
|
||||||
'pretty_version' => 'dev-master',
|
'pretty_version' => 'dev-master',
|
||||||
'version' => 'dev-master',
|
'version' => 'dev-master',
|
||||||
'reference' => '6192b1e012f08cb7c407c731b8218bc6346c4a41',
|
'reference' => '9a03931e2427601911164d4593f905e877de0802',
|
||||||
'type' => 'project',
|
'type' => 'project',
|
||||||
'install_path' => __DIR__ . '/../../',
|
'install_path' => __DIR__ . '/../../',
|
||||||
'aliases' => array(),
|
'aliases' => array(),
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,53 @@
|
||||||
|
Contributing
|
||||||
|
============
|
||||||
|
|
||||||
|
Issue tracker
|
||||||
|
-------------
|
||||||
|
|
||||||
|
The Issue tracker serves mainly as a place to report bugs and request new features.
|
||||||
|
Please do not abuse it as a general questions or troubleshooting location.
|
||||||
|
|
||||||
|
General troubleshooting
|
||||||
|
-------------
|
||||||
|
|
||||||
|
For these questions please use [Discussions](https://github.com/mpdf/mpdf/discussions). Add your enquiry
|
||||||
|
to appropriate category and as always, include a reproducible code example when applicable (see code example guidelines below).
|
||||||
|
|
||||||
|
You can also use the [mpdf tag](https://stackoverflow.com/questions/tagged/mpdf)
|
||||||
|
at [Stack Overflow](https://stackoverflow.com/)
|
||||||
|
as the StackOverflow user base is more likely to answer you in a timely manner.
|
||||||
|
When doing so, make sure you comply to StackOverflow question guidelines.
|
||||||
|
|
||||||
|
Bug reports
|
||||||
|
-------------
|
||||||
|
|
||||||
|
* Bug reports **MUST** contain a small example in php/html that reproduces the bug.
|
||||||
|
* The code example **MUST** be reproducible by copy&paste assuming composer dependencies are installed. That means:
|
||||||
|
* No calling unrelated funcions,
|
||||||
|
* an actual final HTML code has to be present, pasting a template file is not enough,
|
||||||
|
* if the bug considers import or fonts, example source PDF/TTF/etc files have to be included.
|
||||||
|
* Failing to provide necessary information or not using the issue template will cause the issue to be closed until required information is provided.
|
||||||
|
* Please report one feature or one bug per issue.
|
||||||
|
|
||||||
|
Feature requests
|
||||||
|
-------------
|
||||||
|
|
||||||
|
Feature requests have to be labeled as such and have to include reasoning for the change in question.
|
||||||
|
|
||||||
|
|
||||||
|
Pull requests
|
||||||
|
-------------
|
||||||
|
|
||||||
|
Pull requests should be always based on the default [development](https://github.com/mpdf/mpdf/tree/development)
|
||||||
|
branch except for backports to older versions.
|
||||||
|
|
||||||
|
Guidelines:
|
||||||
|
|
||||||
|
* Use an aptly named feature branch for the Pull request.
|
||||||
|
* Only files and lines affecting the scope of the Pull request must be affected.
|
||||||
|
* Make small, *atomic* commits that keep the smallest possible related code changes together.
|
||||||
|
* Code must be accompanied by a unit test testing expected behaviour whenever possible.
|
||||||
|
* To be incorporated, the PR should contain a change in the CHANGELOG.md file describing itself
|
||||||
|
|
||||||
|
When updating a PR, do not create a new one, just `git push --force` to your former feature branch, the PR will
|
||||||
|
update itself.
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
custom: https://www.paypal.me/mpdf
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
---
|
||||||
|
name: Bug report 🐛
|
||||||
|
about: The library does not work as expected
|
||||||
|
---
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Fill in provided template with information about the bug
|
||||||
|
Provide a short and reproducible code example
|
||||||
|
⚠ Failing to provide necessary information will cause the issue to be closed until appropriately updated.
|
||||||
|
See Contributing guidelines for further information
|
||||||
|
-->
|
||||||
|
|
||||||
|
### I found this bug
|
||||||
|
|
||||||
|
### This is mPDF and PHP version and environment (server/fpm/cli etc) I am using
|
||||||
|
|
||||||
|
### This is the PHP code snippet I use
|
||||||
|
|
||||||
|
```
|
||||||
|
<?php
|
||||||
|
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
### This is the HTML/CSS code snippet I use
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
```
|
||||||
|
|
@ -0,0 +1,8 @@
|
||||||
|
---
|
||||||
|
name: Feature request 🚀
|
||||||
|
about: I would like to have a new functionality added
|
||||||
|
---
|
||||||
|
|
||||||
|
# Feature request
|
||||||
|
|
||||||
|
<!-- Please describe the new functionality as best as you can. -->
|
||||||
|
|
@ -0,0 +1,7 @@
|
||||||
|
contact_links:
|
||||||
|
- name: General questions and troubleshooting ❓
|
||||||
|
url: https://github.com/mpdf/mpdf/discussions
|
||||||
|
about: You can use Github Discussions for general questions and troubleshooting. Please note that asking at Stack Overflow will probably be more successful.
|
||||||
|
- name: QA at Stack Overflow ❓
|
||||||
|
url: https://stackoverflow.com/questions/tagged/mpdf
|
||||||
|
about: Ask at Stack Overflow for a greater chance of a quick and correct answer to your questions. Make sure to comply to SO rules, terms and conditions.
|
||||||
|
|
@ -0,0 +1,42 @@
|
||||||
|
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
|
||||||
|
|
||||||
|
name: "Code coverage"
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- "development"
|
||||||
|
- "coverage"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
coverage:
|
||||||
|
|
||||||
|
name: "Code coverage"
|
||||||
|
|
||||||
|
runs-on: ${{ matrix.operating-system }}
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
php-version:
|
||||||
|
- "7.4"
|
||||||
|
|
||||||
|
operating-system: [ubuntu-latest]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: "Checkout"
|
||||||
|
uses: "actions/checkout@v2"
|
||||||
|
|
||||||
|
- name: "Install PHP"
|
||||||
|
uses: "shivammathur/setup-php@v2"
|
||||||
|
with:
|
||||||
|
coverage: "xdebug"
|
||||||
|
php-version: "${{ matrix.php-version }}"
|
||||||
|
extensions: "mbstring, gd, bcmath, bz2"
|
||||||
|
tools: composer:v2
|
||||||
|
|
||||||
|
- name: "Install dependencies"
|
||||||
|
run: "composer install --no-interaction --no-progress"
|
||||||
|
|
||||||
|
- name: "Code coverage"
|
||||||
|
run: composer coverage
|
||||||
|
|
@ -0,0 +1,43 @@
|
||||||
|
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
|
||||||
|
|
||||||
|
name: "Coding standard check"
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- "development"
|
||||||
|
- "test"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
cs:
|
||||||
|
|
||||||
|
name: "Coding standard"
|
||||||
|
|
||||||
|
runs-on: ${{ matrix.operating-system }}
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
matrix:
|
||||||
|
php-version:
|
||||||
|
- "7.4"
|
||||||
|
|
||||||
|
operating-system: [ubuntu-latest]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: "Checkout"
|
||||||
|
uses: "actions/checkout@v2"
|
||||||
|
|
||||||
|
- name: "Install PHP"
|
||||||
|
uses: "shivammathur/setup-php@v2"
|
||||||
|
with:
|
||||||
|
coverage: "none"
|
||||||
|
php-version: "${{ matrix.php-version }}"
|
||||||
|
extensions: "mbstring"
|
||||||
|
tools: composer:v2
|
||||||
|
|
||||||
|
- name: "Install dependencies"
|
||||||
|
run: "composer install --no-interaction --no-progress"
|
||||||
|
|
||||||
|
- name: "CS"
|
||||||
|
run: composer cs
|
||||||
|
|
@ -0,0 +1,56 @@
|
||||||
|
# https://help.github.com/en/categories/automating-your-workflow-with-github-actions
|
||||||
|
|
||||||
|
name: "CI"
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
push:
|
||||||
|
branches:
|
||||||
|
- "master"
|
||||||
|
- "development"
|
||||||
|
- "test"
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
|
||||||
|
tests:
|
||||||
|
|
||||||
|
name: "Tests"
|
||||||
|
|
||||||
|
runs-on: ${{ matrix.operating-system }}
|
||||||
|
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
php-version:
|
||||||
|
- "5.6"
|
||||||
|
- "7.0"
|
||||||
|
- "7.1"
|
||||||
|
- "7.2"
|
||||||
|
- "7.3"
|
||||||
|
- "7.4"
|
||||||
|
- "8.0"
|
||||||
|
- "8.1"
|
||||||
|
- "8.2"
|
||||||
|
- "8.3"
|
||||||
|
- "8.4"
|
||||||
|
- "8.5"
|
||||||
|
operating-system: [ubuntu-latest, windows-latest]
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: "Checkout"
|
||||||
|
uses: "actions/checkout@v2"
|
||||||
|
|
||||||
|
- name: "Install PHP"
|
||||||
|
uses: "shivammathur/setup-php@v2"
|
||||||
|
with:
|
||||||
|
coverage: "none"
|
||||||
|
php-version: "${{ matrix.php-version }}"
|
||||||
|
extensions: "mbstring, gd, bcmath, bz2"
|
||||||
|
tools: composer:v2
|
||||||
|
ini-values: error_reporting=-1
|
||||||
|
|
||||||
|
- name: "Install dependencies"
|
||||||
|
run: "composer install --no-interaction --no-progress"
|
||||||
|
|
||||||
|
- name: "Tests"
|
||||||
|
run: composer test
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
/composer.lock
|
||||||
|
/coverage/
|
||||||
|
/vendor/
|
||||||
|
|
@ -0,0 +1,165 @@
|
||||||
|
GNU LESSER GENERAL PUBLIC LICENSE
|
||||||
|
Version 3, 29 June 2007
|
||||||
|
|
||||||
|
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||||
|
Everyone is permitted to copy and distribute verbatim copies
|
||||||
|
of this license document, but changing it is not allowed.
|
||||||
|
|
||||||
|
|
||||||
|
This version of the GNU Lesser General Public License incorporates
|
||||||
|
the terms and conditions of version 3 of the GNU General Public
|
||||||
|
License, supplemented by the additional permissions listed below.
|
||||||
|
|
||||||
|
0. Additional Definitions.
|
||||||
|
|
||||||
|
As used herein, "this License" refers to version 3 of the GNU Lesser
|
||||||
|
General Public License, and the "GNU GPL" refers to version 3 of the GNU
|
||||||
|
General Public License.
|
||||||
|
|
||||||
|
"The Library" refers to a covered work governed by this License,
|
||||||
|
other than an Application or a Combined Work as defined below.
|
||||||
|
|
||||||
|
An "Application" is any work that makes use of an interface provided
|
||||||
|
by the Library, but which is not otherwise based on the Library.
|
||||||
|
Defining a subclass of a class defined by the Library is deemed a mode
|
||||||
|
of using an interface provided by the Library.
|
||||||
|
|
||||||
|
A "Combined Work" is a work produced by combining or linking an
|
||||||
|
Application with the Library. The particular version of the Library
|
||||||
|
with which the Combined Work was made is also called the "Linked
|
||||||
|
Version".
|
||||||
|
|
||||||
|
The "Minimal Corresponding Source" for a Combined Work means the
|
||||||
|
Corresponding Source for the Combined Work, excluding any source code
|
||||||
|
for portions of the Combined Work that, considered in isolation, are
|
||||||
|
based on the Application, and not on the Linked Version.
|
||||||
|
|
||||||
|
The "Corresponding Application Code" for a Combined Work means the
|
||||||
|
object code and/or source code for the Application, including any data
|
||||||
|
and utility programs needed for reproducing the Combined Work from the
|
||||||
|
Application, but excluding the System Libraries of the Combined Work.
|
||||||
|
|
||||||
|
1. Exception to Section 3 of the GNU GPL.
|
||||||
|
|
||||||
|
You may convey a covered work under sections 3 and 4 of this License
|
||||||
|
without being bound by section 3 of the GNU GPL.
|
||||||
|
|
||||||
|
2. Conveying Modified Versions.
|
||||||
|
|
||||||
|
If you modify a copy of the Library, and, in your modifications, a
|
||||||
|
facility refers to a function or data to be supplied by an Application
|
||||||
|
that uses the facility (other than as an argument passed when the
|
||||||
|
facility is invoked), then you may convey a copy of the modified
|
||||||
|
version:
|
||||||
|
|
||||||
|
a) under this License, provided that you make a good faith effort to
|
||||||
|
ensure that, in the event an Application does not supply the
|
||||||
|
function or data, the facility still operates, and performs
|
||||||
|
whatever part of its purpose remains meaningful, or
|
||||||
|
|
||||||
|
b) under the GNU GPL, with none of the additional permissions of
|
||||||
|
this License applicable to that copy.
|
||||||
|
|
||||||
|
3. Object Code Incorporating Material from Library Header Files.
|
||||||
|
|
||||||
|
The object code form of an Application may incorporate material from
|
||||||
|
a header file that is part of the Library. You may convey such object
|
||||||
|
code under terms of your choice, provided that, if the incorporated
|
||||||
|
material is not limited to numerical parameters, data structure
|
||||||
|
layouts and accessors, or small macros, inline functions and templates
|
||||||
|
(ten or fewer lines in length), you do both of the following:
|
||||||
|
|
||||||
|
a) Give prominent notice with each copy of the object code that the
|
||||||
|
Library is used in it and that the Library and its use are
|
||||||
|
covered by this License.
|
||||||
|
|
||||||
|
b) Accompany the object code with a copy of the GNU GPL and this license
|
||||||
|
document.
|
||||||
|
|
||||||
|
4. Combined Works.
|
||||||
|
|
||||||
|
You may convey a Combined Work under terms of your choice that,
|
||||||
|
taken together, effectively do not restrict modification of the
|
||||||
|
portions of the Library contained in the Combined Work and reverse
|
||||||
|
engineering for debugging such modifications, if you also do each of
|
||||||
|
the following:
|
||||||
|
|
||||||
|
a) Give prominent notice with each copy of the Combined Work that
|
||||||
|
the Library is used in it and that the Library and its use are
|
||||||
|
covered by this License.
|
||||||
|
|
||||||
|
b) Accompany the Combined Work with a copy of the GNU GPL and this license
|
||||||
|
document.
|
||||||
|
|
||||||
|
c) For a Combined Work that displays copyright notices during
|
||||||
|
execution, include the copyright notice for the Library among
|
||||||
|
these notices, as well as a reference directing the user to the
|
||||||
|
copies of the GNU GPL and this license document.
|
||||||
|
|
||||||
|
d) Do one of the following:
|
||||||
|
|
||||||
|
0) Convey the Minimal Corresponding Source under the terms of this
|
||||||
|
License, and the Corresponding Application Code in a form
|
||||||
|
suitable for, and under terms that permit, the user to
|
||||||
|
recombine or relink the Application with a modified version of
|
||||||
|
the Linked Version to produce a modified Combined Work, in the
|
||||||
|
manner specified by section 6 of the GNU GPL for conveying
|
||||||
|
Corresponding Source.
|
||||||
|
|
||||||
|
1) Use a suitable shared library mechanism for linking with the
|
||||||
|
Library. A suitable mechanism is one that (a) uses at run time
|
||||||
|
a copy of the Library already present on the user's computer
|
||||||
|
system, and (b) will operate properly with a modified version
|
||||||
|
of the Library that is interface-compatible with the Linked
|
||||||
|
Version.
|
||||||
|
|
||||||
|
e) Provide Installation Information, but only if you would otherwise
|
||||||
|
be required to provide such information under section 6 of the
|
||||||
|
GNU GPL, and only to the extent that such information is
|
||||||
|
necessary to install and execute a modified version of the
|
||||||
|
Combined Work produced by recombining or relinking the
|
||||||
|
Application with a modified version of the Linked Version. (If
|
||||||
|
you use option 4d0, the Installation Information must accompany
|
||||||
|
the Minimal Corresponding Source and Corresponding Application
|
||||||
|
Code. If you use option 4d1, you must provide the Installation
|
||||||
|
Information in the manner specified by section 6 of the GNU GPL
|
||||||
|
for conveying Corresponding Source.)
|
||||||
|
|
||||||
|
5. Combined Libraries.
|
||||||
|
|
||||||
|
You may place library facilities that are a work based on the
|
||||||
|
Library side by side in a single library together with other library
|
||||||
|
facilities that are not Applications and are not covered by this
|
||||||
|
License, and convey such a combined library under terms of your
|
||||||
|
choice, if you do both of the following:
|
||||||
|
|
||||||
|
a) Accompany the combined library with a copy of the same work based
|
||||||
|
on the Library, uncombined with any other library facilities,
|
||||||
|
conveyed under the terms of this License.
|
||||||
|
|
||||||
|
b) Give prominent notice with the combined library that part of it
|
||||||
|
is a work based on the Library, and explaining where to find the
|
||||||
|
accompanying uncombined form of the same work.
|
||||||
|
|
||||||
|
6. Revised Versions of the GNU Lesser General Public License.
|
||||||
|
|
||||||
|
The Free Software Foundation may publish revised and/or new versions
|
||||||
|
of the GNU Lesser General Public License from time to time. Such new
|
||||||
|
versions will be similar in spirit to the present version, but may
|
||||||
|
differ in detail to address new problems or concerns.
|
||||||
|
|
||||||
|
Each version is given a distinguishing version number. If the
|
||||||
|
Library as you received it specifies that a certain numbered version
|
||||||
|
of the GNU Lesser General Public License "or any later version"
|
||||||
|
applies to it, you have the option of following the terms and
|
||||||
|
conditions either of that published version or of any later version
|
||||||
|
published by the Free Software Foundation. If the Library as you
|
||||||
|
received it does not specify a version number of the GNU Lesser
|
||||||
|
General Public License, you may choose any version of the GNU Lesser
|
||||||
|
General Public License ever published by the Free Software Foundation.
|
||||||
|
|
||||||
|
If the Library as you received it specifies that a proxy can decide
|
||||||
|
whether future versions of the GNU Lesser General Public License shall
|
||||||
|
apply, that proxy's public statement of acceptance of any version is
|
||||||
|
permanent authorization for you to choose that version for the
|
||||||
|
Library.
|
||||||
|
|
@ -0,0 +1,38 @@
|
||||||
|
# mPDF QR code library
|
||||||
|
|
||||||
|
QR code generating library with HTML/PNG/mPDF output possibilities.
|
||||||
|
|
||||||
|
[](https://travis-ci.org/mpdf/mpdf)
|
||||||
|
|
||||||
|
This is based on QrCode library bundled with mPDF until v8.0, made by Laurent Minguet. It is provided under LGPL license.
|
||||||
|
|
||||||
|
## Installation
|
||||||
|
|
||||||
|
```sh
|
||||||
|
$ composer require mpdf/qrcode
|
||||||
|
```
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
|
||||||
|
```php
|
||||||
|
<?php
|
||||||
|
|
||||||
|
use Mpdf\QrCode\QrCode;
|
||||||
|
use Mpdf\QrCode\Output;
|
||||||
|
|
||||||
|
$qrCode = new QrCode('Lorem ipsum sit dolor');
|
||||||
|
|
||||||
|
// Save black on white PNG image 100 px wide to filename.png. Colors are RGB arrays.
|
||||||
|
$output = new Output\Png();
|
||||||
|
$data = $output->output($qrCode, 100, [255, 255, 255], [0, 0, 0]);
|
||||||
|
file_put_contents('filename.png', $data);
|
||||||
|
|
||||||
|
// Echo a SVG file, 100 px wide, black on white.
|
||||||
|
// Colors can be specified in SVG-compatible formats
|
||||||
|
$output = new Output\Svg();
|
||||||
|
echo $output->output($qrCode, 100, 'white', 'black');
|
||||||
|
|
||||||
|
// Echo an HTML table
|
||||||
|
$output = new Output\Html();
|
||||||
|
echo $output->output($qrCode);
|
||||||
|
```
|
||||||
|
|
@ -0,0 +1,57 @@
|
||||||
|
{
|
||||||
|
|
||||||
|
"name": "mpdf/qrcode",
|
||||||
|
"type": "library",
|
||||||
|
|
||||||
|
"description": "QR code generator for mPDF",
|
||||||
|
|
||||||
|
"keywords": ["php", "pdf", "mpdf", "qr", "qrcode"],
|
||||||
|
|
||||||
|
"license": "LGPL-2.1-or-later",
|
||||||
|
|
||||||
|
"authors": [
|
||||||
|
{
|
||||||
|
"name": "Matěj Humpál",
|
||||||
|
"role": "maintainer"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Laurent Minguet",
|
||||||
|
"role": "author"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
|
"require": {
|
||||||
|
"php": "^5.6 || ^7.0 || ^8.0",
|
||||||
|
"paragonie/random_compat": "^1.4|^2.0|^9.99.99"
|
||||||
|
},
|
||||||
|
|
||||||
|
"require-dev": {
|
||||||
|
"yoast/phpunit-polyfills": "^1.0",
|
||||||
|
"mockery/mockery": "^0.9.5 || ^1.0",
|
||||||
|
"squizlabs/php_codesniffer": "^3.4",
|
||||||
|
"tracy/tracy": "^2.5"
|
||||||
|
},
|
||||||
|
|
||||||
|
"scripts": {
|
||||||
|
"cs": "@php vendor/bin/phpcs -v --report-width=160 --standard=ruleset.xml --severity=1 --warning-severity=0 --extensions=php src tests",
|
||||||
|
"test": "@php vendor/bin/phpunit",
|
||||||
|
"coverage": "@php vendor/bin/phpunit --coverage-text"
|
||||||
|
},
|
||||||
|
|
||||||
|
"suggest": {
|
||||||
|
"ext-gd": "To output QR codes to PNG files",
|
||||||
|
"ext-simplexml": "To output QR codes to SVG files"
|
||||||
|
},
|
||||||
|
|
||||||
|
"autoload": {
|
||||||
|
|
||||||
|
"psr-4": {
|
||||||
|
"Mpdf\\QrCode\\": "src/"
|
||||||
|
}
|
||||||
|
|
||||||
|
},
|
||||||
|
|
||||||
|
"autoload-dev": {
|
||||||
|
"files": [ "tests/functions.php" ]
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue