Getting Form Field Information

Introduction

Form fields include text boxes, multi-line text boxes, check boxes, combo boxes, list boxes, buttons, radio buttons, and signatures. In this chapter, you will learn how to retrieve a list of form fields using the -formfield option.

The figure below shows the form fields on the third page of the ApUtilsSample.pdf file supplied with APGetInfo.

Form fields on page 3 of sample file

Retrieving a Simple List of Form Fields

Use the -formfield option to list all of the form fields in a PDF document.

Command

$apgetinfo -formfield inPDFFile

Windows Example

$apgetinfo -formfield C:\Appligent\APGetInfo\samples\ApUtilsSample.pdf

UNIX/Macintosh Example

$./apgetinfo -formfield /Appligent/APGetInfo/samples/ApUtilsSample.pdf

Result

The figure below shows the results of running apgetinfo with the -formfield option on the ApUtilsSample.pdf file. For each form field, the following information is returned: field name, field type, field value, and alternative name (tool tip text), if one exists. Note that the button field does not have a value. It is also the only field that has an alternative name.

Results from -formfield

The following table describes the value returned for each field type.

Field Type Common Name Value
Push Button Button None.
Radio Button Radio Button The export value of the button. In a group of radio buttons, the export value of the selected button.
Check Box Check Box The export value, if the box is checked.
Text Text Box The text in the box.
MultiLine Text Multi-line Text Box The text in the box.
ListBox List Box The export value of the selected item.
ComboBox Combo Box The export value of the selected item.
Signature Signature None.