Hi. Is there a way in docx4j to convert fields to static text? This is the functionality that is provided for in Word when you press Ctrl+Shift+F9 with fields selected.
Thanks.
Vikram
It is currently Mon Nov 03, 2025 1:19 pm
News of docx4jWordprocessingMLPackage wordMLPackage=null;
wordMLPackage = WordprocessingMLPackage.load(is);
OutputStream os=null;
wordMLPackage.save(os);ByteArrayOutputStream memoryStream=null;
WordprocessingMLPackage wordMLPackage=null;
wordMLPackage = WordprocessingMLPackage.load(is);
wordMLPackage.save(memoryStream);StyleDefinitionsPart sdp = wordMLPackage.getMainDocumentPart().getStyleDefinitionsPart();
List<Style> styleList = sdp.getJaxbElement().getStyle();
for (Style style : styleList) {
System.out.println(style.getName().getVal());
}Normal
Default Paragraph Font
Normal Table
No ListTotal posts 10207 • Total topics 2875 • Total members 2101