summaryrefslogtreecommitdiff
path: root/tex/context/base/m-zint.mkiv
diff options
context:
space:
mode:
authorHans Hagen <pragma@wxs.nl>2011-02-04 00:30:00 +0100
committerHans Hagen <pragma@wxs.nl>2011-02-04 00:30:00 +0100
commit8e3049413845d8d8e1f7e672bc613d4e473ee868 (patch)
treed824102395daccfde2e2b35c09c2680b5d7c8d6a /tex/context/base/m-zint.mkiv
parentd463f115bfa8cbbf51ec921861fac46d0893ef06 (diff)
downloadcontext-8e3049413845d8d8e1f7e672bc613d4e473ee868.tar.gz
beta 2011.02.04 00:30
Diffstat (limited to 'tex/context/base/m-zint.mkiv')
-rw-r--r--tex/context/base/m-zint.mkiv10
1 files changed, 8 insertions, 2 deletions
diff --git a/tex/context/base/m-zint.mkiv b/tex/context/base/m-zint.mkiv
index 815d83fab..25371cff2 100644
--- a/tex/context/base/m-zint.mkiv
+++ b/tex/context/base/m-zint.mkiv
@@ -55,10 +55,14 @@ end
function moduledata.zint.generate(code,data,suffix,options)
local code = cleancode(code)
- local name = format("zint-%s-%s.%s",code,md5.hex(data),suffix or "eps")
+ local base = format("zint-%s-%s",code,md5.hex(data))
+ local name = file.addsuffix(base,suffix or "eps")
if not lfs.isfile(name) then
+ local temp = file.addsuffix(base,"tmp")
local code = numberofcode(code)
- os.spawn(format('%s --barcode=%s --output="%s" %s --data="%s"',zint,code,name,options or "",data))
+ logs.simple("using 'zint' to generate '%s'",base)
+ io.savedata(temp,data)
+ os.execute(format('%s --barcode=%s --output="%s" --input="%s"',zint,code,name,temp,options or ""))
end
return name
end
@@ -69,6 +73,8 @@ end
\starttext
+ \externalfigure[\cldcontext{moduledata.zint.generate("PDF417",[[Hans Hagen]])}]
+ \blank
\externalfigure[\cldcontext{moduledata.zint.generate("PDF417","Ton Otten")}]
\blank
\externalfigure[\cldcontext{moduledata.zint.generate("ISBN","9789490688011")}]