Skip to content

Get Page Count Action: getPageCount

The getPageCount action in the PDFHandle function is used to retrieve the total number of pages in a specified PDF file. This is particularly useful for automating processes where page count information is necessary.

Example: You have a PDF file named AnnualReport.pdf, and you need to determine its total page count.

Steps to Configure:

  1. Add a new step.
  2. Choose Set a Variable Value from the Action dropdown.
  3. Enter a name for the variable in the Element Key field (e.g., PageCount). This variable will store the output.
  4. Navigate to the Parameter section and click Form.
  5. From the dropdown, select Functions and choose PDF Handler Functions.
  6. Select getPageCount from the Action dropdown and configure the following field:
    • FPath: Specify the full path to the target PDF file (e.g., C:\Documents\Report.pdf).
  7. Click Save.
scrn-getpagecount-command-tabular-view
Tabular View
getPageCount Command - Card View
Card View

Outcome on execution:

  • Upon running the action, the total number of pages in the PDF is retrieved.
  • The page count is stored in the variable defined in Element Key. This variable can be referenced in subsequent steps of the automation process using the syntax ${VariableName} (e.g., ${PageCount}).

Back To Top