You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pdfbox.apache.org by Juho Terrijärvi <j....@gmail.com> on 2014/07/25 07:21:06 UTC

About bookmarks

Hey,

Could someone please help me about one problem I have. I'm trying to 
create bookmarks:

Heading
     - subHeading
         - subsubHeading

But I do not find a way for the subsubHeading.

I would really appreciate the help.

Best regards,

Juho

Re: About bookmarks

Posted by Maruan Sahyoun <sa...@fileaffairs.de>.
Hi,

you would create and add subsubHeading the same way you created subHeading

PDOutlineItem heading = new PDOutlineItem();
heading.setTitle( "Heading" );
                
PDOutlineItem subHeading = new PDOutlineItem();
subHeading.setTitle( "Sub Heading");
                
PDOutlineItem subsubHeading = new PDOutlineItem();
subsubHeading.setTitle( "Sub Sub Heading");
                
subHeading.appendChild(subsubHeading);
                
heading.appendChild( subHeading );


Take a look at http://svn.apache.org/viewvc/pdfbox/trunk/examples/src/main/java/org/apache/pdfbox/examples/pdmodel/CreateBookmarks.java?view=co for a more complete example.


BR
Maruan

Am 25.07.2014 um 07:21 schrieb Juho Terrijärvi <j....@gmail.com>:

> Hey,
> 
> Could someone please help me about one problem I have. I'm trying to create bookmarks:
> 
> Heading
>    - subHeading
>        - subsubHeading
> 
> But I do not find a way for the subsubHeading.
> 
> I would really appreciate the help.
> 
> Best regards,
> 
> Juho