How to get the title and page from catalog

How to get the title and page from catalog?


try {
Document doc = new Document(abs_wordpath);
word_max_page = doc.getBuiltInDocumentProperties().getPages();

final String PARA_STYLE = “TOC 1”;
ArrayList paragraphs = paragraphsByStyleName(doc, PARA_STYLE);
for (Paragraph paragraph : paragraphs){
String cat_txt = paragraph.toString(SaveFormat.TEXT);
}
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

Hi,


Thanks for your inquiry. Could you please attach your input Word document and a screenshot highlighting the content that you want to extract here for testing? We will investigate the issue on our end and provide you code to meet this requirement.

Best regards,