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