Hello,
I have a PDF AcroForm that I’m unable to process because I receive the following exception when using the “FieldsNames” property. Any help you can provide would be very appreciated.
Unable to cast object of type ‘Aspose.Pdf.InteractiveFeatures.Annotations.WidgetAnnotation’ to type ‘Aspose.Pdf.InteractiveFeatures.Forms.Field’"
The following code is enough to reproduce the exception:
string OriginalPdfPath = @“D:\temp\NCFAM94.pdf”;
Aspose.Pdf.Document doc = new Aspose.Pdf.Document(OriginalPdfPath);
Aspose.Pdf.Facades.Form form = new Aspose.Pdf.Facades.Form(OriginalPdfPath);
string[] fields = form.FieldNames;
The PDF document used for this example is attached.
Additional information:
Using Aspose version 7.1.0.0
- I have downloaded 7.2.0.0 and the same exception is thrown.