Adam,

Thanks for your reply

It looks to me that the content of PDF Bookmarks very widely between PDFs. 
I checked PDF books that I own from 3 different Publishers.  The 
COSBase returned from  PDDestination.getCOSObject() COSArray, COSString, 
COSName, at least those are the ones I found. 

I did download the PDF Spec : 
http://www.adobe.com/devnet/acrobat/pdfs/PDF32000_2008.pdf. I must admit its 
quite lengthy and I have not read 
exactly how to get to the info I need yet.

My goal is to lucene-index the BookMarks, search them and then be able to jump 
to 
the page indicated by the bookmark, I'm not sure yet if this will be possible.

I did see this in the examples: GoToSecondBookMarkOnOpen.java
                PDOutlineItem item = bookmarks.getFirstChild().getNextSibling();
                PDDestination dest = item.getDestination();
                PDActionGoTo action = new PDActionGoTo();
                action.setDestination(dest);
                document.getDocumentCatalog().setOpenAction(action);
                document.save( args[1] );
maybe this will provide me with some more clues. 

I did attempt several tests on the code snippet you provided but I could not 
get 
the page number when PDAction == null, ie dest != null. As I stated above the 
COSObject
in many cases is not COSArray


 again thanks for you input I will take a closer look at getPageMap().

Tim



      

Reply via email to