- Code: Select all
org.docx4j.model.PropertyResolver.hasDirectPPrFormatting
It is currently Sun Aug 17, 2025 9:51 am
org.docx4j.model.PropertyResolver.hasDirectPPrFormatting
HashMap<String, String> tokens = new HashMap<String, String>();
tokens.put("TOKEN_HOLDER", MiscSiteConfig.getCurrentVAPrivacyOfficer().getName().toString());
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(new File(checkList));
MainDocumentPart mainDocumentPart = wordMLPackage.getMainDocumentPart();
org.docx4j.wml.Document wmlDocumentEl = mainDocumentPart.getJaxbElement();
String xml = XmlUtils.marshaltoString(wmlDocumentEl, true);
Document doc = (Document) XmlUtils.unmarshallFromTemplate(xml, tokens);
mainDocumentPart.setJaxbElement(doc);
@Override
public List<Object> apply(Object object) {
if (object instanceof org.docx4j.wml.Text){
Text wText=(org.docx4j.wml.Text) object;
if(wText.getValue().equals("formattedAuditNumber")){
wText.setValue("A-123-456-9876");
}
}
return null;
}
Total posts 10189 • Total topics 2867 • Total members 2097