Free Support Forum - aspose.com

BookMark in PDF

Hi,

I want to create a PDF with book marks as shown in the image attached. But I didn’t see options for placing bookmarks like this. Am using a word template with linq scripts and convert it into pdf using the Java version. Can someone suggest the way for creating pdf like this.

Can i do the same by modifying the template or I need to write additional Java code for this?

Thanks

Hi Jobin,


Thanks for your inquiry. While converting word document to PDF, you can set OutlineOptions.DefaultBookmarksOutlineLevel option to enable bookmarks at any level. Default value for DefaultBookmarksOutlineLevel is 0 which means bookmarks will not be displayed. You can specify any value from 0 to 9. Specify 1 and Word bookmarks will be displayed in the document outline at level 1; 2 for level 2 and so on.

Document doc = new Document(“Input.docx”);<o:p></o:p>

PdfSaveOptions options = new PdfSaveOptions();

options.getOutlineOptions().setDefaultBookmarksOutlineLevel(1);

doc.save("Out.pdf", options);


Furthermore, if you want to add bookmarks in a PDF document then you can use Aspose.Pdf for Java. It can create PDF document from scratch and manipulate existing PDF documents as well. Please check following documentation link to create bookmarks in PDF document. Hopefully it will help you to accomplish the task.


Please feel free to contact us for any further assistance.

Best Regards,