pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sera <news4s...@gmx.de>
Subject Re: bookmark.getDestination is null
Date Sun, 03 Nov 2013 12:39:47 GMT
I've debugged it and it throws an exception.

  PDDestinationNameTreeNode node = (PDDestinationNameTreeNode)  
document.getDocumentCatalog().getStructureTreeRoot().getIDTree();

any idea what the correct way is?



Am 01.11.2013, 23:47 Uhr, schrieb Sera <news4sera@gmx.de>:

>
> is this the right way to get to the treenode?
>
> Am 31.10.2013, 11:28 Uhr, schrieb Gilad Denneboom  
> <gilad.denneboom@gmail.com>:
>
>> If the destination is a PDNamedDestination object, you have to cast it  
>> to
>> that class...
>>
>>>
>>
>> On Thu, Oct 31, 2013 at 11:24 AM, Sera <news4sera@gmx.de> wrote:
>>
>>> Do I have to cast Action to another type than ActionGoTo? I don't see a
>>> function getNamedDestination() in the suggestions for my objects.
>>>
>>> Am 31.10.2013, 10:45 Uhr, schrieb Gilad Denneboom <
>>> gilad.denneboom@gmail.com>:
>>>
>>>  Ah, so your bookmarks are not pointing to page locations directly,  
>>> but to
>>>> Named Destinations. This makes things more complex. You can use
>>>> getNamedDestination() to get the name of the ND the bookmark is  
>>>> pointing
>>>> to. Of course, then you still need to write a function that looks up  
>>>> that
>>>> specific ND in the tree (a PDDestinationNameTreeNode object) and then
>>>> figures out to which page it's pointing to by its value.
>>>>
>>>>
>>>> On Thu, Oct 31, 2013 at 10:35 AM, Sera <news4sera@gmx.de> wrote:
>>>>
>>>>  when i make it toString() i get:
>>>>>
>>>>> org.apache.pdfbox.pdmodel.****interactive.****documentnavigation.**
>>>>> destination.****PDNamedDestination@505484dc
>>>>>
>>>>>
>>>>> whereas the last after @ is always different. I think its the hashed
>>>>> destination?
>>>>>
>>>>> Am 31.10.2013, 10:20 Uhr, schrieb Gilad Denneboom <
>>>>> gilad.denneboom@gmail.com>:
>>>>>
>>>>>
>>>>>  What do you mean by "hascode", exactly?
>>>>>
>>>>>>
>>>>>>
>>>>>> On Thu, Oct 31, 2013 at 10:16 AM, Sera <news4sera@gmx.de> wrote:
>>>>>>
>>>>>>  ok, now I've got the destination as a hashcode. How do I get the
>>>>>>
>>>>>>> pagenumber from this?
>>>>>>>
>>>>>>> Am 30.10.2013, 20:10 Uhr, schrieb Gilad Denneboom <
>>>>>>> gilad.denneboom@gmail.com>:
>>>>>>>
>>>>>>>
>>>>>>>  Like I said, you need to determine (using instanceof, for example)
>>>>>>> which
>>>>>>>
>>>>>>>  actual class it is, one of the subsets of PDAction, like  
>>>>>>> PDActionGoTo
>>>>>>>> ...
>>>>>>>>
>>>>>>>>
>>>>>>>> On Wed, Oct 30, 2013 at 7:51 PM, Sera <news4sera@gmx.de>
wrote:
>>>>>>>>
>>>>>>>>  current.getAction() is just a PDAction. From there I don't
have
>>>>>>>> access
>>>>>>>> to
>>>>>>>>
>>>>>>>>  getDestination().
>>>>>>>>> Am 30.10.2013, 16:27 Uhr, schrieb Gilad Denneboom <
>>>>>>>>> gilad.denneboom@gmail.com>:
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>  You should get the Action of the bookmark, and then
check which  
>>>>>>>>> type
>>>>>>>>> of
>>>>>>>>>
>>>>>>>>>  action it is (probably PDActionGoTo), and from the Action
you'll
>>>>>>>>> have
>>>>>>>>>
>>>>>>>>>> access to the Destination.
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> On Wed, Oct 30, 2013 at 4:00 PM, Sera <news4sera@gmx.de>
wrote:
>>>>>>>>>>
>>>>>>>>>>  Hello!
>>>>>>>>>>
>>>>>>>>>>  I need to extract the pagenumber out of the bookmarks
and  
>>>>>>>>>> tried it
>>>>>>>>>>
>>>>>>>>>>> with
>>>>>>>>>>>
>>>>>>>>>>> PDOutlineItem current = bookmark.getFirstChild();
>>>>>>>>>>> PDDestination destination = null;
>>>>>>>>>>> destination = current.getDestination();
>>>>>>>>>>>
>>>>>>>>>>> But the destination stays null. Any ideas on
how to fix this?
>>>>>>>>>>>
>>>>>>>>>>> Regards,
>>>>>>>>>>> Sera
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>  --
>>>>>>>>>>>
>>>>>>>>>> Erstellt mit Operas E-Mail-Modul: http://www.opera.com/mail/
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>  --
>>>>>>> Erstellt mit Operas E-Mail-Modul: http://www.opera.com/mail/
>>>>>>>
>>>>>>>
>>>>>>>
>>>>> --
>>>>> Erstellt mit Operas E-Mail-Modul: http://www.opera.com/mail/
>>>>>
>>>>>
>>>
>>> --
>>> Erstellt mit Operas E-Mail-Modul: http://www.opera.com/mail/
>>>
>
>


-- 
Erstellt mit Operas E-Mail-Modul: http://www.opera.com/mail/

Mime
View raw message