- Code: Select all
val wordMlPackage = Docx4J.load(...)
val mainDocPart = wordMlPackage.mainDocumentPart
// some Kotlin sugar for getting all P's from content, and then mapping each to its outlineLvl value
val outlineLvls = mainDocPart.content.filterIsInstance<P>().map { it.pPr?.outlineLvl }
println(outlineLvls) // [null, null, ..., null]
UPDATE: Just tried the same doc with Aspose.Words and the outlineLvl is ...