maven - How to get all headers in a XWPFDocument -
i'm trying extract headers in docx file have. code use:
fileinputstream fs = new fileinputstream(new file("myfile.docx")); xwpfdocument doc = new xwpfdocument(opcpackage.open(fs)); list<xwpfheader> list = doc.getheaderlist();
and if do:
system.out.println(list.size());
it prints out 0, have 4 headers in document. way have succeeded extract text document using following code:
xwpfwordextractor wx = new xwpfwordextractor(doc); string text = wx.gettext(); system.out.println("text = "+text );
this structure of document:
any ideas on problem might be?
Comments
Post a Comment