Extract PDF
Audience:
Low-code EngineersSkill Prerequisites:
Tokens
Copies selected pages of a PDF into a new PDF. You pick one or more page ranges, and the pages are added to the new file in the order you list them. The new file is saved in a portal folder, and its file ID and URLs can be saved as tokens for the actions that follow.
The original file isn't changed.
This action requires the PDF feature to be licensed.
Typical Use Cases
- Split a large PDF into smaller files, one Extract PDF action per part
- Keep only the signature page of a contract
- Remove a cover page by extracting everything after it
- Reorder pages, by listing the ranges in the order you want
Don't use it to
- Combine two PDFs. Use Merge PDF instead.
- Read the text of a PDF. Use Plain Text from PDF instead.
Related Actions
| Action Name | Description |
|---|---|
| Merge PDF | Combines the pages of two PDFs into one file. |
| Overlay PDF | Draws the pages of one PDF on top of another. |
| Plain Text from PDF | Reads the text of a PDF, page by page. |
| Generate PDF | Creates a PDF from an HTML template. |
| Send Email | Sends the extracted PDF as an attachment. |
Input Parameter Reference
| Parameter | Description | Supports Tokens | Default | Required |
|---|---|---|---|---|
| Source file | The PDF to copy pages from. Use one of the supported file identifiers. | Yes | empty string | Yes |
| Section Selection | The page ranges to copy. Each row has a Start Page and an End Page, and both pages are included. Page indexes start at 0, so the first page is 0. Click Extract More Sections to add another range. See Page ranges. | Yes | empty | Yes |
| Folder | The portal folder where the new PDF is saved. Select a folder from the list, or switch to expression mode and enter a folder path relative to the portal root. The folder must already exist. | Yes | none selected | Yes |
| File Name | The name of the new file, without the extension. .pdf is always added, so Contract-[Id]-Signature creates Contract-15-Signature.pdf. Always set it, because there's no automatic name. | Yes | empty string | No |
Supported file identifiers
The file must be in the portal's file system.
| Format | Example |
|---|---|
| File ID | 77 |
| Path relative to the portal root | Contracts/Contract-15.pdf |
| Path that includes the portal folder | /Portals/0/Contracts/Contract-15.pdf |
| Absolute URL of a file on the site | https://example.com/Portals/0/Contracts/Contract-15.pdf |
| LinkClick URL | /LinkClick.aspx?fileticket=... |
| Physical path inside the portal folder | C:\inetpub\site\Portals\0\Contracts\Contract-15.pdf |
Page ranges
Each row of Section Selection adds pages to the new file. For a 10-page PDF (indexes 0 to 9):
| Start Page | End Page | Pages copied |
|---|---|---|
0 | 0 | The first page |
1 | 9 | Everything except the first page |
9 | 9 | The last page |
5 | 99 | Pages 5 to 9. An end page past the last page is treated as the last page. |
20 | 25 | Only the last page. A start page past the last page copies the last page. |
Rows are processed in order, so 5–9 followed by 0–4 puts the second half first. A page can be copied more than once if ranges overlap.
Ranges are stored by their start page, so each Start Page can be used only once. To copy overlapping pages, start each range on a different page.
Both columns can contain tokens, for example [LastPage], so the range can be calculated earlier in the flow.
Output Parameters Reference
| Parameter | Description |
|---|---|
| Output Token Name | The name of the token that stores details of the new file. See the tokens in the next table. |
If Output Token Name is Extract, the following tokens are created:
| Token | Description |
|---|---|
[Extract] | The file ID of the new file. |
[Extract:AbsoluteUrl] | The absolute URL of the new file, for example https://example.com/Portals/0/Contracts/Contract-15-Signature.pdf. |
[Extract:RelativeUrl] | The URL relative to the site root, for example /Portals/0/Contracts/Contract-15-Signature.pdf. |
[Extract:PhysicalPath] | The physical path of the new file on the server. |
[Extract:LinkClick] | A LinkClick URL that downloads the new file. |
Considerations
- Always set a File Name. Unlike Merge PDF, there's no automatic name. An empty name creates a file called
.pdf. - Existing files are overwritten. If a file with the same name already exists in the folder, it's replaced.
- The action fails if:
- the file or folder can't be found (
File '...' not found.orFolder '...' not found.) - a start or end page isn't a whole number (
Start page '...' is not an integer.) - a start page is higher than its end page (
Start page is higher than end page.)
- the file or folder can't be found (
- If the source PDF has no pages, nothing is created and the output tokens aren't set.
- Password-protected PDFs aren't supported. There's no password parameter, so a PDF that needs a password to open can't be used.
- Pages are copied with the PDFsharp library, keeping their size and orientation.
Examples
To understand how to use the below examples, please see Running Examples.
1. Save the signature page of a contract
This action copies the third page (index 2) of the contract whose file ID is in the ContractFileId token. The new file is saved as Contracts/Contract-<Id>-Signature.pdf, and its details are saved in the SignaturePage token.
{
"Title": "Extract PDF",
"ActionType": "ExtractPdf",
"Description": "Save the signature page",
"Parameters": {
"FileIdentifier": "[ContractFileId]",
"SectionSelection": {
"2": "2"
},
"Folder": {
"Expression": "",
"Value": "/Contracts",
"IsExpression": false,
"Parameters": {}
},
"FileName": "Contract-[Id]-Signature",
"OutputTokenName": "SignaturePage"
}
}
After this action runs, [SignaturePage:AbsoluteUrl] can be used in an email, and [SignaturePage] holds the new file ID.
2. Remove the cover page
This action copies every page except the first. The end page 9999 is larger than any real document, so it's treated as the last page.
{
"Title": "Extract PDF",
"ActionType": "ExtractPdf",
"Description": "Remove the cover page",
"Parameters": {
"FileIdentifier": "Reports/Annual-Report.pdf",
"SectionSelection": {
"1": "9999"
},
"Folder": {
"Expression": "",
"Value": "/Reports",
"IsExpression": false,
"Parameters": {}
},
"FileName": "Annual-Report-No-Cover",
"OutputTokenName": "Report"
}
}
Revised 09/26/2026