ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* attachment attaches twice
@ 2011-02-20  7:54 Reviczky, Adam
  2011-02-20  9:40 ` Michail Vidiassov
  0 siblings, 1 reply; 16+ messages in thread
From: Reviczky, Adam @ 2011-02-20  7:54 UTC (permalink / raw)
  To: ntg-context

[-- Attachment #1: Type: text/plain, Size: 1034 bytes --]

Hi

I'm trying to use PDF attachments again, but run into some issues.
Here's my small example (att.tex):
%%% start %%%
\setupinteraction[state=start]

\starttext
\useattachment[myfile][title][name][att.tex]
\attachment[myfile]
\stoptext
%%% end %%%

1) Using context-current makes 1 attachment, whereas context beta makes 2 attachments (page + attachments tab?).
I've attached the two generated PDFs. I guess the "attachments tab" attachment is not intended.

2) The third parameter should give a custom name for the attachment, and I recall this from old times (maybe mkii) to behave like that, though I can't reproduce this now. Is this broken (as it has no effect right now)?

3) I want to have some attachments (source code) from a url, can this be added to behave like \externalfigure?
I want to use it like this: "\useattachment[myfile][title][name][http://git.example.com/master/att.tex]"
Right now that just attaches an "Unknown" (maybe shortcut) but it cannot be viewed/opened or saved.

Thanks
Adam

[-- Attachment #2: att_20100730.pdf --]
[-- Type: application/pdf, Size: 4846 bytes --]

[-- Attachment #3: att_20110218.pdf --]
[-- Type: application/pdf, Size: 4794 bytes --]

[-- Attachment #4: Type: text/plain, Size: 486 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: attachment attaches twice
  2011-02-20  7:54 attachment attaches twice Reviczky, Adam
@ 2011-02-20  9:40 ` Michail Vidiassov
  2011-02-20 22:21   ` attachment attaches twice - more research Michail Vidiassov
  0 siblings, 1 reply; 16+ messages in thread
From: Michail Vidiassov @ 2011-02-20  9:40 UTC (permalink / raw)
  To: mailing list for ConTeXt users

Dear All,

to be precise, the attachment is attached once
(can be seen if one inspects the sample PDF files in uncompressed form with 
any text or binary editor - if you do not have Adobe Acrobat), but is 
listed twice by Adobe Reader.

       Sincerely, Michail




___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: attachment attaches twice - more research
  2011-02-20  9:40 ` Michail Vidiassov
@ 2011-02-20 22:21   ` Michail Vidiassov
  2011-02-21  0:11     ` Hans Hagen
  0 siblings, 1 reply; 16+ messages in thread
From: Michail Vidiassov @ 2011-02-20 22:21 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1498 bytes --]

Dear Developers,

On Sun, 20 Feb 2011, Michail Vidiassov wrote:

> to be precise, the attachment is attached once
> but is listed twice by Adobe Reader.

