Closed acosonic closed 5 years ago
This means font and image file not found. You need to edit the paths below that it can find the file.
$qrCode->setLabel('Scan the code', 16, __DIR__.'/../assets/fonts/noto_sans.otf', LabelAlignment::CENTER);
$qrCode->setLogoPath(__DIR__.'/../assets/images/symfony.png');
Those two files are inside qr-code packages installed by composer.
Where do I find those fonts fike? Are they in github repo?
Yes. In asset folder. You have them already on your server as you installed this repo via composer. Look inside assets folder of this pack and add relative path to those files that your script can find them.
I've tried basic demo from your homepage
just composer install
added autoload at the top of
rest is like on homepage
And got this error
Fatal error: Uncaught Endroid\QrCode\Exception\InvalidPathException: Invalid label font path: in /home/aleksandar/websites/qr/vendor/endroid/qr-code/src/QrCode.php:392 Stack trace: #0 /home/aleksandar/websites/qr/vendor/endroid/qr-code/src/QrCode.php(338): Endroid\QrCode\QrCode->setLabelFontPath(false) #1 /home/aleksandar/websites/qr/p.php(19): Endroid\QrCode\QrCode->setLabel('Scan the code', 16, '/home/aleksanda...', 'center') #2 {main} thrown in /home/aleksandar/websites/qr/vendor/endroid/qr-code/src/QrCode.php on line 392