diff options
author | Hans Hagen <pragma@wxs.nl> | 2022-03-12 18:45:40 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2022-03-12 18:45:40 +0100 |
commit | 188632f4b0f71c5170a20f1b151bde68f603bfd9 (patch) | |
tree | 49a5a917a1ce6f17cbb6f542dff5b8254cd74c70 /tex/context/base/mkxl/lpdf-xmp.lmt | |
parent | b7a7de31716616b7a5176259e2b60349f8089615 (diff) | |
download | context-188632f4b0f71c5170a20f1b151bde68f603bfd9.tar.gz |
2022-03-12 11:26:00
Diffstat (limited to 'tex/context/base/mkxl/lpdf-xmp.lmt')
-rw-r--r-- | tex/context/base/mkxl/lpdf-xmp.lmt | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tex/context/base/mkxl/lpdf-xmp.lmt b/tex/context/base/mkxl/lpdf-xmp.lmt index c4f475914..e147c796f 100644 --- a/tex/context/base/mkxl/lpdf-xmp.lmt +++ b/tex/context/base/mkxl/lpdf-xmp.lmt @@ -64,10 +64,11 @@ local mapping = table.setmetatableindex ( { ["Producer"] = { "metadata","rdf:Description/pdf:Producer" }, -- ["Trapped"] = { "pdf", "rdf:Description/pdf:Trapped" }, -- '/False' in /Info, but 'False' in XMP -- Dublin Core schema - ["Author"] = { "metadata","rdf:Description/dc:creator/rdf:Seq/rdf:li" }, ["Format"] = { "metadata","rdf:Description/dc:format" }, -- optional, but nice to have - ["Subject"] = { "metadata","rdf:Description/dc:description/rdf:Alt/rdf:li" }, - ["Title"] = { "metadata","rdf:Description/dc:title/rdf:Alt/rdf:li" }, + -- These were dc:.../rdf:Seq/rdf:li but there was a (invalidating) bug in the iso + ["Author"] = { "metadata","rdf:Description/dc:creator" }, + ["Subject"] = { "metadata","rdf:Description/dc:description" }, + ["Title"] = { "metadata","rdf:Description/dc:title" }, -- XMP Basic schema ["CreateDate"] = { "date", "rdf:Description/xmp:CreateDate" }, ["CreationDate"] = { "date", "rdf:Description/xmp:CreationDate" }, -- dummy @@ -254,11 +255,11 @@ local pdfaddxmpinfo = lpdf.addxmpinfo function lpdf.addtoinfo(tag,pdfvalue,strvalue) local pattern = mapping[tag][2] - if pattern then + if pattern or strvalue == true then pdfaddtoinfo(tag,pdfvalue) end if type(pattern) == "string" then - local value = strvalue or gsub(tostring(pdfvalue),"^%((.*)%)$","%1") -- hack + local value = (type(strvalue) == "string" and strvalue) or gsub(tostring(pdfvalue),"^%((.*)%)$","%1") -- hack if trace_info then report_info("set %a to %a",tag,value) end |