I was asked by a fellow-user to explain how I did it, so here goes (assume
you have two strings, one called remoteFilePath with the path of the file,
and one called remoteDestName with the name of the Named Destination you
wish to open):

                PDAction action = new PDActionRemoteGoTo();
                PDSimpleFileSpecification fileSpec = new
PDSimpleFileSpecification();
                fileSpec.setFile(remoteFilePath);
                ((PDActionRemoteGoTo) action).setFile(fileSpec);
                ((PDActionRemoteGoTo) action).setD(new
COSString(remoteDestName));

And a bit later on we apply the action to the PDAnnotationLink object, and
add that object to the PDPage:

                txtLink.setAction(action);
                page.getAnnotations().add(txtLink);

Hope this helps!


On Tue, Jan 15, 2013 at 12:02 AM, Gilad Denneboom <[email protected]
> wrote:

> I just realized I can use PDActionRemoteGoTo... Silly me...
>
>
> On Mon, Jan 14, 2013 at 11:40 PM, Gilad Denneboom <
> [email protected]> wrote:
>
>> Hi all,
>>
>> I'm looking for a way to create a link that uses opens a PDF at a
>> specific Named Destination (a bit like the cDest parameter of app.openDoc()
>> in JS), and I was thinking that maybe one of the parameters of
>> PDActionLaunch can do it, but I haven't been able to find out if that's the
>> case or not.
>>
>> Any help is appreciated...
>>
>> Gilad
>>
>
>

Reply via email to