getPageCount
Returns the number of pages of a stored PDF file.
Syntax
function getPageCount(realName: string): number
| Parameter | Description |
|---|---|
realName
|
Unique internal ID of the source PDF file (real name). |
Return Value
Returns the number of pages of the PDF file.
Examples
In this example:
- We count the number of pages of the Contract_f4340f5d-d639-4769-9a8e-5db40328d449.pdf file.
- We store the page count in a variable called message.
- We display the page count on screen. For details on how to display messages, see setMessage.
message = getPageCount('Contract_f4340f5d-d639-4769-9a8e-5db40328d449.pdf');
setMessage('Your document has ' + message + ' pages.');