jsreport模板动态生成二维条码
jsreport template dynamic generate 2D Barcode
我是 JSReport 的新用户,我想为包含 2D 条码的 phantomjs PDF 构建一个模板,但是,2D 条码内容是动态生成的。任何人都可以公会吗?感谢您的帮助。
这取决于您希望如何生成条形码图像。
一种选择是使用为您执行此操作的外部(免费)服务,然后您只需插入 html 具有适当 url
的图像
<img src='https://www.barcodesinc.com/generator/image.php?code=ABCDEFG&style=197&type=C128B&width=180&height=50&xres=1&font=3'/>
您通常会像这样在 jsreport 中使用 handlebars 填充代码
<img src='https://www.barcodesinc.com/generator/image.php?code={{code}}&style=197&type=C128B&width=180&height=50&xres=1&font=3'/>
游乐场演示
https://playground.jsreport.net/w/anon/FnOXpvbt
另一种选择是使用 npm 模块,它可以像 bwip-js 一样在服务器端呈现条形码。
谢谢你给我一些关键点。我还发现下面的脚本也可以生成二维条码。
< img id='barcode'
来源="https://api.qrserver.com/v1/create-qr-code/?data=HelloWorld&size=100x100"
替代=“”
标题="HELLO"
宽度=“100”
高度="100" />
我知道这是一个老问题。
我需要这个功能,但 url 不起作用
Google有解决办法
https://developers.google.com/chart/infographics/docs/qr_codes
<img src='https://chart.googleapis.com/chart?cht=qr&chl={{rowinfo.qrCode}}&chs=200x200&choe=UTF-8'/>
我是 JSReport 的新用户,我想为包含 2D 条码的 phantomjs PDF 构建一个模板,但是,2D 条码内容是动态生成的。任何人都可以公会吗?感谢您的帮助。
这取决于您希望如何生成条形码图像。 一种选择是使用为您执行此操作的外部(免费)服务,然后您只需插入 html 具有适当 url
的图像<img src='https://www.barcodesinc.com/generator/image.php?code=ABCDEFG&style=197&type=C128B&width=180&height=50&xres=1&font=3'/>
您通常会像这样在 jsreport 中使用 handlebars 填充代码
<img src='https://www.barcodesinc.com/generator/image.php?code={{code}}&style=197&type=C128B&width=180&height=50&xres=1&font=3'/>
游乐场演示
https://playground.jsreport.net/w/anon/FnOXpvbt
另一种选择是使用 npm 模块,它可以像 bwip-js 一样在服务器端呈现条形码。
谢谢你给我一些关键点。我还发现下面的脚本也可以生成二维条码。
< img id='barcode' 来源="https://api.qrserver.com/v1/create-qr-code/?data=HelloWorld&size=100x100" 替代=“” 标题="HELLO" 宽度=“100” 高度="100" />
我知道这是一个老问题。 我需要这个功能,但 url 不起作用 Google有解决办法
https://developers.google.com/chart/infographics/docs/qr_codes
<img src='https://chart.googleapis.com/chart?cht=qr&chl={{rowinfo.qrCode}}&chs=200x200&choe=UTF-8'/>