Null reference when filling form field in PDF

Hello,

I am using Aspose.PDF for .Net 17.4 to fill a PDF form field using the following code:

Document pdfDocument = new Document(@“legal-aid-crm11-cost-summary (1).pdf”);
TextBoxField f = pdfDocument.Form[0] as TextBoxField;
f.Value = “test update”;

This throws a null reference exception when Value is being set - do I need to do something different here?
Form attached.

legal-aid-crm11-cost-summary (1).pdf (64.8 KB)

@jmurphy

We have managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as PDFNET-50986. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

@jmurphy

We have closed this issue as ‘Not a bug’. The form indexes must be in [1…n] range, so please use following code snippet to avoid this issue.

Document pdfDocument = new Document(MyDir + "legal-aid-crm11-cost-summary (1).pdf");
TextBoxField f = pdfDocument.Form[1] as TextBoxField;
f.Value = "test update";