Hi,
I am new to docx4j,
i am wondering can i make certain parts of docx files as read only by password protection?
most of the document is editable, only certain parts we want to make it as read only to avoid accidental edits.,
Thanks
Guna
It is currently Fri Sep 18, 2026 2:56 pm
News of docx4j<w:bookmarkStart w:id="1" w:name="d0e124"/>
<w:bookmarkEnd w:id="1"/>
...
<w:bookmarkStart w:id="0" w:name="d0e124"/>
<w:bookmarkEnd w:id="0"/>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);
Total posts 10255 • Total topics 2893 • Total members 2109