PDF - Get field value

Declaration

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

Related Topics

Description

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

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

Practical Usage

PDF form fields allow information to be entered interactively by the user. A PDF file 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 --- --- --- --- Specifies the source of the PDF file. The available options are:
  • File (default) - The source derives from a PDF file located on the system. This option is normally selected if only a single activity is required to complete the operation.
  • Session - 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 option is normally selected if a combination of related activities is required to complete an operation. Consolidating several activities to a single session can eliminate redundancy. Moreover, a single task supports multi-session executions which can improve efficiency and speed up production.
NOTE: This parameter does not contain markup and is only displayed in visual mode for task construction and configuration purposes.
Session Text Yes, if Resource is set to Session PDFSession1 SESSION="mySession" The existing session to associate with this activity. This parameter becomes active and is required if the Resource parameter is set to Session.
Source PDF Text Yes, if Resource is set to File (Empty) SOURCE="C:\PDFFileName.pdf" The PDF path and file name of where to retrieve form field values. This parameter becomes active and is required if the Resource parameter is set to File.
Password (optional) Text No (Empty) PASSWORD="encrypted" The password required to open the PDF file (if required).

Field

Property Type Required Default Markup Description
Field name Text Yes (Empty) FIELDNAME="field1" The name of the form field to retrieve from the PDF file. Use the Get field(s) activity to retrieve information about one or more form fields contained in a PDF file.
Populate variable with field value Text Yes (Empty) RESULTVARIABLE="varName" The name of an existing variable to populate with the form 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.
  • Parameters containing user credentials, files, file paths, and/or other information specific to the task must be customized before the sample code can run successfully.

Description

This sample tasks retrieves information regarding a form field from an existing PDF file and then stores it a variable.

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