Problem with setting form field value in a pdf that converts field values to uppercase

Hi,

I used Aspose pdf for filling form fields. In a specific pdf attached:
input3.pdf (477.5 KB)

I can not set field values. It doesn’t give any error. Just when it reaches the line of code to set the value, it stops and doesn’t go further and even nothing happened. no error and nothing. just stucks there.


Aspose.Pdf.Document doc = new Aspose.Pdf.Document(@"c:\temp\input3.pdf");

 foreach (var field in doc.Form.Fields)
 {
     if (field is TextBoxField textField)
     {
         textField.Value = "abc";   <------- LINE of ISSUE         
     }
 }

 var output_pdf_path = @"c:\temp\test2.pdf";
 doc.Save(output_pdf_path);


I used pdfSharp and seems it can set the value, I found the fields in this pdf has a setting to convert field value to uppercase. I guess this is the problem but I don’t know how to fix it with Aspose.
In pdf sharp it sets some form elements like this, without this code it doesn’t show the values but it never stucks, but Aspose stucks on the setting of value:

Setting of NeedAppearance in pdfSharp:

if (form.Elements.ContainsKey("/NeedAppearances"))
{
    form.Elements["/NeedAppearances"] = new PdfSharp.Pdf.PdfBoolean(true);
}
else
{
    form.Elements.Add("/NeedAppearances", new PdfSharp.Pdf.PdfBoolean(true));
}

@zhinous.shokrani
We are looking into it and will be sharing our feedback with you shortly.

@zhinous.shokrani
When checking, in my environment, when calling the specified line, an exception is thrown NullReferenceException: “Object reference not set to an instance of an object.”
I will create a task to fix it for the development team.

@zhinous.shokrani
We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFNET-58403

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Hi, May I ask what is the status of this ticket? Did you find and resolve the issue?

@zhinous.shokrani
Nothing new yet, unfortunately.