Using a PDF with Calculations
When it comes to software that can create files with formulas and automatic computations, you likely have a spreadsheet program like Microsoft Excel or Google Sheets in mind. However, the nature and formatting of spreadsheets make them unwieldy and impractical to use as a form that you distribute to people.Fortunately, Adobe Acrobat, the top-of-the-line PDF creation suite, has several tools that allow you to make fields with automatic computations in them.
There are many potential use cases for a PDF with a calculated form, such as:
- Order Forms: If you’re handing out a form filled with possible products and their prices to a customer, you can create a field that quickly displays the final price of their order without having to pull out a calculator.
- Assessments and Exams: You can make a quiz or assessment that automatically displays the score when you’re done answering.
- Invoices: If you’re creating a printed invoice, you can set it to display the final amount you’re charging automatically.
Making Simple Calculated Fields
To start, go into Acrobat, and create a form. Click “Tools” on the upper right of the screen, scroll down, and select “Prepare Form”. From here, you can start a new form from scratch, or base it off of an existing PDF or document file that you already have. Importing a file will give you the option to populate boxes with fillable fields automatically. Whether or not you do this is unimportant, as you can always edit and create these fields later.![Order Form for Tech Company](https://www.howtogeek.com/wp-content/uploads/2020/04/xAcrobat-Fields.png.pagespeed.gp+jp+jw+pj+ws+js+rj+rp+rw+ri+cp+md.ic.fCQ5pH_eFm.png)
To better understand how to make a calculated form, let’s start with an example. Above is a simple order form with seven fields: Quantity 1 to Quantity 5, where each field corresponds to different item quantities; Total Quantity; and Total Price. We want the five quantities to be fillable fields that users can input themselves, while the Total Quantity and Total Price fields are automatically computed.
![Acrobat Text Field Properties](https://www.howtogeek.com/wp-content/uploads/2020/04/xAcrobat-Read-Only.png.pagespeed.gp+jp+jw+pj+ws+js+rj+rp+rw+ri+cp+md.ic.QvrzY4VDi7.png)
To make sure a field is fillable, double-click it, or right-click and go to Text Box Properties, and leave the Read-Only box unchecked.
Because all of our quantity boxes are fillable, we need to create a computation for our Total Quantity field. Select the box, then go to Text Box Properties > Calculate. From here, we can do one of two things: you can select the second option to pick one of the preset calculations, such as sum, product, or average; or you can choose the third option to create a simplified field notation formula. For this example, we’ll use the preset calculations and select “sum”.
![Acrobat Automatic Formulas](https://www.howtogeek.com/wp-content/uploads/2020/04/xAcrobat-Sums.png.pagespeed.gp+jp+jw+pj+ws+js+rj+rp+rw+ri+cp+md.ic.jc6zIBixmx.png)
Click Pick, and you’ll be brought to a menu where you can select all the fields you want to sum together. Select all the fields you want to include, then click OK. You’ll notice that your field’s value changed to 0.
![Acrobat Field Selections](https://www.howtogeek.com/wp-content/uploads/2020/04/xAcrobat-Input-Fields.png.pagespeed.gp+jp+jw+pj+ws+js+rj+rp+rw+ri+cp+md.ic.2qt_wc93Az.png)
Using the Simplified Notation
Next, we want to create a computation for our Total Price field. Unlike Total Quantity, we can’t simply sum up a set of fields. We need to create a series of equations.To do that, we can use the Simplified Notation format. Select the Total Price box, go to Text Box Properties > Calculate, and select the third option. You’ll be able to input a formula into a text box by clicking the Edit button.
![Acrobat Blank Simple Notation](https://www.howtogeek.com/wp-content/uploads/2020/04/xAcrobat-Simple-Field.png.pagespeed.gp+jp+jw+pj+ws+js+rj+rp+rw+ri+cp+md.ic.EDthkIq-aI.png)
For simple arithmetic computations, this formula box works very similarly to an Excel formula box. Simply type in the field names of the quantity boxes, and you’ll be able to add, subtract, multiply, or divide them with other numbers. You can also place computations in parentheses to segment them. For reference, here are the modifiers for basic arithmetic calculations:
- Add: +
- Subtract: –
- Multiply: *
- Divide: /
(Qty1*5)+(Qty2*7)+(Qty3*7)+(Qty4*12)+(Qty5*20)Inputting the above formula will multiply each quantity by their respective price, and will generate the final price.
![Acrobat Filled Simple Notation](https://www.howtogeek.com/wp-content/uploads/2020/04/xAcrobat-Simple-Field-Formula.png.pagespeed.gp+jp+jw+pj+ws+js+rj+rp+rw+ri+cp+md.ic.nyhxg0RLqK.png)
If, for example, we wanted to order 3 USB Drives, 2 Apple Lightning Cables, and 1 10000 mAh Battery Bank, we’d get the following result:
![Acrobat Total Price](https://www.howtogeek.com/wp-content/uploads/2020/04/xAcrobat-Final-Output.png.pagespeed.gp+jp+jw+pj+ws+js+rj+rp+rw+ri+cp+md.ic.2k4MVjW1DR.png)
Filling, Saving, and Complex Calculations
Before you save your file, set any boxes you don’t want to be editable to Read-Only in the Text Box Properties. Anyone opening the PDF form won’t be able to edit those fields.Save your document as a standard PDF file, and it should be a fillable form on any document viewing software, including web browsers. After it’s filled out, it can then be saved or printed just like any other PDF file.
Because the calculation system in PDF files is based around Javascript, you can do a lot of advanced things with it. If you’re interested in learning more, you can go to Adobe’s website to read about all the various modifiers you can use, as well as creating custom calculation scripts that allow you to have conditional formatting and formulas that let you modify text.
Post a Comment