Thanks for your inquiry. While testing the scenario with your shared document, we have managed to reproduce the issue with latest version of Aspose.Pdf for .NET 9.7.0. We have logged a ticket PDFNEWNET-37720 in our issue tracking system for further investigation and resolution. We will notify you as soon as it is resolved.
We are sorry for the inconvenience caused.
To solve the problem we need either add some header of level 2 into 3-d branch before header of level 3(please look at XML and result PDF in ‘37720_added_dditional_header_of_level_2.zip’), or mark last header as header of level 2 instead of header of level 3 (please find XML and result PDF in 37720_last_header_of_level_3_became_header_of_level_2.zip).
Please feel free to contact us for any further assistance.