PDF - Get field(s)

Declaration

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

Related Topics

Description

Retrieves information regarding all form fields contained in a PDF file 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 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 information about all existing form fields in a PDF file in order to perform other activities on them, such as PDF - Fill fields, PDF - Get field value, or PDF - Disable fields.

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 the Resource parameter 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 the Resource parameter is set to File (Empty) SOURCE="C:\temp\source.pdf" The PDF path and file name of where to extract form fields. This parameter becomes active and is required if the Resource parameter is set to File.
Password (optional) Text Yes, if the Resource parameter is set to File (Empty) PASSWORD="encrypted" The password required to open the existing PDF file (if required).

Field

Property Type Required Default Markup Description
AcroForm --- --- --- --- Specifies the form fields to extract. The available options are:
  • All field(s) - Extracts all form fields in the PDF file.
  • Specific field name(s) - Extracts one or more specified form fields in the PDF file.
NOTE: This parameter does not contain markup and is only displayed in visual mode for task construction and configuration purposes.
Specific field name(s) Text Yes, if AcroForm is set to Specific field name(s) (Empty) FIELDNAME="Field1" The names of the form fields to extract. Use a comma (,) to specify more than one field (for example, Field1,Field2,Field5).
Create and populate dataset Text Yes (Empty) RESULTDATASET="myDataset" The name of the dataset to create and populate with form field information. See Datasets for more information on the fields this dataset creates.

Pages

Property Type Required Default Markup Description
Page range --- Yes All --- Specifies the pages to extract form fields from in the PDF file. The available options are:
  • All - Extracts form fields from all pages in the PDF file.
  • Page(s) - Extracts form fields from one or more specific pages in the PDF file.
NOTE: This parameter does not contain markup and is only displayed in visual mode for task construction and configuration purposes.
Page(s) Text Yes, if Page range is set to Page(s) (Empty) PAGE="1,3,5" If enabled, specifies the pages to extract form fields from in the PDF file. For a single page, enter the page number. Use a comma (,) to specify more than one page (for example, 1,3,5). Use a dash (-) to specify a range of pages (for example, 5-10).

Description

Error Causes

On Error

Additional notes

Datasets

A dataset is a multiple column, multiple row container object. This activity creates and populates a dataset containing a specific set of fields in addition to the standard dataset fields. The table below describes these fields (assuming the dataset name assigned was theDataset).

Name Type Return Value
theDataset.FieldName Text The name of the form field.
theDataset.FieldType Text The type form field type (for example, 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.
theDataset.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

NOTE:
  • Copy and paste the sample AML code below directly into the Task Builder Steps Panel.
  • To successfully run the sample code, update parameters containing user credentials, files, file paths, or other information specific to the task to match your environment.

Description

This sample tasks extracts all form fields from a PDF file and then creates and populates dataset theDataset with form field information.

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