Renaming field

I read the documentation of Essential PDF and nothing indicates that form fields can be renamed. Is that right? If yes, do you have plans to implement this feature?


3 Replies

GL George Livingston Syncfusion Team December 6, 2011 09:15 AM UTC

Hi Martel,

Thank you for your interest in Syncfusion products.

Currently we do not have support to rename the form fields. However we will create a feature request report for this implementation. Please create an incident in the Direct-Trac for the follow up of this feature.

Please let us know if you have any questions.

Regards,
George



CG Carl Ganz Jr. February 2, 2017 01:53 PM UTC

Has this feature been added yet? It still doesn't seem like it can be done.

Is there a woraround to this?

Carl


CM Chinnu Muniyappan Syncfusion Team February 3, 2017 10:26 AM UTC

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 


Loader.
Up arrow icon