Private Function GetPDFFormFields(ByVal pdfform As String) As String Dim pdfformfields As String ' create a new PDF reader based on the PDF template document Dim PdfReader As PdfReader = New PdfReader(pdfform) Dim fieldlist As New ArrayList(PdfReader.AcroFields.Fields.Keys) fieldlist.Sort() ' 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 For i As Integer = 0 To fieldlist.Count - 1 sb.Append(fieldlist(i).ToString + Environment.NewLine) Next ' Write the string builder's content to the form's textbox pdfformfields = sb.ToString() Return pdfformfields End Function