public void ProtectUnprotectDocument()
{
//ExStart
//ExFor:Document.Protect(ProtectionType,String)
//ExId:ProtectDocument
//ExSummary:Shows how to protect a document.
Document doc = new Document();
doc.Protect(ProtectionType.AllowOnlyFormFields, "password");
//ExEnd
//ExStart
//ExFor:Document.Unprotect
//ExId:UnprotectDocument
//ExSummary:Shows how to unprotect a document. Note that the password is not required.
doc.Unprotect();
//ExEnd
//ExStart
//ExFor:Document.Unprotect(String)
//ExSummary:Shows how to unprotect a document using a password.
doc.Unprotect("password");
//ExEnd
}