tecnickcom / TCPDF

Official clone of PHP library to generate PDF documents and barcodes
https://tcpdf.org
Other
4.18k stars 1.51k forks source link

Update qrcode.php #524

Closed markusramsak closed 1 year ago

markusramsak commented 2 years ago

Deprecation warning PHP 8.1 Deprecated (8192): Implicit conversion from float 4.833333333333333 to int loses precision

williamdes commented 2 years ago

Do you have some example code on how you build a qrcode using tcpdf?

markusramsak commented 2 years ago

Example:

        $pdf = new TCPDF();
        $pdf->AddPage();
        $style = [
            'position' => 'L',
            'border' => 0,
            'padding' => 0,
            'fgcolor' => [0, 0, 0], // schwarz
            'bgcolor' => false,
            'module_width' => 1,
            'module_height' => 1,
        ];

        // QRCODE,H : QR-CODE Best error correction
        $qrCodeString = 'Long Long Long Long Long Long Long Long Long Long Long Long Long Long Long Long Long Long Long Long Long Long Long Long Long Long Long Long Long Long Long Long Long Long Long Long Test String to be encoded in QR-Code.';
        $pdf->write2DBarcode($qrCodeString, 'QRCODE,H', '', '', 50, 50, $style, 'N');
geoalexidis commented 2 years ago

Hi, When do you plan to merge this PR? Thx

williamdes commented 2 years ago

Hi, When do you plan to merge this PR? Thx

Hi @nicolaasuni Would you mind having a look at some PRs?

nicolaasuni commented 2 years ago

The barcodes in this library are outdated and unmaintained. Please use tc-lib-barcode instead.

markusramsak commented 2 years ago

The barcodes in this library are outdated and unmaintained. Please use tc-lib-barcode instead.

Can I use tc-lib-barcode in combination with "old" TCPDF https://github.com/tecnickcom/TCPDF ? Because I have a PDF-Document created with "old" TCPDF (an invoice) and wanted to add an QR-Code (to pay). It is actually working. I just get the deprecation warnings. If you add me as maintainer for this project I can happily fix this by myself for all people using it. I am a PHP programmer for 15 years and I am using TCPDF for 8 years now, so I am sure I could figure out a good fix.

williamdes commented 2 years ago

The barcodes in this library are outdated and unmaintained. Please use tc-lib-barcode instead.

Should we drop some code to focus on PDFs and release a new major version ?

markusramsak commented 2 years ago

I would love to keep the "old" TCPDF maintained and I would love to be a maintainer. I am always using the latest versions of PHP so I would find a lot of things to fix to keep TCPDF usable for the next years until the new TCPDF library is really stable and feature complete.

nicolaasuni commented 1 year ago

This has been already fixed by another PR.