Q:

how to get PDF fields names? 

I want to list the names of all my PDF fields with iTextSharp.  That's what i got so far :
protected void btnPDF_click(object sender, EventArgs e)
{
    MemoryStream ms = new MemoryStream();

    PdfReader lecteur = new PdfReader(Server. MapPath("~/Img/f16.pdf"));
    PdfStamper etampeur = new PdfStamper(lecteur, ms);

    AcroFields af = lecteur. AcroFields;

    foreach (KeyValuePair<string, AcroFields. Item> fil in af. Fields)
    {
        lblErreur. Text += fil. Key. ToString() + "<br />";
    }

    lecteur. Close();
    etampeur. Close();
}

found everything on :
How do I enumerate all the fields in a PDF file in ITextSharp
But strangely, it does not work, that's the error i get :

InvalidCastException :
The specified cast is not valid. 

I tried every workaround i knew... but i ran out of ideas...

A:

Ok, i felt on this :
http://www.4guysfromrolla.com/articles/030211-1.aspx
and seems like this works : 
using System. Collections;

foreach (DictionaryEntry fil  in af. Fields)
{
    lblErreur. Text += fil. Key. ToString() + "<br />";
}

Sorry... i found that rigth after posting my question...

