Get/Set form TextField format using Aspose.PDF for .NET

Hello,
In Adobe Acrobat I can set format category for my text fields, like on the image attached.
PdfFormat.PNG (39.4 KB)
Is it possible to read this setting using Aspose.PDF for .NET?
Is it possible to set the format for text field when adding field to the pdf form?
Is it possible to do validation on such fields (no matter how they’ve been added through Acrobat or Aspose.PDF)?

Thanks,
Drasko

@Draxtor

Thanks for contacting support.

Yes, you can apply validation over text box fields using JavaScript actions. Please check following article in API documentation to set JavaScript action.

Thanks Asad,
Can you confirm when JavaScriptAction class has been added?
I’m using 19.4 and Actions.OnFormat is throwing exception and in 20.5 it i s working fine.
It covers all my needs

@Draxtor

Would you please share which exception you are facing with 19.4 version of the API. The JavaScriptAction Class should be present in the version you are using as it was introduced in January 2011. It is also possible that there could be some issue in 19.4 version which has now been resolved in latest version of the API.

1 Like

Hello Asad,
that’s why asked you. I’ve been installed both 19.4 and 20.5 and my nuget packages got confused. After I cleared and reinstalled your example is working in 19.4 and I can use JavaScriptAction.
However in 19.4 exception is thrown when I try to do ToString() on PdfAction object. Same code is working in 20.5.
thanks

@Draxtor

Thanks for your feedback.

If the issue is not occurring using the latest available version of the API, we request you to please upgrade your existing version as support is provided on the basis of latest version usage. In case you face any issue using latest version, please feel free to let us know.