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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Index was out of range.

Thread ID:





54458 Jan 9,2007 03:38 PM UTC Jan 10,2007 01:22 PM UTC WinForms 1
Tags: PDF
Miles McGehee
Asked On January 9, 2007 03:38 PM UTC

This is what I currently have...

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

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 01:22 PM UTC

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.



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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon