I know with POI I can use the SummaryInformation class to retrieve the page count of .doc, .xls documents.

How can I do the same with xml based .docx, .xlsx?

I see that I can get the CoreProperties from XWPFDocument to get the author and other meta data.. but how would I retrieve the page count?