Skip to main content
Version: 1.28 (Current)

Extract PDF

Audience: Low-code Engineers

Skill 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.

note

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​

Action NameDescription
Merge PDFCombines the pages of two PDFs into one file.
Overlay PDFDraws the pages of one PDF on top of another.
Plain Text from PDFReads the text of a PDF, page by page.
Generate PDFCreates a PDF from an HTML template.
Send EmailSends the extracted PDF as an attachment.

Input Parameter Reference​

ParameterDescriptionSupports TokensDefaultRequired
Source fileThe PDF to copy pages from. Use one of the supported file identifiers.Yesempty stringYes
Section SelectionThe 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.YesemptyYes
FolderThe 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.Yesnone selectedYes
File NameThe 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.Yesempty stringNo

Supported file identifiers​

The file must be in the portal's file system.

FormatExample
File ID77
Path relative to the portal rootContracts/Contract-15.pdf
Path that includes the portal folder/Portals/0/Contracts/Contract-15.pdf
Absolute URL of a file on the sitehttps://example.com/Portals/0/Contracts/Contract-15.pdf
LinkClick URL/LinkClick.aspx?fileticket=...
Physical path inside the portal folderC:\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 PageEnd PagePages copied
00The first page
19Everything except the first page
99The last page
599Pages 5 to 9. An end page past the last page is treated as the last page.
2025Only 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​

ParameterDescription
Output Token NameThe 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:

TokenDescription
[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. or Folder '...' 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.)
  • 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​

tip

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