vinoth4390
(Vinothkumar)
October 7, 2024, 4:47pm
1
I have requirement to check the input pdf has editable form fields or not. Does anyone has experience in such thing… If yes please mention the procedure or any blog also helpful
Anil_G
(Anil Gorthi)
October 7, 2024, 4:58pm
2
@vinoth4390
You can use itext7 library for that…using which you can retreive form fields and check the count to see if any fields are retrieved or not
@May_Prince
Please try this
Dim pdfDocument As New iText.Kernel.Pdf.PdfDocument(New iText.Kernel.Pdf.PdfReader("PDFFilePath"))
Dim form As iText.Forms.PdfAcroForm = iText.Forms.PdfAcroForm.GetAcroForm(pdfDocument, True)
Dim fields As IDictionary(Of String, iText.Forms.Fields.PdfFormField) = form.GetFormFields()
For Each fieldName As String In fields.Keys
Dim field As iText.Forms.Fields.PdfFormField = fields(fieldName)
Dim value As String = field.GetValueAsString()
Console.WriteLine…
Cheers