summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/tex/context/base/mkiv/lpdf-wid.lua
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/tex/context/base/mkiv/lpdf-wid.lua')
-rw-r--r--Master/texmf-dist/tex/context/base/mkiv/lpdf-wid.lua40
1 files changed, 10 insertions, 30 deletions
diff --git a/Master/texmf-dist/tex/context/base/mkiv/lpdf-wid.lua b/Master/texmf-dist/tex/context/base/mkiv/lpdf-wid.lua
index a929ed2ceb9..03febbf01e2 100644
--- a/Master/texmf-dist/tex/context/base/mkiv/lpdf-wid.lua
+++ b/Master/texmf-dist/tex/context/base/mkiv/lpdf-wid.lua
@@ -11,11 +11,11 @@ if not modules then modules = { } end modules ['lpdf-wid'] = {
-- had renditions but they turned out to be unreliable from the start and look
-- obsolete too or at least they are bound to the (obsolete) flash technology for
-- rendering. They were already complex constructs. Now we have rich media which
--- instead of providing a robust future proof framework for general media types
+-- instead of providing a robust future proof framework fo rgeneral media types
-- again seems to depend on viewers built in (yes, also kind of obsolete) flash
-- technology, and we cannot expect this non-open technology to show up in open
-- browsers. So, in the end we can best just use links to external resources to be
--- future proof. Just look at the viewer preferences pane to see how fragile support
+-- future proof. Just look at the viewer prferences pane to see how fragile support
-- is. Interestingly u3d support is kind of built in, while e.g. mp4 support relies
-- on wrapping in swf. We used to stay ahead of the pack with support of the fancy
-- pdf features but it backfires and is not worth the trouble. And yes, for control
@@ -29,7 +29,7 @@ local gmatch, gsub, find, lower = string.gmatch, string.gsub, string.find, strin
local stripstring = string.strip
local settings_to_array = utilities.parsers.settings_to_array
local settings_to_hash = utilities.parsers.settings_to_hash
-local sortedhash, sortedkeys = table.sortedhash, table.sortedkeys
+local sortedhash = table.sortedhash
local report_media = logs.reporter("backend","media")
local report_attachment = logs.reporter("backend","attachment")
@@ -141,10 +141,6 @@ local attachment_symbols = {
attachment_symbols.PushPin = attachment_symbols.Pushpin
attachment_symbols.Default = attachment_symbols.Pushpin
-function lpdf.attachmentsymbols()
- return sortedkeys(comment_symbols)
-end
-
local comment_symbols = {
Comment = pdfconstant("Comment"),
Help = pdfconstant("Help"),
@@ -158,10 +154,6 @@ local comment_symbols = {
comment_symbols.NewParagraph = Newparagraph
comment_symbols.Default = Note
-function lpdf.commentsymbols()
- return sortedkeys(comment_symbols)
-end
-
local function analyzesymbol(symbol,collection)
if not symbol or symbol == "" then
return collection and collection.Default, nil
@@ -247,12 +239,10 @@ local function flushembeddedfiles()
e[#e+1] = pdfstring(tag)
e[#e+1] = reference -- already a reference
else
- -- -- messy spec ... when annot not in named else twice in menu list acrobat
+ -- messy spec ... when annot not in named else twice in menu list acrobat
end
end
- if #e > 0 then
- lpdf.addtonames("EmbeddedFiles",pdfreference(pdfflushobject(pdfdictionary{ Names = e })))
- end
+ lpdf.addtonames("EmbeddedFiles",pdfreference(pdfflushobject(pdfdictionary{ Names = e })))
end
end
@@ -267,13 +257,9 @@ function codeinjections.embedfile(specification)
local keepdir = specification.keepdir -- can change
local usedname = specification.usedname
local filetype = specification.filetype
- local compress = specification.compress
if filename == "" then
filename = nil
end
- if compress == nil then
- compress = true
- end
if data then
local r = filestreams[hash]
if r == false then
@@ -328,7 +314,7 @@ function codeinjections.embedfile(specification)
specification.data = true -- signal that still data but already flushed
else
local foundname = specification.foundname or filename
- f = pdfflushstreamfileobject(foundname,a,compress)
+ f = pdfflushstreamfileobject(foundname,a)
end
local d = pdfdictionary {
Type = pdfconstant("Filespec"),
@@ -431,8 +417,7 @@ function codeinjections.attachmentid(filename) -- not used in context
return filestreams[filename]
end
-local nofcomments = 0
-local usepopupcomments = false
+local nofcomments, usepopupcomments = 0, false
local defaultattributes = {
["xmlns"] = "http://www.w3.org/1999/xhtml",
@@ -627,8 +612,7 @@ local function insertrendering(specification)
local option = settings_to_hash(specification.option)
if not mf[label] then
local filename = specification.filename
- local isurl = find(filename,"://",1,true)
- local mimetype = specification.mimetype or specification.mime
+ local isurl = find(filename,"://",1,true)
-- local start = pdfdictionary {
-- Type = pdfconstant("MediaOffset"),
-- S = pdfconstant("T"), -- time
@@ -664,17 +648,13 @@ local function insertrendering(specification)
if isurl then
descriptor.FS = pdfconstant("URL")
elseif option[v_embed] then
- descriptor.EF = codeinjections.embedfile {
- file = filename,
- mimetype = mimetype, -- yes or no
- compress = false,
- }
+ descriptor.EF = codeinjections.embedfile { file = filename }
end
local clip = pdfdictionary {
Type = pdfconstant("MediaClip"),
S = pdfconstant("MCD"),
N = label,
- CT = mimetype,
+ CT = specification.mime,
Alt = pdfarray { "", "file not found" }, -- language id + message
D = pdfreference(pdfflushobject(descriptor)),
-- P = pdfreference(pdfflushobject(parameters)),