After converting docx to pdf, the nested bookmark and its child bookmarks lose the parent-child relationship

After converting docx to pdf, the nested bookmark and its child bookmarks lose the parent-child relationship.
Nested bookmark:person;Child bookmark:name,age,sex,adress.
The result i expected:
person
–name
–age
–sex
–adress
Actual result:
person
age
sex
adress
They are at the same level.
Looking forward to your reply, thanks!
expected.png (1.1 KB)
result.png (766 Bytes)
1111.docx (12.5 KB)

@asukavon You can use BookmarksOutlineLevels to set output level of individual bookmarks in in your document. For example see the following code, which gives almost the expected result:

Document doc = new Document("C:\\Temp\\in.doc");

PdfSaveOptions opt = new PdfSaveOptions();
opt.getOutlineOptions().getBookmarksOutlineLevels().add("person", 1);
opt.getOutlineOptions().getBookmarksOutlineLevels().add("name", 2);
opt.getOutlineOptions().getBookmarksOutlineLevels().add("age", 2);
opt.getOutlineOptions().getBookmarksOutlineLevels().add("sex", 2);
opt.getOutlineOptions().getBookmarksOutlineLevels().add("adress", 2);

doc.save("C:\\Temp\\out.pdf", opt);

Almost, because bookmarks appear in the same order as they are in the document and in your document bookmark name starts before the bookmark person.