blob: 78645612dca8038be53bf4184aef3fb9c3e39db2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
-- Copyright (C) 2018 Roberto Giacomelli
local barracuda = require "barracuda"
local barcode = barracuda:get_barcode_class()
local c128, err = barcode:new_encoder("code128")
assert(not err, err)
print(c128._NAME)
print(c128._VERSION)
local info = c128:info()
print("encoder name = ", info.name)
print("description = ", info.description)
for k, tp in ipairs(info.param) do
print(k, tp.name, tp.value)
end
local symb = c128:from_string("123")
print("Symbol char list:")
for _, c in ipairs(symb._code_data) do
print(c)
end
local canvas = barracuda:new_canvas()
symb:append_ga(canvas)
-- driver library
local drv = barracuda:get_driver()
drv:save("svg", canvas, "c128-123")
|