# [NTG-context] How to produce PDF links with custom action?

Hans Hagen ntg-context@ntg.nl
Thu, 05 Feb 2004 18:39:38 +0100

At 17:13 04/02/2004, you wrote:
>Hi all!
>
>Does ConTeXt allow to create links with custom actions? I have a working
>LaTeX /
>PDF-TeX solution which I am not able to port to ConTeXt. The following PDF-TeX
>code contained in a LaTeX file produces the desired PDF-Code.
>
>\\pdfstartlink attr{/Border [ 0 0 0 ]} user{/Subtype/Link/A << /S /AVDP_Action
>/AVDP_Param (../../nach-dateipfad.pdf 1)>>}
>here is a link
>\\pdfendlink
>
>Yet, if I include the same lines of code in a ConTeXt file then no link is
>generated.

In context we do things a bit different:

You can put this in some local file, the style or in a preamble:

\unprotected \setglobalsystemreference\rt!exec{AVDP}{AVDP}

\def\PDFexecuteAVDP{/AVDP_Action /AVDP_Param (\argumentA)}

After that, you can do things like:

\setupinteraction[state=start]

\starttext

\goto{test}[AVDP{../../nach-dateipfad.pdf 1}]

\stoptext

So, a bit more abstract interface with the advantage of more functionality,
as in:

\goto{test}[nextpage,AVDP{../../nach-dateipfad.pdf 1}]

Hans