扁平化表单字段
表单字段扁平化特性删除所有字段,但保留文档中的内容。执行此操作后,文档将无法再编辑。该功能在R2 2021版本中添加。
您可以使用两种方法。一个是把所有场都压平,一个是把一个场压平。下面的例子演示了如何使用它们。
使用flatformfields方法
的FlattenFormFields方法不接受任何参数,并将平展文档中的所有字段。
例1:平坦所有字段
RadFixedDocument document = GetFixedDocument();document.AcroForm.FlattenFormFields ();
使用flatformfield方法
的FlattenFormField方法将应平坦化的字段作为参数。该字段必须属于同一个文档。
例2:扁平化单个字段
RadFixedDocument document = GetFixedDocument();string fieldName = "TextBoxField";FormField字段= document.AcroForm.FormFields。Where(n => n. name == fieldName).FirstOrDefault();if (field != null) {document. acroform . flatformfield (field);}