PDF - Set field(s)

Declaration

<AMPDF ACTIVITY="set" SESSION="text" SOURCE="text" PASSWORD="encrypted text" PDFDOCUMENTFROM="text (options)" NEWPDF="text" OVERWRITE="YES/NO" CREATEEMPTY="YES/NO" SAVETYPE="text (options)" DESTINATION="text" FIELDNAMES="text" FIELDVALUES="text" />

Related Topics

Description

Enters text into one or more form fields in a PDF file.

Practical Usage

Allows interactions to be performed on selected fields of 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.
Use Text (options) Yes, if Resource is set to File Existing PDF
  • PDFDOCUMENTFROM="existing_file"
  • PDFDOCUMENTFROM="new_file"
Specifies whether to add attachments to an existing or newly-created PDF file.  This parameter becomes active and is required if the Resource parameter is set to File. The available options are:
  • Existing PDF (default) - Attachments are added to an existing PDF file.
  • New PDF - Attachments are added to a newly-created PDF file.
Source PDF Text Yes, if Use is set to Existing PDF (Empty) SOURCE="C:\PDFFileName.pdf" The PDF path and file name of where to enter text. This parameter becomes active and is required if the Use parameter is set to Existing PDF.
Password (optional) Text No (Empty) PASSWORD="encrypted" The password required to open the existing PDF file (if required). This parameter becomes active if the Use parameter is set to Existing PDF.
On completion Text (options) Yes, if Use is set to Existing PDF Save
  • SAVETYPE="save"
  • SAVETYPE="do_not_save"
  • SAVETYPE="save_as"
Specifies how changes to the PDF file are saved upon completion of this activity. This parameter becomes active and is required if the Use parameter is set to Existing PDF. The available options are:
  • Save (default) - Changes are saved under the PDF file's original file name.
  • Do not save changes - Any changes made to the existing PDF file are not saved.
  • Save As - Changes are saved to a new path and file name.
Destination PDF Text Yes, if On completion is set to Save as (Empty) DESTINATION="C:\PDFFileName.pdf" The path and file name where the modified existing PDF file is stored. This parameter becomes active and is required if the On completion parameter is set to Save as.
New PDF Text Yes, if Use is set to New PDF (Empty) NEWPDF="C:\PDFFileName.pdf" The path and file name where the newly-generated PDF file is stored. This parameter becomes active and is required if the Use parameter is set to New PDF.
Overwrite if PDF already exists Yes/No No No OVERWRITE="YES" If selected, a PDF file with the same filename in the destination folder is overwritten when this activity runs. If disabled (default), a PDF file with the same filename in the destination folder is not overwritten, however, a runtime error occurs as a result.
Create empty PDF file Yes/No No No CREATEEMPTY="YES" If selected, the activity creates an empty, single-page PDF file. This parameter becomes active if the Use parameter is set to New PDF.

Field

Property Type Required Default Markup Description
Field name Text Yes (Empty) FIELDNAMES="TELEPHONE,ALTERNATE TELEPHONE" The name of the form fields to populate. Click Add to select a form field. Click the drop-down list box under the Field name column to populate it with the list of available fields that correspond to the source PDF file, and then select the desired field name. Click Remove to remove the form field entry from this activity.
NOTE: Use the Get field(s) activity to retrieve information about one or more form fields contained in a PDF file.
Value Text Yes (Empty)

FIELDVALUES="310-555-1212,714-555-1234"

The value that corresponds to the field name. Once the field name is selected under the Field name column, enter the desired value under the Value column.

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 task populates specific fields with values in a PDF and then saves it using a different file name.

Copy
<AMPDF ACTIVITY="set" SOURCE="C:\temp\sourceForm.pdf" SAVETYPE="save_as" DESTINATION="C:\temp\savedForm.pdf" FIELDNAMES="TITLE,ADDRESS,CITY,COUNTRY" FIELDVALUES="Name,300 S. Street,Los Angeles,USA" />