PDF - Get PDF information

Declaration

<AMPDF ACTIVITY="get_info" SESSION="text" SOURCE="text" PASSWORD="text (encrypted)" RESULTDATASET="text" />

Related Topics

Description

Retrieves document properties of a PDF file, such as title, author, subject, keywords, and security settings and then loads the information onto a dataset.

Practical usage

Commonly used as a conditional object that can alter workflow or task progression based on the information retrieved from the source PDF file. For example, if the Subject property states please sign, then execute the PDF - Sign activity along with the Email - Send message activity to digitally sign the document and then send it to the appropriate recipient. Otherwise, execute a Task - Stop activity to end the task.

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 document properties. 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).

Data

Property Type Required Default Markup Description
Create and populate dataset Text Yes (Empty) RESULTDATASET="docInfo" The name of the dataset to create and populate with information about the PDF file. For more details, see Datasets below.

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.Application Text The application used to create the PDF file.
theDataset.Author Text The author of the PDF file.
theDataset.CreationDate Date The date and time the PDF file was originally created.
theDataset.File Text The location and file name of the PDF file.
theDataset.IsEncrypted Yes/No Indicates whether the PDF file is encrypted.
theDataset.IsSign Yes/No Indicates whether the PDF file is signed.
theDataset.IsValidPDF Yes/No Indicates whether the PDF file is valid.
theDataset.ModificationDate Date The date and time the PDF file was last modified.
theDataset.NumberOfPages Number The total number of pages that the PDF file contains.
theDataset.PdfVersion Number The document's PDF version.
theDataset.Producer Text The program or application that produced the PDF file.
theDataset.Subject Text The subject of the PDF file.
theDataset.Title Text The title of the PDF file.

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 creates and populates a dataset with a PDF file's information.

Copy
<AMPDF ACTIVITY="get_info" SOURCE="C:\temp\myDocument.pdf" RESULTDATASET="thePDFInfo" />