PDF - Get Field Value

Declaration

<AMPDF ACTIVITY="get_value" SOURCE="text" PASSWORD="text (encrypted)" FIELDNAME="text" RESULTVARIABLE="text" />

Description:

Retrieves the value of a form field in a PDF document according to its name and populates an existing variable with the results. Use the Get field(s) activity to retrieve information about one or more form fields contained in a PDF document.

NOTE: Use the Get field(s) activity to retrieve information about one or more form fields contained in a PDF document.

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 the value of a particular form field contained in a PDF file.

Parameters

Resource

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

Property

Type

Required

Default

Markup

Description

Field name

Text

Yes

(Empty)

FIELDNAME="field1"

The name of the form field to retrieve value from. Use the Get field(s) activity to retrieve information about one or more form fields contained in a PDF document.

Populate variable with field value

Text

No

(Empty)

RESULTVARIABLE="varName"

The name of an existing variable in which to populate the field value.

Description

Error Causes

On Error

Example

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

Description: Get "field1" field value and store into variable "myVar". Existing PDF "c:\temp\sourceFile.pdf".

 

<AMPDF ACTIVITY="get_value" SOURCE="c:\temp\sourceFile.pdf" PASSWORD="AM2X8RGOSnCwfUrxCM5UcK19Q==aME" FIELDNAME="field1" RESULTVARIABLE="myVar" />