Hi,
I am trying to set value to a form field using aspose.pdf for .net. There is a number formatting being provided in the pdf template which is not applied after i set the value.
below is the sample code i am using
string fileName = “FormTemplate.pdf”;
string filePath = Path.Combine(GetCurrentDirectory(), “GeneratedForms”, fileName);
Document pdfDocument = new Document(filePath);
TextBoxField field = pdfDocument.Form[“fieldName”] as TextBoxField;
field.Value = “-372002.7100000”;
I even tried adding below code to make it work but not getting the expected output
field.Actions.OnModifyCharacter = new JavascriptAction(“AFNumber_Keystroke(0, 0, 2, 0, ‘’, true)”);
field.Actions.OnFormat = new JavascriptAction(“AFNumber_Format(0, 0, 2, 0, ‘’, true)”);
the expected output should be (372003).
below is the pdf screen shot for your reference
image.png (9.3 KB)
image.png (131.3 KB)