Page 1 of 1

numbering in docx

PostPosted: Thu May 30, 2013 6:57 pm
by eltayeb
Hi ,

i was asking how to extract numbering correctly from docx as i was depending on checking
if ( ppr.getNumPr() != null) which is not reliable


thanks

Re: numbering in docx

PostPosted: Thu May 30, 2013 8:07 pm
by jason
Yes, if the pPr references a style, you also need to check the style hierarchy to see whether numbering is defined there.

You can use propertyResolver.getEffectivePPr to get a pPr object which takes that into account for you. See https://github.com/plutext/docx4j/blob/ ... olver.java at line 309

For an example of use, see https://github.com/plutext/docx4j/blob/ ... rsion.java at line 423

Re: numbering in docx

PostPosted: Fri May 31, 2013 1:41 am
by eltayeb
Thanks jason , you really saved alot of time

and for archiving , i just use
Code: Select all
propertyResolver.getEffectivePPr(ppr.getPStyle().getVal());   
org.docx4j.model.listnumbering.Emulator.getNumber(wordMLPackage, pStyle, numId, levelId);




to generate right numbering and bullets