Hello!
We have a PDF file which we want to fill with customer info such as name etc. I'm trying to copy your example : Fill Form Fields in PDF File in C#
The problem is, I can't convert a PDFField (or even check which typeof it is) to another type (for example to PDFTextBoxFieldWidget). I get a syntax error saying "PDFField can never be of type PDFTextBoxFieldWidget". This is on row 014 to 015 in your example :
014 If TypeOf field Is PdfTextBoxFieldWidget Then
015 Dim textBoxField As PdfTextBoxFieldWidget = TryCast(field, PdfTextBoxFieldWidget)
Dim pdfMall As New PdfDocument
pdfMall.LoadFromFile("test.pdf")
Dim formWidget As PdfFormWidget = TryCast(pdfMall.Form, PdfFormWidget)
For i As Integer = 0 To formWidget.FieldsWidget.List.Count - 1
Dim field As PdfField = TryCast(formWidget.FieldsWidget.List(i), PdfField)
If TypeOf field Is PdfTextBoxFieldWidget Then <-- This is not working for me (since field already has a type)
End If
What am I doing wrong here?
Best,
Elin