I found some posts here how to count pages/lines with the apache-poi library. But my code already uses docx4j right now, it would be too much work to completely replace that.
Therefore my question is, how can I get from an object of type WordprocessingMLPackage
to an object of type XWPFDocument
in order to count the lines and pages of my current document.
private XWPFDocument convertDocx4J(WordprocessingMLPackage wp) {
XWPFDocument oiDoc = null;
//TODO...
return oiDoc;
}