1

I'm using Aspose PDF to read a PDF, some fields have Format restrictions (ie. The format is set as Number, then no chars can be inputted into the field). However; when I'm trying to fill a field using Aspose PDF, is there any way let Aspose check a field's format before it enters the value?

Aspose.Pdf.Facades.Form form = new Aspose.Pdf.Facades.Form(AppDomain.CurrentDomain.BaseDirectory + "test.pdf");

try
{
    form.FillField("percentage_Textbox", "testing");
}
catch (Exception)
{
    // This never triggers
    Console.WriteLine("Error");
    throw;
}
form.Save(AppDomain.CurrentDomain.BaseDirectory + "test(output).pdf");

This is the code I'm using. What I'm expecting is when it's filling this field, it will result an error, since this field's format in Acrobat is set as a number field.

Kewin Dousse
  • 3,880
  • 2
  • 25
  • 46
Hellack
  • 11
  • 2
  • This post is from 2012, but it looks like you need to use the Aspose API to create some javascript that will do the validation while the document is open & being interacted with. http://www.aspose.com/community/forums/thread/634985/pdf-form-field-input-masks-validation.aspx – james Aug 23 '16 at 21:22
  • My name is Tilal Ahmad and I am developer evangelist at Aspose. I am afraid currently Aspose.Pdf does not support validation of form field JavaScript. However we have logged an enhancement ticket PDFNET-41337 for same. You may follow [your post](http://www.aspose.com/community/forums/permalink/771577/771297/showthread.aspx#771297) in Aspose.Pdf forum for further details. – Tilal Ahmad Aug 25 '16 at 05:19

0 Answers0