On Wed, 09 Jul 2003 16:47:39 -0400
Hans Hagen
At 00:16 09/07/2003 +0200, you wrote:
maybe \setupattachments[symbol=objectnumber] could be implemented?!
I added \PDFattachmentnumber
\definesymbol [ObjectNumber] [object number \PDFattachmentnumber]
this works not exactly how i would expect it: --- \setupinteraction[state=start] \useattachment[whatever][test1.txt] \definesymbol [ObjectNumber] [object number \PDFattachmentnumber] \setupattachments[symbol={ObjectNumber}] \starttext \attachment[whatever] \stoptext --- gives "object number 7" written in the PDF file, but the object that contains the _real_ data stream is object 6, not 7: 6 0 obj << /Length 20
stream Das ist Testdatei 1 endstream endobj 7 0 obj << /Type /Filespec /F (test1.txt) /EF <> >> endobj
thus, in order to get the correct obj number for pdftosrc one need the number of the stream-object. another thing that might be useful is that \PDFattachmentnumber should read the attachment name as argument and return the obj-number. the above symbol could then be defined as: \definesymbol [ObjectNumber] [object number \PDFattachmentnumber[\currentattachment]] _and_ one can use it inside the text: \starttext This PDF-document has the file test1.txt attached. Users of pdftosrc can extract the PDF-object \PDFattachmentnumber[whatever] to get the file. \stoptext Regards, Jens