troubleshooting Question

Find form fields in pdf file

Avatar of kdeutsch
kdeutschFlag for United States of America asked on
Visual Basic.NETASP.NETAdobe Acrobat
8 Comments1 Solution948 ViewsLast Modified:
I am trying to find out what the names of the fields are in a pdf file so that I can push data to them from my asp page.  I can see the file and save the fiel but I have no clue what the field names are.  Serched high and wide on web and every suggestion i use has dictionaryEntry which always errors out on me

itextsharp.text.pdf.acrofieldsItem cannot be converted to systems.collections.dictionary entry

 Private Sub ListFieldNames()
        Dim pdftemp As String = Server.MapPath("~/PDF/test.pdf")

        Dim pdfReader As PdfReader = New PdfReader(pdftemp)

        ' create and populate a string builder with each of the
        ' field names available in the subject PDF
        Dim sb As New StringBuilder()

        Dim de As New DictionaryEntry
        For Each de In pdfReader.AcroFields.Fields
            sb.Append(de.Key.ToString() + Environment.NewLine)

        ' Write the string builder's content to the form's textbox

    End Sub
Join our community to see this answer!
Unlock 1 Answer and 8 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 8 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros