This video explains how to prepare a form to perform automatic field calculations.
- [Instructor] Another powerful ability of Acrobat DC you can take advantage of when building interactive forms, is its ability to automatically perform field calculations. This can really come in handy with documents like order forms, time sheets, or any other file where you might otherwise have to manually add or multiply, or perform other calculations in your fields. Having Acrobat do it instead is a lot faster for both the person filling out the form, and the person receiving the form, and it eliminates the possibility of calculation errors. Let's see how to set this up. I've opened up this file called, "H+ Sport order form." This is an order form for a fictitious sport drink company. Now, looking at this, we should already know how to create the fields on this document, so the user can enter their name, address, and so on. What I want to focus on here, is the order form section. And all we really need to do here, is to create text fields for the quantity and total columns. As we we previously saw, we can probably use Acrobat's form wizard to automatically create these fields for us, since they're all nicely outlined and have column headers. Acrobat should have no problem detecting these fields. But I want to show you how to set this up manually, because there's some important things to be aware of that could save you some time later. So I'm going to come up to Preferences. And it'll be Edit > Preferences on the Windows. And with "Forms" selected, I'm going to turn off "Automatically detect Form Fields." Then I'll click "OK." And over here in the "Tools" panel, I'll choose to "Prepare Form." Again, form field auto-detection is off, and I'll click "Start." Alright, so let's select the Text Field Tool. I'm going to draw my first field in this first cell here, under "Quantity." Like so. And I'll call it, "Quantity." Now you may think that we'd want to add a number or some other way to distinguish it from the other three quantity fields in this column, but we'll see an automatic way to do this in a moment. Let's open up "All Properties." Under "Appearance," the Border and Fills are already set to Transparent, which is what I want in this case, since there's already a border and background color designed into this field. I am going to make the font a little bit smaller, though. Just select "10." And we'll see how that looks shortly. Next, I'm going to go to the "Format" tab. And for format, since I'm looking for a quantity, I'm going to choose "Number." Meaning only numbers will be allowed in this field. I won't need any decimal places, because we can only use whole numbers for the number of items to be purchased. So I'll choose zero decimal places, so I don't need to worry about any of this other information below. Under the "Options" tab, I'm going to choose an alignment of "Center." So the numbers will be centered right in the field. And I'll close that. Now I plan on copying this field to the other Quantity fields, so it's a good idea to test it to make sure it looks the way I intended before I make my copies. So I'll click "Preview," and I can click in that field, and type the number. But I can't type any letters, or any other characters. And you can see the text is centered, and I think it looks okay at this size. So I'll just delete that out of there, and let's go back to Edit Mode. Now I want to copy this field, and paste it three more times into the remaining Quantity rows. Now we know that you can Option + Drag on the Mac, or Ctrl + Drag on Windows to make copies, and then I can just rename this field to maybe, "Quantity.1." But let me show you another way. I'm going to press Ctrl or Command + Z to undo that. So instead, I'm going to right click on this field. And choose, "Create Multiple Copies." This opens a dialog box, and I can choose to create copies down, across, or both. In this case, I want to copy the selected field down, four times. It counts the original field as a copy, so we want a total here of four. Now, for across, I only want one times. Because, again, it counts the original field as a copy. With "Preview" checked on here, if you look at the document, you can see how this will look. I'll click "OK," and there are my fields. And notice how Acrobat has named them. It added a dot zero after the first field, and then dot one, and dot two, and so on. So each field has a unique name, but you can still tell which group they belong to. If necessary, you can select individual fields to reposition them. This one looks a little bit low, so I'll just select it. And use the arrow key on my keyboard to readjust it, or you can just use your mouse. Alright, so that's the Quantity column. Next, I'm going to generate my Total fields. Instead of just drawing a field from scratch, though, I'm just going to Option + Drag, or Ctrl + Drag on Windows, the first field here to the right. That way we know these fields will have a consistent height between them, and now I can adjust its width to fit inside that cell. I'll double-click it to open its properties, and I'll name this "Total." Under "Options," I'm going to align the content to the right, which is how you normally display numbers in a Total column. Under "Format," this is still going to be formatted as a number, but since we're dealing with dollars and cents, I'm going to allow for two decimal places. I'll leave everything else here untouched. Now there's one more thing I want to do with this field. The goal here, is to set up this form, so the user won't have to perform this calculation themselves. I want this Total field to automatically complete itself based on the quantity the user enters in this row. So, I'm going to go to the "General" tab, and here, I'm going to check, "Read Only." That prevents the user from clicking this field and typing anything in. Alright, we'll go ahead and close this. And now, let's create the copies. I'm going to right click again, and choose "Create Multiple Copies." Now, since this field is the same size as the other fields below it, including the Subtotal, Tax, and Grand Total fields, I'm going to save some time by duplicating it into all of these fields, and then I'll just change the names. So I'll create seven fields down, one across, and I'll click "OK." And Acrobat copies and names all of those fields. So now, just fix the names of the last three here. And all of these fields are going to be read only, and they all share the other properties of the Total field, so I don't need to change anything else. Now after duplicating your fields, especially if you duplicate a lot of them, you might find that the positioning starts looking a little off. So, in this case, I'll just select the fields that need a bit of adjusting, and again, I can just use my arrow keys on my keyboard to reposition them a bit. Alright, so now we've got the Quantity and Total fields created. But before we start telling Acrobat which fields need to be calculated together, we need to create a couple more fields so Acrobat knows how much each item costs. And we'll take a look at how to do that next.
- Exporting PDFs from other popular applications
- Creating text fields
- Adding check boxes, radio buttons, and drop-down lists
- Using bar codes
- Using the Form Wizard
- Performing calculations in fields
- Working with signatures
- Distributing forms