I'm currently using this Plugin to generate QR-Codes on my site. These QR-Codes are used for products, so it refers to a special product when downloading.
This is the code I use to generate it and make it able to be downloaded:
<a href="data:image/png;base64, <?php echo base64_encode(QrCode::format('png')->size(500)->encoding('UTF-8')->errorCorrection('H')->generate('https://localhost/product/'.$product->id));?> "
download=<?=$product->name."_QRCode";?>>
<img src="data:image/png;base64, <?php echo base64_encode(QrCode::format('png')->margin(1)->size(50)->encoding('UTF-8')->errorCorrection('H')->generate('https://localhost/product/'.$product->id));?>">
</a>
Now comes the clue: Like this, somebody could download 10 QR-Codes but would have no idea, where this QR-Code belongs to. Therefore, I want the downloaded QR-Code to be merged with a string... But as the docs say, that The merge method only supports PNG at this time
I guess it's not possible to do this directly. But I'm wondering if there is a way in PHP (and also with Laravel, which I'm using, if this changes something) to generate an image (a png) out of a string I enter, so something like (pseudoCode follows):
$mergeText = $product->name;
$image = stringToPng($mergeText);
//maybe instead convert to base64 image, like the qr-code? don't know
QrCode::format('png')->size(500)->encoding('UTF-8')->errorCorrection('H')->merge($image)->generate('https://localhost/product/'.$product->id));?>
Does anybody know if this is possible?