PDF spec states
----------
An embedded file stream shall be included in a PDF document in one of the 
following ways:
•	Any file specification dictionary in the document may have an EF 
entry that specifies an embedded file stream. The stream data shall still 
be associated with a location in the file system. In particular, this 
method shall be used for file attachment annotations (see 12.5.6.15, "File 
Attachment Annotations"), which associate the embedded file with a location 
on a page in the document.
•	Embedded file streams may be associated with the document as a 
whole through the EmbeddedFiles entry (PDF 1.4) in the PDF document’s name 
dictionary (see 7.7.4, "Name Dictionary"). The associated name tree shall 
map name strings to file specifications that refer to embedded file streams 
through their EF entries.
----------

while code in lpdf-wid.lua sends everything to EmbeddedFiles - including 
files associated "with a location on a page in the document" as in the 
examples in the originator's post.

For example http://www.microtype.com/showcase/EmbedFiles.pdf
has it done correctly, EmbeddedFiles refers only to that embedded files 
that are not linked to particular icons on pages.

          Sincerely, Michail

PS. did not experiment with patching lpdf-wid.lua myself yet...

[-- Attachment #2: Type: text/plain, Size: 486 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: attachment attaches twice - more research
  2011-02-20 22:21   ` attachment attaches twice - more research Michail Vidiassov
@ 2011-02-21  0:11     ` Hans Hagen
  2011-02-21  5:49       ` attachment attaches twice - please, do not fix by trimming Michail Vidiassov
                         ` (3 more replies)
  0 siblings, 4 replies; 16+ messages in thread
From: Hans Hagen @ 2011-02-21  0:11 UTC (permalink / raw)
  To: mailing list for ConTeXt users

On 20-2-2011 11:21, Michail Vidiassov wrote:
> Dear Developers,
>
> On Sun, 20 Feb 2011, Michail Vidiassov wrote:
>
>> to be precise, the attachment is attached once
>> but is listed twice by Adobe Reader.
>
> PDF spec states
> ----------
> An embedded file stream shall be included in a PDF document in one of
> the following ways:
> • Any file specification dictionary in the document may have an EF entry
> that specifies an embedded file stream. The stream data shall still be
> associated with a location in the file system. In particular, this
> method shall be used for file attachment annotations (see 12.5.6.15,
> "File Attachment Annotations"), which associate the embedded file with a
> location on a page in the document.
> • Embedded file streams may be associated with the document as a whole
> through the EmbeddedFiles entry (PDF 1.4) in the PDF document’s name
> dictionary (see 7.7.4, "Name Dictionary"). The associated name tree
> shall map name strings to file specifications that refer to embedded
> file streams through their EF entries.
> ----------
>
> while code in lpdf-wid.lua sends everything to EmbeddedFiles - including
> files associated "with a location on a page in the document" as in the
> examples in the originator's post.

i'll patch lpdf-wid but somehow I get the impression that it's more a 
viewer issue (the list shown seems to be a merge of filename as well as 
symbolic names while a clever list builder should look at the referred 
objects) ... but maybe no one else usesvdifferent symbolic names (we had 
similar issues with fields in the past and even now advanced field 
support is somewhat bugged one or the other way, depending on the viewer 
version, esp chained ones)

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: attachment attaches twice - please, do not fix by trimming
  2011-02-21  0:11     ` Hans Hagen
@ 2011-02-21  5:49       ` Michail Vidiassov
  2011-02-22  5:25       ` \useattachment: Embedding files in PDFs - was "attachment attaches twice - more research" Michail Vidiassov
                         ` (2 subsequent siblings)
  3 siblings, 0 replies; 16+ messages in thread
From: Michail Vidiassov @ 2011-02-21  5:49 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users

Dear Hans,

On Mon, 21 Feb 2011, Hans Hagen wrote:

>>> to be precise, the attachment is attached once
>>> but is listed twice by Adobe Reader.
>> 
>> code in lpdf-wid.lua sends everything to EmbeddedFiles - including
>> files associated "with a location on a page in the document" 
>
> i'll patch lpdf-wid

it'd be nice to not only fix icon-linked attachments (current 
functionality), but to also allow to create document-level attachments
not linked to icons - not that I see any particular use for that just now,
but since functionality is already there (but misused) it'd be a pity to 
just drop it.

       Sincerely, Michail


___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: \useattachment: Embedding files in PDFs - was "attachment attaches twice - more research"
  2011-02-21  0:11     ` Hans Hagen
  2011-02-21  5:49       ` attachment attaches twice - please, do not fix by trimming Michail Vidiassov
@ 2011-02-22  5:25       ` Michail Vidiassov
  2011-02-23 10:21       ` attachment attaches twice - more research Michail Vidiassov
  2011-02-28  7:52       ` attachment attaches twice - the fix was minimal Michail Vidiassov
  3 siblings, 0 replies; 16+ messages in thread
From: Michail Vidiassov @ 2011-02-22  5:25 UTC (permalink / raw)
  To: mailing list for ConTeXt users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1707 bytes --]

Dear Hans,

I'd like to remind you about an old problem report
------
From: Tobias Burnus
Date: 2008-01-04 16:01 +300

I can use \useattachment to embed/attach files in a PDF file. I can use:

\useattachment[whatever][title][newname][test.tex]
\attachment[whatever]

This creates an attachment with the description "title" and the name
"test.tex". However, how can I set the author/subject? (Shown in tool
tip of the annotation symbol; it is shown above the description;
actually subject is enough for me.)

Additionally, I miss the file size and possibly the modification date
for the attachments; they are often handy to have.

Is is possible to associate an embedded file stream with the document
itself without creating an annotation symbol as with \attachment in
ConTeXt? (The PDF spec allows this; cf. e.g. 3.10.3 in the PDF spec and
http://www.microtype.com/showcase/EmbedFiles.pdf for an example PDF file.)

-------

what he names "author/subject" is the "T" entry in annotation dictionary 
(the same where /Subtype /FileAttachment goes), that is described as
"The text label that shall be displayed in the title bar of the 
annotation’s pop-up window when open and active. This entry shall identify the user who 
added the annotation."
It appears as the upper of the two lines that are shown when the mouse 
pointer is over file attachment annotation icon (the lower one is the 
description mentioned above).

And for "file size and modification date" to show up file stream has to 
look like
8 0 obj<< /Params << /ModDate (20050217) /Size 2048>> /Length 1218>>stream
not just
15 0 obj<< /Length 144>>stream
as it is now.

        Sincerely, Michail


[-- Attachment #2: Type: text/plain, Size: 486 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: attachment attaches twice - more research
  2011-02-21  0:11     ` Hans Hagen
  2011-02-21  5:49       ` attachment attaches twice - please, do not fix by trimming Michail Vidiassov
  2011-02-22  5:25       ` \useattachment: Embedding files in PDFs - was "attachment attaches twice - more research" Michail Vidiassov
@ 2011-02-23 10:21       ` Michail Vidiassov
  2011-02-23 10:46         ` Hans Hagen
  2011-02-28  7:52       ` attachment attaches twice - the fix was minimal Michail Vidiassov
  3 siblings, 1 reply; 16+ messages in thread
From: Michail Vidiassov @ 2011-02-23 10:21 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1389 bytes --]

Dear Hans,

On Mon, 21 Feb 2011, Hans Hagen wrote:

> i'll patch lpdf-wid but somehow I get the impression that it's more a viewer 
> issue (the list shown seems to be a merge of filename as well as symbolic 
> names while a clever list builder should look at the referred objects) ... 
> but maybe no one else usesvdifferent symbolic names (we had similar issues 
> with fields in the past and even now advanced field support is somewhat 
> bugged one or the other way, depending on the viewer version, esp chained 
> ones)

to say the truth I do not understand what are you talking about :(
The issues I have in mind - separating global attachments and attachments 
linked to icons on pages, additional descriptions for attached files -
are addressed in the attached patches.
I am not sure about using attachment lebel as "T" key, that is indended for 
following:
The text label that shall be displayed in the title bar of the annotation’s 
pop-up window when open and active. This entry shall identify the user who 
added the annotation.
and shows as the upper line when mouse pointer is above attachment icon.
Did not try to have file size and time information added to file stream -
but it'd be nice to have.

         Sincerely, Michail
PS. Patches show what I want done, not how it is to be done.
Just hope that my lua may be more clear than my English.

[-- Attachment #2: Type: TEXT/PLAIN, Size: 337 bytes --]

--- back-ini.lua.org	2011-02-16 01:53:17.000000000 +0300
+++ back-ini.lua	2011-02-23 09:17:50.000000000 +0300
@@ -67,6 +67,7 @@
     registercomment        = nothing,
 
     embedfile              = nothing,
+    globattachfile         = nothing,
     attachfile             = nothing,
     attachmentid           = nothing,
 

[-- Attachment #3: Type: TEXT/PLAIN, Size: 939 bytes --]

--- scrn-int.mkiv.org	2011-01-31 13:26:23.000000000 +0300
+++ scrn-int.mkiv	2011-02-23 12:34:22.000000000 +0300
@@ -405,6 +405,25 @@
 % % \setupattachments[\c!symbol={symbol-normal,symbol-down}]
 %
 % \starttext \attachment[whatever] \stoptext
+%
+% \globattachment[test.tex]
+% \globattachment[description][test.tex]
+% \globattachment[description][newname.tex][test.tex]
+
+\def\globattachment
+  {\dotripleempty\doglobattachment}
+
+\def\doglobattachment[#1][#2][#3]% description newfilename filename
+  {\ifthirdargument
+     \dodoglobattachment{#1}{#2}{#3}%
+   \else\ifsecondargument
+     \dodoglobattachment{#1}{}{#2}%
+   \else
+     \dodoglobattachment{}{}{#1}%
+   \fi\fi}
+
+\def\dodoglobattachment#1#2#3% description newfilename filename
+  {\ctxlua{backends.codeinjections.globattachfile{description="#1",newname="#2",filename="#3"}}}
 
 \def\useattachment
   {\doquadrupleempty\douseattachment}

[-- Attachment #4: Type: TEXT/PLAIN, Size: 2381 bytes --]

--- lpdf-wid.lua.org	2011-02-08 22:41:44.000000000 +0300
+++ lpdf-wid.lua	2011-02-23 12:27:53.000000000 +0300
@@ -160,14 +160,14 @@
 
 --
 
-local nofattachments, attachments, filestreams = 0, { }, { }
+local nofattachments, attachments, filestreams, globfilestreams = 0, { }, { }, { }
 
 -- todo: hash and embed once
 
 local function flushembeddedfiles()
-    if next(filestreams) then
+    if next(globfilestreams) then
         local e = pdfarray()
-        for name, reference in next, filestreams do
+        for name, reference in next, globfilestreams do
             if reference then
                 e[#e+1] = pdfstring(name)
                 e[#e+1] = reference -- already a reference
@@ -181,7 +181,7 @@
 
 lpdf.registerdocumentfinalizer(flushembeddedfiles,"embeddedfiles")
 
-function codeinjections.embedfile(filename)
+function codeinjections.embedfile(filename,newname,description)
     local r = filestreams[filename]
     if r == false then
         return nil
@@ -201,12 +201,28 @@
             UF   = pdfstring(newname or basename),
             EF   = pdfdictionary { F = pdfreference(f) },
         }
+        if description then
+            d["Desc"] = pdfstring(description)
+        end
         local r = pdfreference(pdfflushobject(d))
         filestreams[filename] = r
         return r
     end
 end
 
+function codeinjections.globattachfile(specification)
+    local filename = specification.filename
+    if not filename or filename == "" then
+        -- todo: message
+        return
+    end
+    local description = specification.description or ""
+    local newname = specification.newname or ""
+    if description == "" then description = nil end
+    if newname == "" then newname = nil end
+    globfilestreams[filename] = codeinjections.embedfile(filename,newname,description)
+end
+
 function codeinjections.attachfile(specification)
     local attachment = interactions.attachments.attachment(specification.label)
     if not attachment then
@@ -239,6 +255,7 @@
         AP       = appearance,
         OC       = analyzelayer(specification.layer),
         C        = pdfcolorspec(specification.colormodel,specification.colorvalue),
+        T        = pdfstring(label),
     }
     -- as soon as we can ask for the dimensions of an xform we can
     -- use them here

[-- Attachment #5: Type: text/plain, Size: 486 bytes --]

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: attachment attaches twice - more research
  2011-02-23 10:21       ` attachment attaches twice - more research Michail Vidiassov
@ 2011-02-23 10:46         ` Hans Hagen
  2011-02-23 11:35           ` Michail Vidiassov
  0 siblings, 1 reply; 16+ messages in thread
From: Hans Hagen @ 2011-02-23 10:46 UTC (permalink / raw)
  To: Michail Vidiassov; +Cc: mailing list for ConTeXt users

On 23-2-2011 11:21, Michail Vidiassov wrote:

> to say the truth I do not understand what are you talking about :(

Attachments have some history in pdf and each version was slightly 
different. The same is true for widgets. Some of that has to do with 
security issues, some with the fact that acrobat editing interfaces 
always lag behind new features, etc. I gave up on advanced stuff when I 
noticed that custom visualizations had changed again. I'll have look at 
it but not this week (away for a few days). I also need to it with Luigi 
as he often has torture tests laying around. We also need to keep the 
a/x standards in mind.

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: attachment attaches twice - more research
  2011-02-23 10:46         ` Hans Hagen
@ 2011-02-23 11:35           ` Michail Vidiassov
  2011-02-26 23:22             ` Hans Hagen
  0 siblings, 1 reply; 16+ messages in thread
From: Michail Vidiassov @ 2011-02-23 11:35 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users

Dear Hans,

On Wed, 23 Feb 2011, Hans Hagen wrote:

> Attachments have some history in pdf and each version was slightly different.

as far as I understand ConTeXt now can not link file attachment to 
arbitrary picture, just to some predefined icons. Am I right?
Is it going  to change? Soon? There are comments in the code about
lack of measurement support for XForm - is that the issue and what
that issue is?
I have already met that complaints in 3D Annotations support code.
BTW, I am interested in FileAttachment  Annotations as a way to
work with 3D models. With LaTeX the main PDF file may contain a 2D picture,
that can be displayed in any PDF viewer, but if you click on it in Adobe 
viewer attached PDF file opens with 3D model in it. That attached file may 
be produced by some third-party tool, since often such tools output not 
just 3D model fit for including in PDF, but a one-page PDF with the 3D 
model, complex JavaScript to control it (for example to animate it) and 
some intarctive text related to the model.

  Sincerely, Michail

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: attachment attaches twice - more research
  2011-02-23 11:35           ` Michail Vidiassov
@ 2011-02-26 23:22             ` Hans Hagen
  0 siblings, 0 replies; 16+ messages in thread
From: Hans Hagen @ 2011-02-26 23:22 UTC (permalink / raw)
  To: Michail Vidiassov; +Cc: mailing list for ConTeXt users

On 23-2-2011 12:35, Michail Vidiassov wrote:

> as far as I understand ConTeXt now can not link file attachment to
> arbitrary picture, just to some predefined icons. Am I right?

you can use symbols (as with fields and other widgets)

> Is it going to change? Soon? There are comments in the code about
> lack of measurement support for XForm - is that the issue and what
> that issue is?

unrelated, more a dev note

> I have already met that complaints in 3D Annotations support code.
> BTW, I am interested in FileAttachment Annotations as a way to
> work with 3D models. With LaTeX the main PDF file may contain a 2D picture,
> that can be displayed in any PDF viewer, but if you click on it in Adobe
> viewer attached PDF file opens with 3D model in it. That attached file
> may be produced by some third-party tool, since often such tools output
> not just 3D model fit for including in PDF, but a one-page PDF with the
> 3D model, complex JavaScript to control it (for example to animate it)
> and some intarctive text related to the model.

I'm not sure what you mean here. There is some u3d and shockwave 
support. (I added u3d because someone asked it but the requester never 
tested it). Anyhow, these features are only extended when we (luigi and 
me) get proper public test files

Concerning attachments, the next beta will have a new definition model 
with inheritance but the \use.. method is still there as well.

The hidden method will not place an annotation. Definition is not really 
needed, so a direct \attachment works ok, but a bit of abstraction 
(separation between definition and use) does not hurt

% old but stil valid method (consistent with other \use):
%
% \useattachment[test.tex]
% \useattachment[whatever][test.tex]
% \useattachment[whatever][newname][test.tex]
% \useattachment[whatever][title][newname][test.tex]
%
% new method:
%
% \attachment[test.tex]
% \attachment[whatever1][file=test.tex]
% \attachment[whatever2][file=test.tex,method=hidden]
% \attachment[whatever3][name=newname,file=test.tex]
% \attachment[whatever4][title=mytitle,name=newname,file=test.tex]
%
% indirect
%
% \defineattachment[whatever5][file=test.tex] 
\attachment[whatever5][method=hidden]
% \defineattachment[whatever5][file=test.tex,method=hidden] 
\attachment[whatever5]
%
% direct (no definitions)
%
% \attachment[test][file=oeps.tex,title=Oeps,author=Hans,subtitle=TeX 
File,method=hidden]
% 
\attachment[label=test,file=oeps.tex,title=Oeps,author=Hans,subtitle=TeX 
File,method=hidden]
%
% autolabel:
%
% \attachment[file=oeps.tex,title=Oeps,author=Hans,subtitle=TeX 
File,method=hidden]
%
% % \setupattachments[\c!symbol={symbol-normal,symbol-down}]

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: attachment attaches twice - the fix was minimal
  2011-02-21  0:11     ` Hans Hagen
                         ` (2 preceding siblings ...)
  2011-02-23 10:21       ` attachment attaches twice - more research Michail Vidiassov
@ 2011-02-28  7:52       ` Michail Vidiassov
  2011-02-28  8:46         ` Hans Hagen
  3 siblings, 1 reply; 16+ messages in thread
From: Michail Vidiassov @ 2011-02-28  7:52 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users

Dear Hans,

On Mon, 21 Feb 2011, Hans Hagen wrote:

>>> to be precise, the attachment is attached once
>>> but is listed twice by Adobe Reader.
>
> i'll patch lpdf-wid

on one hand your patch fixes the bug that is in the Subj. of the 
thread, but it does just that and nothing more. It is a pity
to see the opportunity to enhance attachments support wasted.
It'd likely be a long time before you revisit the issue :(

        Sincerely, Michail

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: attachment attaches twice - the fix was minimal
  2011-02-28  7:52       ` attachment attaches twice - the fix was minimal Michail Vidiassov
@ 2011-02-28  8:46         ` Hans Hagen
  2011-02-28  9:24           ` attachment attaches twice - the fix was minimal (?) Michail Vidiassov
  2011-04-29  7:24           ` attachment attaches twice - the fix was minimal Michail Vidiassov
  0 siblings, 2 replies; 16+ messages in thread
From: Hans Hagen @ 2011-02-28  8:46 UTC (permalink / raw)
  To: Michail Vidiassov; +Cc: mailing list for ConTeXt users

On 28-2-2011 8:52, Michail Vidiassov wrote:
> Dear Hans,
>
> On Mon, 21 Feb 2011, Hans Hagen wrote:
>
>>>> to be precise, the attachment is attached once
>>>> but is listed twice by Adobe Reader.
>>
>> i'll patch lpdf-wid
>
> on one hand your patch fixes the bug that is in the Subj. of the thread,
> but it does just that and nothing more. It is a pity
> to see the opportunity to enhance attachments support wasted.
> It'd likely be a long time before you revisit the issue :(

this is a bit of a weird comment given that i haven't uploaded anything 
that you can comment on; 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 ...

Hans

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: attachment attaches twice - the fix was minimal (?)
  2011-02-28  8:46         ` Hans Hagen
@ 2011-02-28  9:24           ` Michail Vidiassov
  2011-02-28  9:57             ` Hans Hagen
  2011-04-29  7:24           ` attachment attaches twice - the fix was minimal Michail Vidiassov
  1 sibling, 1 reply; 16+ messages in thread
From: Michail Vidiassov @ 2011-02-28  9:24 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users

Dear Hans,

On Mon, 28 Feb 2011, Hans Hagen wrote:

>>>>> to be precise, the attachment is attached once
>>>>> but is listed twice by Adobe Reader.
>>> i'll patch lpdf-wid
>> on one hand your patch fixes the bug that is in the Subj. of the thread,
>
> this is a bit of a weird comment given that i haven't uploaded anything that 
> you can comment on; 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 ...

sorry for being so dumb,
but on one hand you "haven't uploaded anything",
on the other "there were a couple of issues" that "are covered" by now,
and on the third one first-setup.sh brought me this morning lpdf-wid.lua
that now has 
---
local ignorereferenced = true -- fuzzy pdf spec .. twice in attachment list, can become an option
---
etc. - that change caused my comment.

On the positive side - ConTeXt internals are your internal affairs,
you are more sovereign than some kings and revolution leaders ;)
Just tell us what that user-level "extra keys/values" are and we'll sing, 
dance and rejoice, being innocent of knowing what only the ConTeXt creator is to know.

       Sincerely, Michail
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: attachment attaches twice - the fix was minimal (?)
  2011-02-28  9:24           ` attachment attaches twice - the fix was minimal (?) Michail Vidiassov
@ 2011-02-28  9:57             ` Hans Hagen
  0 siblings, 0 replies; 16+ messages in thread
From: Hans Hagen @ 2011-02-28  9:57 UTC (permalink / raw)
  To: Michail Vidiassov; +Cc: mailing list for ConTeXt users

On 28-2-2011 10:24, Michail Vidiassov wrote:

> Just tell us what that user-level "extra keys/values" are and we'll
> sing, dance and rejoice, being innocent of knowing what only the ConTeXt
> creator is to know.

i posted those keys in a previous mail ... but there is no beta upload 
yet (will be later this week)

-----------------------------------------------------------------
                                           Hans Hagen | PRAGMA ADE
               Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                              | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: attachment attaches twice - the fix was minimal
  2011-02-28  8:46         ` Hans Hagen
  2011-02-28  9:24           ` attachment attaches twice - the fix was minimal (?) Michail Vidiassov
@ 2011-04-29  7:24           ` Michail Vidiassov
  1 sibling, 0 replies; 16+ messages in thread
From: Michail Vidiassov @ 2011-04-29  7:24 UTC (permalink / raw)
  To: Hans Hagen; +Cc: mailing list for ConTeXt users

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
             else
                 -- messy spec ... when annot not in named else twice in menu list acrobat
             end
         end

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

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

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 16+ messages in thread

* Re: attachment attaches twice
@ 2011-02-20 19:47 Reviczky, Adam
  0 siblings, 0 replies; 16+ messages in thread
From: Reviczky, Adam @ 2011-02-20 19:47 UTC (permalink / raw)
  To: mailing list for ConTeXt users

> to be precise, the attachment is attached once
> (can be seen if one inspects the sample PDF files in uncompressed form with 
> any text or binary editor - if you do not have Adobe Acrobat), but is 
> listed twice by Adobe Reader.
Thanks, but the question is still why the beta produces this while it is fine with the current.

Adam
___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________


^ permalink raw reply	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2011-04-29  7:24 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-20  7:54 attachment attaches twice Reviczky, Adam
2011-02-20  9:40 ` Michail Vidiassov
2011-02-20 22:21   ` attachment attaches twice - more research Michail Vidiassov
2011-02-21  0:11     ` Hans Hagen
2011-02-21  5:49       ` attachment attaches twice - please, do not fix by trimming Michail Vidiassov
2011-02-22  5:25       ` \useattachment: Embedding files in PDFs - was "attachment attaches twice - more research" Michail Vidiassov
2011-02-23 10:21       ` attachment attaches twice - more research Michail Vidiassov
2011-02-23 10:46         ` Hans Hagen
2011-02-23 11:35           ` Michail Vidiassov
2011-02-26 23:22             ` Hans Hagen
2011-02-28  7:52       ` attachment attaches twice - the fix was minimal Michail Vidiassov
2011-02-28  8:46         ` Hans Hagen
2011-02-28  9:24           ` attachment attaches twice - the fix was minimal (?) Michail Vidiassov
2011-02-28  9:57             ` Hans Hagen
2011-04-29  7:24           ` attachment attaches twice - the fix was minimal Michail Vidiassov
2011-02-20 19:47 attachment attaches twice Reviczky, Adam

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).