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 | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/Master/texmf-dist/tex/context/base/lpdf-xmp.lua b/Master/texmf-dist/tex/context/base/lpdf-xmp.lua index c8b2d236c62..b44c57b42aa 100644 --- a/Master/texmf-dist/tex/context/base/lpdf-xmp.lua +++ b/Master/texmf-dist/tex/context/base/lpdf-xmp.lua @@ -26,7 +26,7 @@ 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) / begin can also be "?" local xpacket = [[ <?xpacket begin="" id="%s"?> @@ -50,7 +50,7 @@ local mapping = { -- Dublin Core schema ["Author"] = "rdf:Description/dc:creator/rdf:Seq/rdf:li", ["Format"] = "rdf:Description/dc:format", -- optional, but nice to have - ["Subject"] = "rdf:Description/dc:description", + ["Subject"] = "rdf:Description/dc:description/rdf:Alt/rdf:li", ["Title"] = "rdf:Description/dc:title/rdf:Alt/rdf:li", -- XMP Basic schema ["CreateDate"] = "rdf:Description/xmp:CreateDate", @@ -91,7 +91,12 @@ local function setxmpfile(name) end codeinjections.setxmpfile = setxmpfile -commands.setxmpfile = setxmpfile + +interfaces.implement { + name = "setxmpfile", + arguments = "string", + actions = setxmpfile +} local function valid_xmp() if not xmp then @@ -105,7 +110,7 @@ local function valid_xmp() if xmpfile ~= "" then report_xmp("using file %a",xmpfile) end - local xmpdata = (xmpfile ~= "" and io.loaddata(xmpfile)) or "" + local xmpdata = xmpfile ~= "" and io.loaddata(xmpfile) or "" xmp = xml.convert(xmpdata) end return xmp @@ -157,8 +162,7 @@ local function flushxmpinfo() local producer = format("LuaTeX-%0.2f.%s",tex.luatexversion/100,tex.luatexrevision) local creator = "LuaTeX + ConTeXt MkIV" local time = lpdf.timestamp() - local fullbanner = tex.pdftexbanner - -- local fullbanner = gsub(tex.pdftexbanner,"kpse.*","") + local fullbanner = status.banner pdfaddxmpinfo("DocumentID", documentid) pdfaddxmpinfo("InstanceID", instanceid) @@ -173,7 +177,7 @@ local function flushxmpinfo() pdfaddtoinfo("Creator", creator) pdfaddtoinfo("CreationDate", time) pdfaddtoinfo("ModDate", time) --- pdfaddtoinfo("PTEX.Fullbanner", fullbanner) -- no checking done on existence + -- pdfaddtoinfo("PTEX.Fullbanner", fullbanner) -- no checking done on existence local blob = xml.tostring(xml.first(xmp or valid_xmp(),"/x:xmpmeta")) local md = pdfdictionary { |