Word 2016 docx: outlineLvl is always null
Posted: Thu Jun 14, 2018 12:37 am
I have a Word 2016 docx which, when parsed by docx4j 3.3.7, all the p.pPr.outlineLvl values are null. Is this a bug?
UPDATE: Just tried the same doc with Aspose.Words and the outlineLvl is set correctly, though I'm trying to find reasons not to use Aspose.Words beyond the fact that it's code is obfuscated and it is expensive
- 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 set correctly, though I'm trying to find reasons not to use Aspose.Words beyond the fact that it's code is obfuscated and it is expensive