ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Hans Hagen <pragma@wxs.nl>
Subject: Re: new trickery / acrobat 6
Date: Sat, 12 Jul 2003 19:19:52 +0200	[thread overview]
Message-ID: <5.2.0.9.1.20030712191348.02bf4340@localhost> (raw)
In-Reply-To: <20030710162204.5bd287b0.morawski@gmx.net>

At 16:22 10/07/2003 +0200, you wrote:

>\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.

hm, pdftosrc should probably accept both as valid numbers (i.e. in case of 
no 7 resolve it to 6), so if there's someone out there willing to patch ...

>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

this is kind of tricky, since we're never sure if forward or backward 
referencing takes place (apart form the fact that this kind of trickery can 
seldom b eimplemented in a clean way). Anyhow, since i happen to be doing 
things with attachments currently you're lucky; i made you:

\starttext

\definesymbol
   [ObjectNumber]
% [object number {\PDFattachmentnumber[xx]}]
   [object number \PDFattachmentnumber]

\useattachment[test][xx][test.tex]
\setupattachments[symbol=ObjectNumber]
\attachment[test]

\stoptext

(in case of just two args, i.e. no [xx], you need to feed the filename, 
i.e. test.txt)

I'll send you the patched spec file (keep in mind that this 
\PDFattachmentnumber is some driver functionality, and not something of teh 
core).

Hans
-------------------------------------------------------------------------
                                   Hans Hagen | PRAGMA ADE | pragma@wxs.nl
                       Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
  tel: +31 (0)38 477 53 69 | fax: +31 (0)38 477 53 74 | www.pragma-ade.com
-------------------------------------------------------------------------
                        information: http://www.pragma-ade.com/roadmap.pdf
                     documentation: http://www.pragma-ade.com/showcase.pdf
-------------------------------------------------------------------------

      reply	other threads:[~2003-07-12 17:19 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
2003-07-12 17:19           ` Hans Hagen [this message]

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=5.2.0.9.1.20030712191348.02bf4340@localhost \
    --to=pragma@wxs.nl \
    --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).