diff options
author | Hans Hagen <pragma@wxs.nl> | 2018-02-06 20:42:35 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg42.2a@gmail.com> | 2018-02-06 20:42:35 +0100 |
commit | 1687077b0a63417ad4dce58f6c869a6e115d9b72 (patch) | |
tree | ec1d4ac5ea55b732c13c12c0c0e67739afa93ef8 /tex/context/base/mkiv/lpdf-ini.lua | |
parent | 7ce2f30f31421eb46d07ff65cbf9fcbda1d6612a (diff) | |
download | context-1687077b0a63417ad4dce58f6c869a6e115d9b72.tar.gz |
2018-02-06 18:19:00
Diffstat (limited to 'tex/context/base/mkiv/lpdf-ini.lua')
-rw-r--r-- | tex/context/base/mkiv/lpdf-ini.lua | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/tex/context/base/mkiv/lpdf-ini.lua b/tex/context/base/mkiv/lpdf-ini.lua index e197e201f..f8cff2032 100644 --- a/tex/context/base/mkiv/lpdf-ini.lua +++ b/tex/context/base/mkiv/lpdf-ini.lua @@ -122,6 +122,8 @@ backends.pdf = pdfbackend lpdf = lpdf or { } local lpdf = lpdf +lpdf.flags = lpdf.flags or { } -- will be filled later + do local setmajorversion = pdf.setmajorversion @@ -1336,3 +1338,63 @@ implement { name = "lpdf_adddocumentcolorspace", arguments = two_strings, action implement { name = "lpdf_adddocumentpattern", arguments = two_strings, actions = function(a,b) lpdf.adddocumentpattern (a,pdfverbose(b)) end } implement { name = "lpdf_adddocumentshade", arguments = two_strings, actions = function(a,b) lpdf.adddocumentshade (a,pdfverbose(b)) end } +-- more helpers: copy from lepd to lpdf + +function lpdf.copyconstant(v) + if v ~= nil then + return pdfconstant(v) + end +end + +function lpdf.copyboolean(v) + if v ~= nil then + return pdfboolean(v) + end +end + +function lpdf.copyunicode(v) + if v then + return pdfunicode(v) + end +end + +function lpdf.copyarray(a) + if a then + local t = pdfarray() + local k = a.__kind + for i=1,#a do + t[i] = a(i) + end +-- inspect(t) + return t + end +end + +function lpdf.copydictionary(d) + if d then + local t = pdfdictionary() + for k, v in next, d do + t[k] = d(k) + end +-- inspect(t) + return t + end +end + +function lpdf.copynumber(v) + return v +end + +function lpdf.copyinteger(v) + return v -- maybe checking or round ? +end + +function lpdf.copyfloat(v) + return v +end + +function lpdf.copystring(v) + if v then + return pdfstring(v) + end +end |