diff options
author | Hans Hagen <pragma@wxs.nl> | 2018-11-18 16:12:36 +0100 |
---|---|---|
committer | Context Git Mirror Bot <phg@phi-gamma.net> | 2018-11-18 16:12:36 +0100 |
commit | 744095aa4676553437db0d71c281a74557a3222f (patch) | |
tree | bfdf5d203b5fbfa44ee7db705d3b3475361ad28f /tex/context/base/mkiv/lpdf-epa.lua | |
parent | e2ee706a3114129601a30908d6b8cbb57068d32c (diff) | |
download | context-744095aa4676553437db0d71c281a74557a3222f.tar.gz |
2018-11-18 14:16:00
Diffstat (limited to 'tex/context/base/mkiv/lpdf-epa.lua')
-rw-r--r-- | tex/context/base/mkiv/lpdf-epa.lua | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/tex/context/base/mkiv/lpdf-epa.lua b/tex/context/base/mkiv/lpdf-epa.lua index 9c4444181..570d73881 100644 --- a/tex/context/base/mkiv/lpdf-epa.lua +++ b/tex/context/base/mkiv/lpdf-epa.lua @@ -52,6 +52,9 @@ local pdfcopyinteger = lpdf.copyinteger local pdfcopystring = lpdf.copystring local pdfcopyconstant = lpdf.copyconstant +local createimage = images.create +local embedimage = images.embed + local hpack_node = nodes.hpack local loadpdffile = lpdf.epdf.load @@ -74,13 +77,7 @@ local layerspec = { -- predefining saves time "epdfcontent" } --- can change: - -local pdfgetpos = lpdf.getpos - -updaters.register("backend.update",function() - pdfgetpos = lpdf.getpos -end) +local getpos = function() getpos = backends.codeinjections.getpos return getpos () end local collected = allocate() local tobesaved = allocate() @@ -807,8 +804,13 @@ function codeinjections.mergefields(specification) -- direct local AP = annotation.AP or (parent and parent.AP) if AP then - local im = img.new { filename = fullname } - AP = img.immediatewriteobject(im,document.__xrefs__[AP]) + local a = document.__xrefs__[AP] + if a and pdfe.copyappearance then + local o = pdfe.copyappearance(document,a) + if o then + AP = pdfreference(o) + end + end end local dictionary = pdfdictionary { Subtype = pdfconstant("Widget"), |