PDF - Split
Declaration
<AMPDF ACTIVITY="split" SESSION="text" SOURCE="text" PASSWORD="text (encrypted)" SPLITFOLDER="text" SPLIT="text (options)" PAGE="number" />
Overview
Splits a PDF file in half, at a specific page, per individual page, or into even/odd pages.
Practical usage
Imagine a large report generated in PDF that needs to be divided into pieces so specific portions can be sent to clients or other departments. The Split activity is ideal for such a task and allows for better management of PDF files. Developers can split a document at a specific page to save the valuable portion and discard the rest. Documents can be split into single pages allowing even more control during the editing process.
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 path and file name of the PDF to split. 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). |
Output
| Property | Type | Required | Default | Markup | Description |
|---|---|---|---|---|---|
| Destination folder | Text | Yes | (Empty) | SPLITFOLDER="c:\temp" | The path to the destination folder of where to output the newly split PDF files. |
| Type | Text (options) | Yes | Split in half |
|
Specifies how to split the PDF file. The available options are:
|
| Page number | Number | Yes if Type is set to Split at | (Empty) | PAGE="2" | The page number of where to split the PDF file. This parameter becomes active and is required if the Type parameter is set to Split at. |
Example
- 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.
Example 1
The following sample task splits a PDF into even and odd pages and stores the split files in a folder:
<AMPDF ACTIVITY="split" SOURCE="C:\temp\myDocument.pdf" SPLITFOLDER="C:\temp" SPLIT="even_odd" />
Example 2
The following sample task splits a PDF at page 2 and stores the split files in a folder:
<AMPDF ACTIVITY="split" SOURCE="C:\temp\myDocument.pdf" SPLITFOLDER="C:\temp" SPLIT="split_at" PAGE="2" />