When filling in forms in PDF files, individuals can miss important parts, or enter incorrect info due to the manual nature of completing the form. This can spell problems when businesses or organizations then need to enter this information into standardized forms or document layouts. Bureaucratic agencies in particular can be very picky about this.
Zingtree provides a streamlined way to fill in forms in PDF files to help alleviate this pain point. Using Zingtree’s data-gathering capabilities, as well as decision tree branching to get the desired data in the most efficient way, end-users can be guided towards completing forms accurately. This is a powerful tool for a number of organizations, such as government agencies requiring documents in a specific format, or insurance companies collecting accurate information on policyholders.
Here is a step-by-step guide to demonstrate how Zingtree can be used to ensure that your PDF form is completed efficiently and accurately.
PDF File Requirements
There are a couple of things to make sure of when using a PDF file as a form:
- In some cases, your PDF files will need to be converted to be used properly. Files created in Fast Web View mode, or as containers for streaming objects must be converted. We recommend a free utility called pdftk to do the conversion. From the command line, you can run it like this:
pdftk myfile.pdf output mynewfile.pdf
- Your PDF forms cannot have two fields with the same name. But you can rename fields such that a single variable is used in multiple places. So if you have a form field called name, you can make other form fields called name__2, name__3 etc. All these fields will be replaced with the variable called name from your session. If you have a form field used more than once, it won’t be recognized.
Set-Up
Zingtree has built a special webhook to enable this handy use of the platform. Here’s how to set this up:
- Upload your PDF form file to a server. We’ll need the URL of this file.
- Create a decision tree that gathers the information to be merged into the PDF form. The variable names you use in Zingtree must match the variable names in the PDF form file.
- Install the Zingtree PDF form filler webhook. Go to Account Settings, My Apps, then click Add Webhook, and enter the following into the webhook URL.
https://zingtree.com/apps/webhook/lib/pdf-form.php
Like this:
- In your decision tree, add this webhook to a node after you have gathered all of your data. Like this:
The message data passes along a parameter for the URL Encoded URL of the PDF file (from step 1). Like this:&pdf_form={{URL Encoded URL of Form File}}
Here’s an example of a proper parameter, with a URL Encoded URL forhttp://zingtree.s3.amazonaws.com/samples/PDF-Form-demo.pdf
&pdf_form=http%3A%2F%2Fzingtree.s3.amazonaws.com%2Fsamples%2FPDF-Form-demo.pdf
- When you run the tree, the URL of the merged form will be contained in the variable pdf_merged_file_url.
- Option: You can customize the variable name if you choose by adding &result_var=YOUR_VAR_NAME to the end of the message data. This would assign YOUR_VAR_NAME to the uploaded URL instead. Example:
&pfd_form={{URL of FORM}}&result_var=my_pdf_form_upload
At the end of the process, a PDF with the merged form fields will be uploaded to the Zingtree servers, accessible at the URL in pdf_merged_file_url or a variable you chose in step 6.
Demo
We will fill in a PDF file located here. The PDF has the fields name, address, city and phone.
Bonus Content: How to create a Fillable Form PDF with Adobe Acrobat DC
- Using Adobe Acrobat Pro, go to Tools > Prepare Form
- Select Create New and then click Start. A new untitled page will open.
- Do a Create Label (Text) and Text Field (Fillable box/value) by clicking on the toolbar icons shown below:
- Right-click on the Text Field to open properties (shown below). You may change the name but make sure you use the same variable name in your Zingtree decision tree.
- After creating all the fields, the form looks like this:
- Save the file (PDF) and host it on your server. Zingtree will need a URL for this file.
You may also refer to this article from Adobe.