diff options
Diffstat (limited to 'Master/texmf-dist/tex/context/base/lpdf-xmp.lua')
-rw-r--r-- | Master/texmf-dist/tex/context/base/lpdf-xmp.lua | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/Master/texmf-dist/tex/context/base/lpdf-xmp.lua b/Master/texmf-dist/tex/context/base/lpdf-xmp.lua index c9bead8a5b3..02d37342be9 100644 --- a/Master/texmf-dist/tex/context/base/lpdf-xmp.lua +++ b/Master/texmf-dist/tex/context/base/lpdf-xmp.lua @@ -10,20 +10,22 @@ if not modules then modules = { } end modules ['lpdf-xmp'] = { local format, random, char, gsub, concat = string.format, math.random, string.char, string.gsub, table.concat local xmlfillin = xml.fillin -local trace_xmp = false trackers.register("backend.xmp", function(v) trace_xmp = v end) +local trace_xmp = false trackers.register("backend.xmp", function(v) trace_xmp = v end) +local trace_info = false trackers.register("backend.info", function(v) trace_info = v end) -local report_xmp = logs.reporter("backend","xmp") +local report_xmp = logs.reporter("backend","xmp") +local report_info = logs.reporter("backend","info") local backends, lpdf = backends, lpdf -local codeinjections = backends.pdf.codeinjections -- normally it is registered +local codeinjections = backends.pdf.codeinjections -- normally it is registered -local pdfdictionary = lpdf.dictionary -local pdfconstant = lpdf.constant -local pdfreference = lpdf.reference -local pdfobject = lpdf.object +local pdfdictionary = lpdf.dictionary +local pdfconstant = lpdf.constant +local pdfreference = lpdf.reference +local pdfflushstreamobject = lpdf.flushstreamobject --- i wonder why this begin end is empty / w (no time now to look into it) +-- I wonder why this begin end is empty / w (no time now to look into it) local xpacket = [[ <?xpacket begin="" id="%s"?> @@ -122,7 +124,11 @@ local addxmpinfo = lpdf.addxmpinfo function lpdf.addtoinfo(tag,pdfvalue,strvalue) addtoinfo(tag,pdfvalue) - addxmpinfo(tag,strvalue or gsub(tostring(pdfvalue),"^%((.*)%)$","%1")) -- hack + local value = strvalue or gsub(tostring(pdfvalue),"^%((.*)%)$","%1") -- hack + if trace_info then + report_info("set '%s' to '%s'",tag,value) + end + addxmpinfo(tag,value) end -- for the do-it-yourselvers @@ -182,13 +188,7 @@ local function flushxmpinfo() if not verbose and tex.pdfcompresslevel > 0 then blob = gsub(blob,">%s+<","><") end - local r = pdfobject { - immediate = true, - compresslevel = 0, - type = "stream", - string = blob, - attr = md(), - } + local r = pdfflushstreamobject(blob,md,false) -- uncompressed lpdf.addtocatalog("Metadata",pdfreference(r)) commands.defrostrandomseed() -- hack |