javascript in pdf

javascript in pdf

Forum member · Feb 12, 2016
Is there a way to get the document level javascript to execute when loading a pdf in either the pdfdocument or the mergedocument? When I manipulate a form field in code, I would like that field to have the necessary formatting on it already performed, e.g. choosing to format currency, or a date field. I could perform this formatting in code, although, I do not see how to identify the field type, e.g. a dollar amount from an age field, etc. Any help would be appreciated. Thanks.

Re: javascript in pdf

Support · Feb 12, 2016
Hello, Document level javascript is designed to execute when the PDF is opened in a PDF Viewer. It is not possible to execute the javascript when the PDF is loaded into memory and modified using our API. There is no field type property that will allow you to identify a specific field by its content (currency, date, numeric value etc). You can identify whether the form field is a text box, radio button, combo box etc using the corresponding boolean flags available on the PdfFormField object. Thanks, ceTe Software Support Team.