System.NullReferenceException when setting form field value

Hi,

I am getting a System.NullReferenceException when trying to set a value to a acro form field.

This is in a project targeting .Net 6 using Aspose.PDF 22.7.0. The pdf that I am using is attached to this ticket.

Here is my code:

License license = new License();
license.SetLicense(new MemoryStream(licenseBin));



string path = @"C:\Dev\Testing\PDF_Eval";
string pdfTemplate1 = Path.Combine(path, "f941pr.Q2.2022.LT.PDF");
string outPdf1 = Path.Combine(path, "outPdf1.pdf");


byte[] template = File.ReadAllBytes(pdfTemplate1);

Document pdfDocument = new Document(new MemoryStream(template));


var fld = pdfDocument.Form["topmostSubform[0].Page1[0].Header[0].EntityArea[0].f1_5[0]"] as Field;

if (fld != null)
{
    fld.Value = "test 123";  // Error here
}

var outSream = new MemoryStream();


pdfDocument.Flatten();

pdfDocument.Save(outSream);

var outBytes1 = outSream.ToArray();
File.WriteAllBytes(outPdf1, outBytes1);

Thanks
Alexf941pr.Q2.2022.LT.PDF (159.5 KB)

@Alex.Shipov

We have logged this problem in our issue tracking system as PDFNET-52190. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

Hi,

Do you have any updates on this issue?

Thanks

@Alex.Shipov

The ticket has recently been logged in our issue tracking system and we are afraid that it has not been yet investigated. However, we will surely investigate and fix it on first come first serve basis and inform you once we have definite updates about its resolution. Please be patient and spare us some time.

We apologize for the inconvenience.

The issues you have found earlier (filed as PDFNET-52190) have been fixed in Aspose.PDF for .NET 22.12.