PDF - Create Session

Declaration

<AMPDF ACTIVITY="create_session" SESSION="text" 
PDFDOCUMENTFROM="text" NEWPDF="text" />

Description: Creates a unique session which can be used to combine other PDF activities. A session is particularly useful as a means of organizing and encapsulating a collection of activities required to accomplish a particular operation.

NOTE: To end a session, use the PDF - End session activity. Sessions are not necessary when executing individual activities.

Practical Usage

Commonly used to create a new session in which other activities can be linked to. Sessions typically represent a combination of steps that are used to complete a specific process. Creating sessions enables you to build and organize more customized tasks. Additionally, sessions can eliminate redundant entry of identical parameters that may be required by several activities.

Session Parameters

Property

Type

Required

Default

Markup

Description

Create session from

Text (options)

No

Existing PDF
  1. PDFDOCUMENTFROM="existingpdf"
  2. PDFDOCUMENTFROM="newPDF"

Indicates the type of PDF file to create the session from. The available options are:

  • Existing PDF (default) - The session will be created based on an existing PDF file.
  • New PDF - The session will be created based on a newly generated PDF file.

Session

Text

Yes

PDFSession1

SESSION="myPDFSession"

The name of the session to create. This allows subsequent PDF activities to be linked to this session. Numerous sessions can exist within a single task allowing several PDF documents to be open simultaneously. The default session name is PDFSession1.

NOTE: To end a session, use the PDF - End session activity.

Source PDF

Text

Yes if session is based on an existing PDF

(Empty)

SOURCE="C:\temp\sourceFile.pdf"

The path and filename of the PDF document that the session should derive from. This parameter is active only if the Create session from parameter is set to Existing PDF.

Password (optional)

Text

No

(Empty)

PASSWORD="encrypted"

The password required to open an existing PDF file that's password protected (if applicable). This parameter is active only if the Create session from parameter is set to Existing PDF.

New PDF

Text

Yes if session is based on a new PDF

(Empty)

NEWPDF="C:\temp\newFile.pdf"

The path and filename in which to save the new PDF document. This parameter is active only if the Create session from parameter is set to New PDF.

Overwrite if PDF already exists

Yes/No

No

No

OVERWRITE="YES"

If set to YES, files matching the name of the new PDF file will be overwritten. If set to no (default)

Example

The sample AML code below can be copied and pasted directly into the Steps panel of the Task Builder.

Description: Create session from new PDF file "C:\temp\newFile.pdf". Session name is "myPDFSession".

<AMPDF ACTIVITY="create_session" SESSION="myPDFSession" 
PDFDOCUMENTFROM="new_file" NEWPDF="C:\temp\newFile.pdf" />