/// <summary>Sets signature lock for specific fields in the document.</summary> /// <param name="action"> /// Indicates the set of fields that should be locked after the actual /// signing of the corresponding signature takes place. /// </param> /// <param name="fields">Names indicating the fields.</param> /// <returns> /// This /// <see cref="PdfSigFieldLockDictionary"/> /// object. /// </returns> public virtual iText.Forms.PdfSigFieldLockDictionary SetFieldLock(PdfSigFieldLockDictionary.LockAction action , params String[] fields) { PdfArray fieldsArray = new PdfArray(); foreach (String field in fields) { fieldsArray.Add(new PdfString(field)); } GetPdfObject().Put(PdfName.Action, GetLockActionValue(action)); GetPdfObject().Put(PdfName.Fields, fieldsArray); return(this); }
public static PdfName GetLockActionValue(PdfSigFieldLockDictionary.LockAction action) { switch (action) { case PdfSigFieldLockDictionary.LockAction.ALL: { return(PdfName.All); } case PdfSigFieldLockDictionary.LockAction.INCLUDE: { return(PdfName.Include); } case PdfSigFieldLockDictionary.LockAction.EXCLUDE: { return(PdfName.Exclude); } default: { return(PdfName.All); } } }