Class PdfFormFieldMergeUtil
Utility class to merge form fields PdfFormField with the same names.
public sealed class PdfFormFieldMergeUtil
- Inheritance
-
PdfFormFieldMergeUtil
- Inherited Members
Methods
GetPartialName(AbstractPdfFormField)
Gets partial name for the field dictionary.
public static string GetPartialName(AbstractPdfFormField field)
Parameters
field
AbstractPdfFormFieldfield to get name from.
Returns
- string
field partial name. Also, null if passed dictionary is a pure widget, empty string in case it is a field with no /T entry.
MergeFormFields(PdfFormField, PdfFormField, bool)
This method combines two form fields.
public static void MergeFormFields(PdfFormField firstField, PdfFormField secondField, bool throwExceptionOnError)
Parameters
firstField
PdfFormFieldfirst form field to be merged
secondField
PdfFormFieldsecond form field to be merged
throwExceptionOnError
booldefine whether exception (true) or log (false) is expected in case kid with the same name exists and merge of two kids failed.
MergeKidsWithSameNames(PdfFormField, bool)
This method merges all kids with the same names for the given parent field dictionary (recursively).
public static void MergeKidsWithSameNames(PdfFormField parentField, bool throwExceptionOnError)
Parameters
parentField
PdfFormFielda field whose kids should be checked and merged in case of same partial names.
throwExceptionOnError
booltrue if the exception is expected after the merge failed, false if log is expected.
MergeTwoFieldsWithTheSameNames(PdfFormField, PdfFormField, bool)
This method merges different values from two field dictionaries into the first one and combines kids.
public static bool MergeTwoFieldsWithTheSameNames(PdfFormField firstField, PdfFormField secondField, bool throwExceptionOnError)
Parameters
firstField
PdfFormFielda field into which dictionary all values will be merged.
secondField
PdfFormFielda field whose values should be merged into the first dictionary.
throwExceptionOnError
booltrue if the exception is expected after the merge failed, false if log is expected.
Returns
- bool
true if fields is successfully merged, false otherwise.
ProcessDirtyAnnotations(PdfFormField, bool)
Sometimes widgets contain field related keys, and they are the same as these field keys at parent.
public static void ProcessDirtyAnnotations(PdfFormField parentField, bool throwExceptionOnError)
Parameters
parentField
PdfFormFielda field whose form field kids should be checked and merged with parent in case all their dictionary values (except Parent and Kids) are the same or parent is a radio button.
throwExceptionOnError
booltrue if the exception is expected after the merge failed, false if log is expected.
Remarks
Sometimes widgets contain field related keys, and they are the same as these field keys at parent.
During merge process we get something like: ParentField
(/DA <DA1> /Ft <Tx> /T <test> /Kids <Field>) ->
Field
(/DA <DA1> /Kids <Annotation>) ->
Annotation (without any form fields)