Hi Carl,
Thank you for your update.
Yes, we can rename the existing form field by using the SetName method. Also, we have created a simple sample for demonstrating the same, please refer the code snippet and sample below.
//Load the existing PDF document
PdfLoadedDocument ldoc = new PdfLoadedDocument(Server.MapPath("/App_Data/test1.pdf"));
//Load the PDF form
PdfLoadedForm lform = ldoc.Form;
foreach (PdfLoadedField field in ldoc.Form.Fields)
{
if (field is PdfLoadedTextBoxField)
{
//Set the new name of the field
(field as PdfLoadedTextBoxField).SetName(field.Name + "_renamedField");
}
else if (field is PdfLoadedCheckBoxField)
{
//Set the new name of the existing filed
(field as PdfLoadedCheckBoxField).SetName(field.Name + "_renamedField");
}
}
//Save the document
ldoc.Save("output.pdf", Response, HttpReadType.Open);
|
Please let us know if you have any concern.
Regards,
Chinnu