【问题标题】:How to generayte integrate grcode in php [duplicate]如何在php中集成grcode [重复]
【发布时间】:2021-04-01 18:56:09
【问题描述】:

我目前正在增强一个 php 应用程序以使用可以扫描并执行其他进程的 qrcode。要求是二维码必须在中间(其中心)包含一个标志。我可以使用 qrlib 库生成 qr 代码,但我无法在中心嵌入徽标,可能是因为我没有看到有关如何执行此操作的文档。

使用 qrlib,我只需要包含该库并调用它,它就会生成 qrcode,如下所示

include('phpqrcode/qrlib.php'); QRcode::png('Take care, COVID-19 is for real');

我已经在 laravel 中使用 simplesoftwareio/simple-qrcode 完成了它,但是使用程序 php 我有点束手无策

我需要有关如何使用相同或不同库嵌入徽标的帮助

提前致谢

【问题讨论】:

标签: php


【解决方案1】:

您可以通过此链接https://davidshimjs.github.io/qrcodejs/ 中的 JavaScript 库简单地做到这一点。而不是通过 PHP

示例:

// simple method :

<div id="qrcode"></div>
<script type="text/javascript">
    new QRCode(document.getElementById("qrcode"), "your-link-here e.g https://example.com");
</script>

// or more advanced method :
<script>
var qrcode = new QRCode("test", {
    text: "http://jindo.dev.naver.com/collie",
    width: 128,
    height: 128,
    colorDark : "#000000",
    colorLight : "#ffffff",
    correctLevel : QRCode.CorrectLevel.H
});

qrcode.clear(); // clear the code.
qrcode.makeCode("http://naver.com"); // make another code.

</script>

更多详情,包括下载,请点击此处: https://davidshimjs.github.io/qrcodejs/

要在您的二维码中添加徽标或嵌入徽标,您可以使用 qart.js

看看这个例子:https://kciter.so/qart.js/

【讨论】:

  • 要求二维码中间(中心)必须有logo。
  • 谢谢@Antony,我刚刚检查了详细信息,找不到如何在二维码中心嵌入徽标,您能帮我实现吗??
  • 尝试使用 qart js 代替 od qrcodejs 示例在此链接中:kciter.so/qart.js
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2023-03-09
  • 2015-04-16
  • 1970-01-01
  • 1970-01-01
  • 2023-04-02
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多