We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

How to enable bookmarks in pdf document


I am using Aspose.Words for ASP.Net for converting a word document to pdf. While converting how to enable bookmarks in pdf document. Please assist.

Hi Irfan,

Thanks for your inquiry. Please use OutlineOptions.DefaultBookmarksOutlineLevel property to specify the default level in the document outline at which to display Word bookmarks. Specify 0 and Word bookmarks will not be displayed in the document outline. Please check following code example for your kind reference.

Document doc = new Document(MyDir + "in.doc");
PdfSaveOptions saveOption = new PdfSaveOptions();
saveOption.OutlineOptions.DefaultBookmarksOutlineLevel = 9;
doc.Save(MyDir + "Out.pdf", saveOption);