sprain / php-swiss-qr-bill

A PHP library to create Swiss QR bills | QR-Rechnung in PHP erstellen
MIT License
275 stars 80 forks source link

QrBill only on the first page #246

Closed gmarineau closed 7 months ago

gmarineau commented 7 months ago

Hi,

First thank you for the package ! Great works.

I have juste one question, it's possible to keep the QrCode on the first page if we have more than one pages with TcPdf.

This how I implement the QrBill with TcPpdf

$qrBill = $this->generateQrBill($invoice);

if (is_null($pdf)) {
    $output = new HtmlOutput($qrBill, 'fr');
} else {
    $output = new TcPdfOutput($qrBill, 'fr', $pdf);
}

try {
    $output->setPrintable(false);

    return $output->getPaymentPart();
} catch (InvalidQrBillDataException $e) {
    foreach ($qrBill->getViolations() as $violation) {
        echo $violation->getMessage();
    }
}
sprain commented 7 months ago

it's possible to keep the QrCode on the first page if we have more than one pages with TcPdf.

This is not a functionality directly provided by this library. You might create two pdfs and then merge them somehow.