ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Jens-Uwe Morawski <morawski@gmx.net>
Subject: Re: new trickery / acrobat 6
Date: Thu, 10 Jul 2003 16:22:04 +0200	[thread overview]
Message-ID: <20030710162204.5bd287b0.morawski@gmx.net> (raw)
In-Reply-To: <5.2.0.9.1.20030709164359.0196ca28@localhost>

On Wed, 09 Jul 2003 16:47:39 -0400
Hans Hagen <pragma@wxs.nl> wrote:

> 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 <</F 6 0 R>> >>
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

  reply	other threads:[~2003-07-10 14:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-03 11:55 Hans Hagen
2003-07-03 14:38 ` Willi Egger
2003-07-07 16:39 ` Jens-Uwe Morawski
2003-07-07 20:52   ` Henning Hraban Ramm
2003-07-08 22:16     ` Jens-Uwe Morawski
2003-07-09 20:47       ` Hans Hagen
2003-07-10 14:22         ` Jens-Uwe Morawski [this message]
2003-07-12 17:19           ` Hans Hagen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030710162204.5bd287b0.morawski@gmx.net \
    --to=morawski@gmx.net \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).