Display DOCX Word Bookmarks & Headings at Different Outline Levels in PDF using Java Code

When I am saving my document in pdf using the below code.
PdfSaveOptions options = new PdfSaveOptions();
options.getOutlineOptions().setDefaultBookmarksOutlineLevel(1);
options.getOutlineOptions().setHeadingsOutlineLevels(2);
document.save(genFileWithPath,options);

Then the pdf is not opening and showing this message
image.png (232.6 KB)
But when saving the same document in docx formate using the below code is working perfectly fine and I am able to open it as well.
document.save(genFileWithPath,SaveFormat.DOCX);
when we convert the same pdf into docx manually then opening in the docx formate perfectly fine.
FYR, I am attaching the corrupted pdf
New Imaging_Board Meeting_agenda_10-Jan-2020 (50).pdf (104.0 KB)

@Gptrnt,

Have you also tried the latest version of Aspose.Words for Java i.e. 20.1 on your end? In case the problem still remains, please also ZIP and upload your input Word document you are getting this problem with here for testing. We will then investigate the issue on our end and provide you more information.

Hi
Thanks for your help. I upgrade the version and its working fine now.

@Gptrnt,

Thanks for your feedback. It is great that you were able to resolve this issue on your end. Please let us know any time you have any further queries.