I wrote something once using the PDDestinationNameTreeNode object from
doc.getDocumentCatalog().getNames().getDests(), but I think the method you
pointed out is the best.

On Thu, Sep 15, 2011 at 11:38 PM, nnkfws333 <[email protected]> wrote:

> Only way I could do it was by
>
> List<PDPage> allPages = document.getDocumentCatalog().getAllPages();
>
> PDPage page = item.findDestinationPage(document);
> page = allPages.indexOf(page) + 1;
>
> Just trying to figure out other ways.
>
> Nghi Nguyen
> On Sep 15, 2011, at 4:23 AM, Gilad Denneboom <[email protected]>
> wrote:
>
> > You need to find out the subclass of the PDAction object by using
> > instanceof. Then you cast the PDAction object to that subclass and get
> > access to its methods. So, for example, if the PDAction object is an
> > instance of PDActionGoTo, then you cast to it and can access
> > getDestination() to retrieve the PDDestination object to which it points.
> >
> > On Thu, Sep 15, 2011 at 2:59 AM, Nghi Nguyen <[email protected]>
> wrote:
> >
> >> Hi PDFBox,
> >>
> >> I would like to post a question concerning bookmarks and their actions.
> I
> >> am
> >> able to get bookmarks and there page destinations but unable to get the
> >> ones
> >> that have actions related to it. I can get the bookmark item and get the
> >> pdaction but am lost on how to get the actual destinations or vice
> versa. I
> >> am following the PDF Spec 1.7 and am able to recursively go down the
> tree
> >> to
> >> determine it is an action but just get jumbled in how to get the
> actually
> >> destination out of a cosobject. Are there any examples out there or
> anyone
> >> who can help me out?
> >>
> >> Thanks,
> >>
> >> Nghi Nguyen
> >>
>

Reply via email to