summaryrefslogtreecommitdiff
path: root/tex/context/base/lpdf-ren.lua
diff options
context:
space:
mode:
Diffstat (limited to 'tex/context/base/lpdf-ren.lua')
-rw-r--r--tex/context/base/lpdf-ren.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/tex/context/base/lpdf-ren.lua b/tex/context/base/lpdf-ren.lua
index 2fc1bf23c..742d42273 100644
--- a/tex/context/base/lpdf-ren.lua
+++ b/tex/context/base/lpdf-ren.lua
@@ -59,17 +59,22 @@ local textlayers, hidelayers, videlayers = pdfarray(), pdfarray(), pdfarray()
local pagelayers, pagelayersreference, cache = nil, nil, { }
local specifications = { }
+local initialized = { }
function codeinjections.defineviewerlayer(specification)
if viewerlayers.supported and textlayers then
- specifications[specification.tag] = specification
+ local tag = specification.tag
+ if not specifications[tag] then
+ specifications[tag] = specification
+ end
end
end
local function useviewerlayer(name)
local specification = specifications[name]
- if specification then
+ if not environment.initex and specification and not initialized[name] then
specifications[name] = nil -- or not
+ initialized [name] = true
if not pagelayers then
pagelayers = pdfdictionary()
pagelayersreference = pdfreserveobject()