troubleshooting Question

Find form fields in pdf file

Avatar of kdeutsch
kdeutschFlag for United States of America asked on
Adobe AcrobatASP.NETVisual Basic.NET
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)
        Next

        ' Write the string builder's content to the form's textbox
         response.write(sb)

    End Sub
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 1 Answer and 8 Comments.
Join the Community
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