When you are defining a PDF form field map in the Prepare PDF Form UI, you can specify that the source for a particular PDF field is either a data element, or a script.
If one or more scripts are specified, then the scripts need to be defined in a place that the MergePDFForm function knows about.
The way that the MergePDFForm works is that, if it finds a script invocation in the PDF field map, then it searches for a script definition. Suppose the PDF form is called “ABC-File.pdf”, then MergePDFForm will look (in the same folder as the PDF form) for an XpressDox template called “ABC-File.scripts.xdtpx”. If that file does not exist, then it will search for a template called “PDFScripts.xdtpx”.
This means that if you have a number of PDF forms that use the same scripts, then you can use the PDFScripts.xdtpx template instead of making a .scripts.xdtpx for each PDF form.
The scripts template does not need to contain the scripts themselves, but can reference another scripts template that you have. This is done in the normal way, using the IncludeTemplate command (or the IncludeCodeTemplate command).
A very useful side effect of this feature is that you can use, not only scripts, but XPATH expressions, in the PDF field map. So that if you need, for example, the month of signature in a PDF form field, instead of setting a data element to the month and then defining that data element in the field map, just put FormatDate(DateOfSignature,’MMMM’) into the field map.
These two features are available with version 11.4.0, and so you would need to be licensed for XpressDox version 10.5 or later to make use of them.