Document doc = new Document("data/document.doc");
doc.protect(ProtectionType.READ_ONLY);
// Following other Protection types are also available
// ProtectionType.ALLOW_ONLY_COMMENTS
// ProtectionType.ALLOW_ONLY_FORM_FIELDS
// ProtectionType.ALLOW_ONLY_REVISIONS
doc.save("data/AsposeProtect.doc", SaveFormat.DOC);
Download Source Code