首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >WordPress中的PDF417条形码

WordPress中的PDF417条形码
EN

Stack Overflow用户
提问于 2018-06-04 21:01:07
回答 1查看 304关注 0票数 0

如何在wordpress中生成PDF417条形码?你会使用什么php库,你会如何从functions.php调用它?这实际上是一个好的开始吗?这是我找到的东西:https://github.com/tecnickcom/tc-lib-pdf

我的理想场景是在php库之外,然后将其包含在functions.php文件中,然后使用转换为PDF417图像的参数调用它(最好是SVG,但PNG也可以)。

EN

回答 1

Stack Overflow用户

发布于 2018-06-04 21:10:00

如果您可以在服务器上安装Zint,我已经创建了一个可以生成这种格式条形码的PHP类。

https://github.com/delboy1978uk/php-zint

代码语言:javascript
复制
<?php

use Del\Barcode\Service\BarcodeService;

// Use [] instead of () if barcode has parenthesis
$barcodeNumber = '646496874646'; // <- whatever, not the real format

$path = realpath('/path/to/genration/folder'); // Where zint will dump the image (gets deleted after generation)
$barcodeService = new BarcodeService($path);

$image = $barcodeService->generate(
    BarcodeService::TYPE_PDF_417,
    $barcodeNumber
);

echo $image;
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/50681274

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档