Bug 64615 - Extraction of content under a particular heading in Word Document .
Summary: Extraction of content under a particular heading in Word Document .
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: XWPF (show other bugs)
Version: 4.1.1-FINAL
Hardware: PC All
: P1 critical (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-07-20 08:26 UTC by Akash
Modified: 2020-10-25 04:43 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Akash 2020-07-20 08:26:23 UTC
Trying to extract the content under a particular heading(Heading 2) in the document .
How to achieve it ?
Comment 1 Sayi 2020-08-10 10:58:17 UTC
(In reply to Akash from comment #0)
> Trying to extract the content under a particular heading(Heading 2) in the
> document .
> How to achieve it ?

Traverse all paragraphs and get the style ID through paragraph.getStyleID(),

get all styles through XWPFDocument.getStyles() or XWPFDocument.getStyle().

Get what you want by comparing style names(Pay attention to the style name in your document).
Comment 2 Dominik Stadler 2020-10-25 04:43:34 UTC
Resolving for now as no actual issue, please use the contact options described at http://poi.apache.org/help/index.html for discussing usage of Apache POI.