[NTG-context] attachment attaches twice - the fix was minimal

Michail Vidiassov master at iaas.msu.ru
Fri Apr 29 09:24:14 CEST 2011

Dear Hans,

when you fixed the bug with attachment being listed twice
in the attachment list, you also enhanced attachment support

On Mon, 28 Feb 2011, Hans Hagen wrote:

> as far as i can see there were a couple of issues: 
> attachments without associated annotation, and labeling and both are covered, 
> but using the same command and extra keys/values ...

as far as I understand, "attachments without associated annotation" are
called "hidden" in ConTeXt, as in

\attachment[test][file=att.tex,title=Oeps,author=Hans,subtitle=TeX File,method=hidden]

But that does not work and, as far as I can see from the current beta code, 
is not supposed to. For example, in lpdf-wid.lua we have

local function flushembeddedfiles()
     if next(filestreams) then
         local e = pdfarray()
         for tag, reference in next, filestreams do
             if not reference then
                 report_attachment("unreferenced file: tag '%s'",tag)
             elseif referenced[name] == "hidden" then
                 e[#e+1] = pdfstring(tag)
                 e[#e+1] = reference -- already a reference
                 -- messy spec ... when annot not in named else twice in menu list acrobat

lpdf.addtonames("EmbeddedFiles",pdfreference(pdfflushobject(pdfdictionary{ Names = e })))

Note the "referenced[name]" part, while there is no "name" variable.

It seems the working code did not find its way into released version
and some draft got shipped.

           Sincerely, Michail

More information about the ntg-context mailing list