Aspose.Pdf - Form field not found Error

We are having issues with one particular PDF form that has some hidden fields used for calculations, formatting, etc. When we try to set the value of ANY field in this document it always throws the error “Form field not found : _AWW_4” even though we are NOT trying to set that hidden field’s value. Here is some sample code:

                Aspose.Pdf.Document pdfDocumentStream = null;
                string filePath = @"C:\temp\StatementOfWageTest.pdf";
                using (MemoryStream stream = new MemoryStream(File.ReadAllBytes(filePath)))
                {
                    pdfDocumentStream = new Aspose.Pdf.Document(stream);

                    // loop through all fields in the pdf document and set the text
                    foreach (Field formField in pdfDocumentStream.Form.Fields)
                    {
                        // for this particular pdf form that has hidden calculation fields it errors when setting the value of any field.
                        // for some reason it is looking for the hidden field "_AWW_4" even though we are NOT trying to set the value of that field. WHY??
                        formField.Value = formField.PartialName;
                    }

                    pdfDocumentStream.Save(@"C:\temp\WageStatementResult.pdf");
                }

This is the error/stack trace:
Form field not found : _AWW_4
Stack Trace:
at Aspose.Pdf.Forms.Form.get_Item(String name)
at Aspose.Pdf.Forms.Form.#=zXyXdfEi1yvub()
at Aspose.Pdf.Forms.Form.#=zbCF2Otc=()
at Aspose.Pdf.Forms.Field.set_Value(String value)
at Aspose.Pdf.Forms.TextBoxField.set_Value(String value)
StatementOfWageTest.pdf (750.7 KB)

I have also attached the pdf file. Thanks

@jchan71

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-56732

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.

Thanks @asad.ali

Just to confirm that this is a bug in Aspose and the internal issue ticket created is to fix this bug? That fix will be provided in an upcoming release of Aspose. Pdf?

Thank-you

@jchan71

Yes, you understood correctly. The issue will be resolved on first come first serve basis and as soon as it is resolved in X Version of the API, we will send a notification in this forum thread for your reference.

1 Like