Skip to main content
.NET Framework 4.5.2+

PdfAcroFormFieldNameCollision Struct

Represents a structure which stores information about a collision found in interactive form field names.

Namespace: DevExpress.Pdf

Assembly: DevExpress.Pdf.v23.1.Core.dll

NuGet Package: DevExpress.Pdf.Core


public struct PdfAcroFormFieldNameCollision


Field names must be unique within an interactive form.

To obtain the interactive form field in which a collision was found with a field name, use the PdfAcroFormFieldNameCollision.Field property.

You can also get the forbidden field names using the PdfAcroFormFieldNameCollision.ForbiddenNames property.

The code sample below checks whether the created fields’ names already exist in the loaded document and renames the conflicting field.

List<PdfAcroFormField> fields = new List<PdfAcroFormField>();
//Check whether new form fields' names already exist in the document
IList<PdfAcroFormFieldNameCollision> collisions = processor.CheckFormFieldNameCollisions(fields);
if (collisions.Count == 0)
    Console.WriteLine("No name conflicts are detected");
    foreach (var collision in collisions)
        //Rename conflicting field
        Console.WriteLine("The specified form field name ({0}) already exist in the document. Renaming...", collision.Field.Name);
        while (collision.ForbiddenNames.Contains(collision.Field.Name))
            collision.Field.Name = Guid.NewGuid().ToString();
//Add fields to the document
//And save the result
See Also