Security News
The Unpaid Backbone of Open Source: Solo Maintainers Face Increasing Security Demands
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
pdf417-generator
Advanced tools
This library provides you with the ability to generate PDF417 HUB3 Barcodes in browser or Node.js apps. The final barcode is drawn into a canvas element and can be used for many different use cases. The code is based on the bcmath-js and pdf417-js.
You can find a complete example at examples/browser.
The usage is as simple as providing a canvas element and a text that should be used for barcode generation:
<script src="https://cdn.rawgit.com/qaap/pdf417-generator/master/lib/libbcmath.js" type="text/javascript"></script>
<script src="https://cdn.rawgit.com/qaap/pdf417-generator/master/lib/bcmath.js" type="text/javascript"></script>
<script src="https://cdn.rawgit.com/qaap/pdf417-generator/master/lib/pdf417.js" type="text/javascript"></script>
HTML
<canvas id="barcode" ></canvas>
JS
var code = "HRVHUB30\nHRK\n" +
"000000000012355\n"+
"PETAR KORETIĆ\n"+
"PREVOJ DD\n"+
"10000 Zagreb\n"+
"QAAP J.D.O.O\n"+
"PREVOJ DD\n"+
"10000 ZAGREB\n"+
"HR5041240000000000\n"+
"HR01\n"+
"7336-68949637625-00001\n"+
"COST\n"+
"Uplata za 1. mjesec\n";
var canvas = document.getElementById("barcode")
PDF417.draw(code, canvas)
You can find a complete example at examples/node.
Install the library:
npm install pdf417-generator
Use it as:
const Canvas = require("canvas")
const PDF417 = require("pdf417-generator")
const code = "HRVHUB30\nHRK\n" +
"000000000012355\n"+
"PETAR KORETIĆ\n"+
"PREVOJ DD\n"+
"10000 Zagreb\n"+
"QAAP J.D.O.O\n"+
"PREVOJ DD\n"+
"10000 ZAGREB\n"+
"HR5041240000000000\n"+
"HR01\n"+
"7336-68949637625-00001\n"+
"COST\n"+
"Uplata za 1. mjesec\n";
let canvas = new Canvas()
PDF417.draw(code, canvas)
// create an image which can be sent in an e-mail or similar
console.log('<img src="' + canvas.toDataURL() + '" />')
You can always open a new issue or contact us and we’ll help you sort it out.
FAQs
PDF417 HUB3 2D barcode generator for browser and Node
The npm package pdf417-generator receives a total of 1,702 weekly downloads. As such, pdf417-generator popularity was classified as popular.
We found that pdf417-generator demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Solo open source maintainers face burnout and security challenges, with 60% unpaid and 60% considering quitting.
Security News
License exceptions modify the terms of open source licenses, impacting how software can be used, modified, and distributed. Developers should be aware of the legal implications of these exceptions.
Security News
A developer is accusing Tencent of violating the GPL by modifying a Python utility and changing its license to BSD, highlighting the importance of copyleft compliance.