We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Throw exception if there are more than 1 TextField have same name

Hi There!

I tried to load a PDF form and I got an exception if there were more than 1 TextBoxField have the same "Name".( It works fine if there is no duplicated field name.)

Thanks!

I am using Syncfusion.Pdf.Base, (ver 8.103.0.30) .Net3.5, WinXP

~~~~~~~~~~~~~~~~~~~~~~

string _pdfInputPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + @"\SameNamePDF_new.pdf";

//string _pdfInputPath = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) + @"\NOTSameNamePDF.pdf";

private void CreatePDFFieldList()
{
PdfLoadedDocument loadedDocument = new PdfLoadedDocument(this._pdfInputPath);
PdfLoadedForm form = loadedDocument.Form;//EXCEPTION IS HERE
loadedDocument.Close(true);
}



PDF NAME_c3b4eed2.rar

5 Replies

PJ Priyadharshini J Syncfusion Team January 19, 2011 01:14 PM UTC

Hi kim,

Thank you for the details.

As per the rules we cannot create two form fields with the same name. Form fields are not retrieved from the document when they have same name, hence no objects are loaded and it shows 'Value cannot be null exception'.

Please let us know if you have any queries.

Regards,
Priyadharshini



KI kim January 19, 2011 02:07 PM UTC

Hi Priyadharshini!

Thanks for the info. Is the rule going to changed?

Because the PDF form allows to add fields with the same name which is common use (EX: Company name , person name are on each page of a document ..etc, so if a document has a thousand pages, and the users have to create a thousand Fields with different names?Do they want to do it? are they going to make mistake? )

I think most of the time the end user create the PDF, not the programmers who use Syncfusion dll, so the programmers can not prevent this problem.

It is just my opinion.

Thanks!



PJ Priyadharshini J Syncfusion Team January 20, 2011 10:24 AM UTC

Hi Kim,

Thank you for the details.

We could see the problem and suspect this could be a defect. We have forwarded this to our development team for further analysis.

Could you please report this issue through Direct Trac Developer Support System
https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents because you can take the advantage of the expertise of a dedicated support engineer and a guaranteed response time and we hope you will take advantage of this system as well. If you have already reported, please ignore this.

Please let us know if you have any queries.

Regards,
Priyadharshini



SL Steve Lauer replied to Priyadharshini J February 4, 2016 11:15 PM UTC

Hi Kim,

Thank you for the details.

We could see the problem and suspect this could be a defect. We have forwarded this to our development team for further analysis.

Could you please report this issue through Direct Trac Developer Support System
https://www.syncfusion.com/account/login?ReturnUrl=%2fsupport%2fdirecttrac%2fincidents because you can take the advantage of the expertise of a dedicated support engineer and a guaranteed response time and we hope you will take advantage of this system as well. If you have already reported, please ignore this.

Please let us know if you have any queries.

Regards,
Priyadharshini


Utilizing the most current version.  This issue does not seem to be resolved:

https://www.syncfusion.com/forums/97899/throw-exception-if-there-are-more-than-1-textfield-have-same-name

Will it be resolved?


CM Chinnu Muniyappan Syncfusion Team February 5, 2016 11:48 AM UTC

Hi Steve,
We have created a simple sample for loading a PDF document to more than text box fields with the same name, and also we haven’t receive any exceptions in our current version. Please find the below details

1.       If more than one field with same name, the same named fields are moved to a single group so we have to access the fields using that group. Please refer the below code snippet for how to access the group items.


            //Load the text box field

            PdfLoadedTextBoxField lfield = lform.Fields[0] as PdfLoadedTextBoxField;

            

            //access the child fields of the text box

     PdfLoadedTexBoxItem item = lfield.Items[2];


2.       If we fill the parent field it will automatically filled all the child fields, it is the default behavior.


lfield.Text = "testing";


3.       And also we have attached the video for your reference, please refer the video and sample

http://www.syncfusion.com/downloads/support/directtrac/150704/ze/WinApp1-865942153



Regards,
Chinnu


Loader.
Live Chat Icon For mobile
Up arrow icon