In this article, I am going to you how to use the ParagraphStyle class to build a line based document index. The end-user will be able to load a document, which contains styles for a heading or a subheading.

The headings of the document are used to generate a skeleton of the document. Clicking on the headings in the treeView then leads the end-user to the specific part of the document.