PDF - Get Fields

Declaration

<AMPDF ACTIVITY="get" SOURCE="text" PASSWORD="encrypted 
text" FIELDNAME="text" RESULTDATASET="text" PAGE="number" />

Description: Retrieves information regarding all form fields contained in a PDF document or specific form fields defined by the field name and populates a dataset with results.

Practical Usage

PDF form fields allow information to be entered interactively by the user. A PDF document may contain any number of form fields appearing on any combination of pages, all of which make up a single, global interactive form spanning the entire document. This activity retrieves information about all existing form fields in a PDF document to perform other activities on them, such as Fill fields, Get field value or Disable fields.

Resource Parameters

Property

Type

Required

Default

Markup

Description

Resource

---

---

---

---

Indicates where the source PDF should originate from. This is a design mode parameter used only during task construction and configuration, thus, comprises no markup. The available options are:

  • File (default) - Specifies that the source PDF derives from a file located on the system. This option is normally chosen if only a single activity is required to complete an operation.

  • Session - Specifies that the source PDF is obtained from a pre-configured session created in an earlier step with the use of the PDF - Create session activity. This options is normally chosen if a combination of activities within the same action group are required. Linking several activities to a single session eliminates redundancy and improves efficiency. Several sessions can exist in a single task. In addition, multiple sessions can run simultaneously without interference.

Session

Text

Yes if Resource parameter is set to Session

PDFSession1

SESSION="mySession"

The name of an existing session to associate this activity with. This parameter is active only if the Resource parameter is set to Session.

Source PDF

Text

Yes if Resource parameter is set to File

(Empty)

SOURCE="C:\temp\source.pdf"

The path and file name of an existing PDF document in which to extract contents from. This parameter is active only if the Use previously created session parameter is disabled.

Password (optional)

Text

Yes if Resource parameter is set to File

(Empty)

PASSWORD="encrypted"

The password required to open the existing PDF document (if required).

Data Parameters

Property

Type

Required

Default

Markup

Description

All Fields

---

---

---

---

All form fields that exist in the PDF document will be retrieved. This is a visual mode parameter only used during design time, therefore, it contains no properties or markup.

Specific field names

Text

No

(Empty)

FIELDNAME="field1"

The name of the signature to remove. Use the Get signature(s) activity to retrieve available signatures.

Create and populate dataset

Text

Yes

(Empty)

RESULTDATASET="myDataset"

The name of the dataset to create and populate with form field information. For more details, see Datasets below.

Pages Parameters

Property

Type

Required

Default

Markup

Description

All

---

--- --- ---

Form field information will be retrieved on all pages of the source PDF document. This is a visual mode parameter only used during design time, therefore, it contains no properties or markup.

Page(s)

Text

No

(Empty)

FIELDNAME="Field1"

Form field information will be retrieved from an individual page or specific pages of the PDF document. Enter the page number to specify a single page (e.g., 2 or 4). Use a comma (,) to specify more than one page (e.g., 1,3,5). Use a dash (-) to specify a range of pages (e.g., 5-10).

Description tab - A custom description can be provided on the Description tab to convey additional information or share special notes about a task step.

Error Causes tab - Specify how this step should behave upon the occurrence of an error. (Refer to Task Builder > Error Causes Tab for details.)

On Error tab - Specify what AWE should do if this step encounters an error as defined on the Error Causes tab. (Refer to Task Builder > On Error Tab for details.)

Datasets

A dataset is a multiple column, multiple row container object. This activity creates and populates a dataset with the following fields (rows):

Name

Type

Return Value

theDataset.FieldName

Text

The name of the form field.

theDataset.FieldType

Text

The type form field type (e.g., CheckBox, Text, Signature)

theDataset.FieldValue

Text

The value of the form field.

theDataset.Height

Number

The height of the form field.

theDataset.PageNumber

Number

The page number where the form field if located.

theDa taset.Width

Number

The width of the form field.

theDataset.X

Number

The X coordinate of the form field.

theDataset.Y

Number

The Y coordinate of the form field.

Example

The sample AML code below can be copied and pasted directly into the Steps panel of the Task Builder.

Description: Get all AcroForm fields. Create and populate dataset "theDataset" with AcroForm field(s) inform ati on. Existing PDF "C:\temp\sourceFile.pdf".

<AMPDF ACTIVITY="get" SOURCE="C:\temp\sourceFile.pdf" RESULTDATASET="theDataset" PAGE="1-3" />