Unofficial Content

Count pages (PageCount)

Objective

Return the total number of pages of a PDF document.

Parameters

Parameter Required Description
Source path Yes PDF file to analyze.

Result

Operation status (Error / ErrorMessage) via PDFToolsStatus.

Functional details

  • The source file cannot be password-protected.

Usage example

&PDFFileSource   = "C:\Documents\report.pdf"

&PDFToolsStatus  =  &PdfToolsUtils.PageCount(&PDFFileSource,&PDFPageCount)

Possible result: successful operation (Error = false) with page count 12.

Error and warning messages

Situation Type Message / behavior
The source file does not exist, is corrupted, or is protected Error Message describing the file read problem.
Last update: 2026 | © GeneXus. All rights reserved. GeneXus Powered by Globant