Data Matrix generator is for fast creation of rectangular or square 2D codes. Written on vanilla javascript with no dependencies.
Data Matrix generator written on pure javascript. Produces highly optimized SVG nodes.
Data Matrix svg generator (Live demo)
After datamatrix.min.js
is downloaded and connected to your html5 page, call:
var
svgNode = DATAMatrix('Hello World!');
All other options:
var
svgNode = DATAMatrix({
msg : "Your message here"
,dim : 256
,rct : 0
,pad : 2
,pal : ["#000000", "#f2f4f8"]
,vrb : 0
});
message
, obviously, this is mandatory parameter.0
.256
.2
blocks, set 0
for no padding.color
,background-color
] strings that represent hex color codes, default value is ['#000'
] along with transparent background. Set ['#000'
,'#fff'
] to make background opaque.0
, set this parameter to 1
in case you need more verbose output.