|
PDF - Get field(s) |
Declaration
<AMPDF ACTIVITY="get" SESSION="text" SOURCE="text" PASSWORD="text (encrypted)" FIELDNAME="text" RESULTDATASET="text" PAGE="number" />
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 Fill fields, Get field value, or Disable fields.
Parameters
Resource
Property | Type | Required | Default | Markup | Description |
---|---|---|---|---|---|
Resource | --- | --- | --- | --- | Specifies the source of the PDF file. The available options are:
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:
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:
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). |
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
- 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 extracts all form fields from a PDF file and then creates and populates dataset theDataset with form field information.
<AMPDF ACTIVITY="get" SOURCE="C:\temp\sourceFile.pdf" RESULTDATASET="theDataset" PAGE="1-3" />