Paragraphs which aren't styled use the default paragraph style (ie Normal).
Just check getPPr()!=null before doing getPStyle()
It is currently Tue Dec 02, 2025 10:16 am
News of docx4jmmoselhy wrote:Can I get flow chart objects information ?
mmoselhy wrote:What about comments and bookmarks in the word document?
DocumentSettingsPart dsp = documentPart.getDocumentSettingsPart();
CTSettings objCTSettings = dsp.getJaxbElement();
ObjectFactory factory = Context.getWmlObjectFactory();
CTView ctView = factory.createCTView();
ctView.setVal(STView.PRINT);
objCTSettings.setView(ctView);
BooleanDefaultTrue b = new BooleanDefaultTrue();
b.setVal(true);
objCTSettings.setUpdateFields(b);
dsp.setJaxbElement(objCTSettings);
documentPart.addTargetPart(dsp);Ftr footerPart = (Ftr) XmlUtils.unmarshalString(footerXML);Total posts 10213 • Total topics 2877 • Total members 2103