Create SVG QR Codes with embedded logos #244
-
Hi, first of all thanks for the library. I'm working with this example (https://github.com/chillerlan/php-qrcode/blob/v5.0.x/examples/svgWithLogo.php) and it works fine with all the svg images I download from here https://simpleicons.org/. But when I try to embed my own SVG logos, or this wikipedia example (https://upload.wikimedia.org/wikipedia/en/8/80/Wikipedia-logo-v2.svg), the QrCode doesn't add my SVG logo (there remains an empty space in the center). Do the SVG images to be embedded have to have a certain format? Thank you |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 10 replies
-
With github logo from https://simpleicons.org/ |
Beta Was this translation helpful? Give feedback.
-
Hey, I just tried here on local and ended up with this (ignoring the parse errors that are produced by the wikipedia logo's headers) When you remove the XML and DOCTYPE header lines as well as the fixed width and height from the logo SVG, it works perfectly fine (SVG source below): |
Beta Was this translation helpful? Give feedback.
-
Thanks for the reply. I tried to modify the svg code of the wikipedia svg image, keeping only the content of the SVG tag and the following as tag parameters: , but the image is still not displayed. I attach the modified svg image. There is clearly something wrong with the code of the modified svg image. |
Beta Was this translation helpful? Give feedback.
-
https://github.com/chillerlan/php-qrcode/blob/main/examples/svgWithLogo.php I use this code but no logo appears and no errors. |
Beta Was this translation helpful? Give feedback.
Hey, I just tried here on local and ended up with this (ignoring the parse errors that are produced by the wikipedia logo's headers)
When you remove the XML and DOCTYPE header lines as well as the fixed width and height from the logo SVG, it works perfectly fine (SVG source below):