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.
Unfortunately, activation email could not send to your email. Please try again.

Index was out of range.

Thread ID:

Created:

Updated:

Platform:

Replies:

54458 Jan 9,2007 10:38 AM Jan 10,2007 08:22 AM Windows Forms 1
loading
Tags: PDF
Miles McGehee
Asked On January 9, 2007 10:38 AM

This is what I currently have...

private PDFDocument _document;
_document = new PDFDocument("Something.pdf");
foreach (IPDFField field in _document.Form.Fields)
{
_PDFControls.Add(field.Name);
if(((IPDFLoadedField)_document.Form.Fields[field.Name]).Type == PDFFieldTypeEnum.Signature)
_PDFSignableControls.Add(field.Name);
}


When I pause the debugger at the if statement, I get no problem seeing what is in _document.Form.Fields[0]... The fields name is "SignatureFieldEmployee[0]"... but when I try to find out what _document.Form.Fields["SignatureFieldEmployee[0]"] I get the following error:

"Index was out of range. Must be a non-negative and less than the size of the colleciton. Parameter name: index"

Why can i find the field by using and integral indexer, but not the name of the field? I have been using the name of the field 5-10 times in other places in my code...

Dhivya K [Syncfusion]
Replied On January 10, 2007 08:22 AM

Hi Miles,

I agree that when you can get/set values for the field index, it should be possible to read values from the field names too. I tried testing this issue with the files that you have provided me in Direct trac and was not able to reproduce the issue with those files.
I did the following:
1. Fixed a break point at the "if" statement
2. Added watch and found the properties of the signature field both with its index and with its name. Both displays the properties.
Could you please let me know if I have done something wrong or provide me a sample to reproduce the issue? So that I can investigate further on this issue.

Thanks,
Dhivya.

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;