>And, I also try this which doesn't give any error but doesn't get in the For/Each:
>
>
>Dim lcKey As String = ""
>
>For Each lcKey In oPdfReader.AcroFields.Fields.Keys
> System.Windows.Forms.MessageBox.Show(lcKey)
>Next
>
>
>If you try that, are you able to see your fields?
I'm not at my desk right now but looking at the code above I am not sure this is an implementation of iEnumerable and if it is that lckey won't be a string but will be an object you'll need to cast as a string or find a string property within it.
I'm afraid I'm not really an expert, I just remember playing with it for about a week three years ago until I got it to do everything I wanted. I googled a lot of questions and found answers and Stackoverflow was extremely good as a resource to get questions answered - lots of people in the C# community use iTextsharp and there are also a lot of Java folks there who use iText.
But rather than try to simplify it for right now if I were you I'd take the code I posted and mimic that as exactly as you can until you get something working and then simplify that.
By the way, you may be right that the pdfs are not forms - why not open one in Acrobat or Foxit Phantom and you'll know right away. If you are going to be doing any work with PDF forms you are going to need one of those anyway and you may find if you have only a dozen forms it is faster, depending on the fields. The forms I was dealing with went into the hundreds and had hundreds of fields so it was necessary to automate analyzing them, but I still needed Foxit Phantom or Acrobat to make changes to make field names consistant etc.
Charles Hankey
Though a good deal is too strange to be believed, nothing is too strange to have happened.
- Thomas Hardy
Half the harm that is done in this world is due to people who want to feel important. They don't mean to do harm-- but the harm does not interest them. Or they do not see it, or they justify it because they are absorbed in the endless struggle to think well of themselves.
-- T. S. Eliot
Democracy is two wolves and a sheep voting on what to have for lunch.
Liberty is a well-armed sheep contesting the vote.
- Ben Franklin
Pardon him, Theodotus. He is a barbarian, and thinks that the customs of his tribe and island are the laws of nature.