Page 1 of 1

Position of a paragraph within a document

PostPosted: Wed May 03, 2017 5:24 pm
by thirub04
Is there a way in which we can find the position of a paragraph within a docx file using docx4j API ?

Re: Position of a paragraph within a document

PostPosted: Wed May 03, 2017 6:09 pm
by jason
If you have a reference to the P object, you can find its position in the content list.

If you don't have a reference to the P object, you'll need to find it first. The usual ways are either TraversalUtils, or XPath.