Populating a PDF Form
You can populate fields in a PDF document with data from various sources, including a database, shipping label, or XML.
Set up your variables
- If your PDF file includes more than one page, create a variable and set its value to the system variable, Page Number. Your PDF document can be any number of pages. This example uses the name ThePage.
- Create a variable and set its value to the system variable, Full Data File Name. This example uses the name FileName.
- Create other variables from your data source that you want to add to the PDF file.
Set up the PDF document
- Create a Load Image rule and set the Use variable field to the variable you defined in Step 2 above, which contains the data file name. To create a Load Image rule, right click the form > Add Rule > Load Image:
- In the Load Image Action window, set the Default resolution to 300.
- Click PDF File using the Rule Variable.
- If your PDF document has more than one page, in the Page area, click Variable, and then select the variable you created in Step 1 of “Set up your variables” above.
- Click OK.
Place your variables
Each variable must be set with a Place Text rule. Complete these steps for each occurrence of each variable on each page. You can place the same variable multiple times on multiple pages.
- Right click the form > Add Rule > Place Text.
- Name the rule and select the variable to place.
- In the Place Text Action window, specify the position. You can drag the text to fine position it later.
- Click Change font and specify the font attributes to use. Click OK.
- If your PDF file contains multiple pages, set a condition so the variable does not show up on every page. Right click the rule > Add AND condition > Is equal to. Set the page number, and then click OK. The following example shows a condition to show the variable only on page 2:
- Verify that you see the variables in the correct positions on each page.
- Save your updated project.