PDF - Create session

Declaration

<AMPDF ACTIVITY="create_session" SESSION="text" SOURCE="text" PASSWORD="text (encrypted)" PDFDOCUMENTFROM="text (options)" NEWPDF="text" OVERWRITE="YES/NO" CREATEEMPTY="YES/NO" />

Related Topics

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.

Parameters

Session

Property Type Required Default Markup Description
Create session from Text (options) Yes Existing PDF
  • PDFDOCUMENTFROM="existingpdf"
  • PDFDOCUMENTFROM="newPDF"
Specifies the type of PDF file to create from the session. The available options are:
  • Existing PDF (default) - The session created is based on an existing PDF file.
  • New PDF - The session created is 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 files to be open simultaneously. The default session name is PDFSession1.
NOTE: To end a session, use the PDF - End session activity.
PDF Text Yes (Empty)
  • SOURCE="C:\temp\sourceFile.pdf"
  • NEWPDF="C:\temp\newFile.pdf"
Specifies the path and file name of an existing PDF file, or where a newly-generated PDF file is stored, based on the option selected for Create session from:
  • For Existing PDF, this parameter specifies the path and file name of the PDF file the session will derive from.
  • For New PDF, this parameter specifies the path and file name where the newly-generated PDF file is stored.
Password (optional) Text No (Empty) PASSWORD="encrypted" The password required to open the existing PDF file (if required). This parameter becomes active if the Create session from parameter is set to Existing PDF.
Overwrite if PDF already exists Yes/No No No OVERWRITE="YES" If selected, a PDF file with the same file name in the destination folder is overwritten when this activity runs. If disabled (default), a PDF file with the same file name in the destination folder is not overwritten, however, a runtime error occurs as a result.

Description

Error Causes

On Error

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 task creates a session from a new PDF file.

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