Using FormMaker and FormMaker Assistant
Note: This page is for an old version of FormMaker (pre version 3.0). For help with the latest version, click here.
The instructions for installing FormMaker are the same as for FormMagic, and can be found on the FormMagic help page.
1.1 Using FormMaker to Set the Visual Appearance of Fields and to Create Comb Fields
To learn how to format the visual appearance of form fields (whether text fields or dropdown lists, etc.) and how to create comb fields, refer to the FormMagic help page. FormMaker includes all of FormMagic‘s features, so everything written in that guide is applicable to FormMaker as well.
1.2 What Kind of Scripts Can be Added with FormMaker?
1.3 What Is the Difference Between the Types of Script?
2. Adding Scripts to Form Fields with FormMaker: The Basic Idea
Step 1: Add the script to the Script Label panel
To add a script to a form field, select the form field in InDesign, open the Script Label panel (Window > Utilities > Script Label), and type or paste the script there. To specify which type of script you want, add a comment-line before and after the script, as follows:
// FormMaker-Format Your format script goes here... // FormMaker-End
// FormMaker-Calculate Your calculation script for the selected field goes here // FormMaker-End
To add a document script to the PDF you must use FormMaker Assistant. Document scripts cannot be added by using the Script Label panel technique described above. Of course, while FormMaker makes it simple to attach scripts to the necessary form fields, it is not always so easy to know how to write the script in the first place! Also, sometimes, to get a single effect, two or more scripts must be written. For instance, to make a form field accept digits only, both a keystroke script and a validation script are necessary. The keystroke script prevents non-numbers from being entered, while the validation script makes sure that in fact nothing but numbers were entered (for instance, that the user did not paste non-numeric characters into the field). Luckily, for most of the standard stuff, FormMaker Assistant will write the script/s for you, so you can create complex interactive forms in InDesign without writing a single line of code. More on that below.
Step 2: Run FormMaker, export the interactive PDF, and run FormMaker in Acrobat as well
Once you have finished attaching scripts to your form fields in InDesign by typing or pasting the required scripts into the Script Label panel of each form field, run FormMaker in InDesign by double clicking on the script in InDesign’s Scripts panel. If all is well, you will see a message saying that the information has been successfully embedded in the document. Next, create the interactive PDF from your document by exporting it as an interactive PDF. Open the document in Acrobat. In Acrobat, you should find a new command at the bottom of the Edit menu called FormMaker. (If you do not see this command, FormMaker has not been properly installed. Refer to the installation guide for help.) Run this command and all FormMaker information attaches to the appropriate fields: The correct font, color, alignment, scripts, and more, are applied to each field. Save your PDF form at this point, and you’re done! Anyone opening the PDF on any desktop computer with the free Adobe Reader will now be able to use the fully formatted and scripted form! (Be aware that for reliable results, the user must open the PDF on a desktop computer using free Adobe Reader software. Opening the PDF in a browser, or on a tablet, or with non-Adobe software might lead to unexpected or incomplete results. There are many different PDF-reader applications out there, and not all of them support all PDF features. Moreover, on a tablet, at the time of writing, not even Adobe’s own reader supports all features that can be added with FormMaker. So again, for consistent, predictable results, the user must be told to open the PDF on a desktop computer with Adobe’s own free PDF reader software.) TIP: To reduce the PDF file size, before distributing the PDF run the “Purge FormMaker Data” command (it’s the last entry in the screenshot above). This removes the extra data that FormMaker uses initially. Doing so will not affect the PDF in any way. It just deletes FormMaker‘s unused and now redundant metadata.
3. Setting the Calculation Order
Calculation scripts need a bit of care! Remember that the way Acrobat works is that when the value of any field changes all the calculation scripts in the PDF are run, one by one. Clearly, the order in which the calculations are run is vitally important! For instance, if you have 10 “subtotal” fields and 1 “total” field in a PDF form, the values of the subtotal fields must be calculated before the total field is calculated, otherwise the total could be wrong! In Acrobat, a special “Calculation Order” panel allows the user to arrange the fields in the correct order for proper calculation of form values. Luckily, with FormMaker maker it is just as easy to set the calculation order of fields directly in InDesign, although the method is different than Acrobat. With FormMaker, a number at the end of the name of a form field (which is set in InDesign’s Buttons and Forms panel) decides the calculation order for the field. The higher the number, the later the field is calculated. For instance, if one field is called “Text Field 3” and another is called “Text Field 10”, and both have calculation scripts attached to them, the calculation script attached to Text Field 3 will be run before that of Text Field 10. Note that the numbers do not need to be consecutive. They are simply sorted in ascending order, with the smaller numbers being calculated first, and the larger numbers later. Tip: When adding numbers to the end of field names in InDesign, consider using multiples of 10 initially (e.g., Field 10, Field 20, Field 30, and so on). That way, if you ever need to insert an extra field to be calculated after Field 10 but before Field 20, you can add 15 to the end of its name. This will avoid having to renumber all other fields whenever you insert a new one.
4. FormMaker Assistant