ftos.files.pdf.getPagesCount
IMPORTANT!
Starting with v24.3.0, this is renamed from getPageCount to ftos.files.pdf.getPagesCount.
Starting with v24.3.0, this is renamed from getPageCount to ftos.files.pdf.getPagesCount.
Returns the number of pages of a stored PDF file.
This is a business logic method for business service components.
Syntax
function ftos.files.pdf.getPagesCount(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 ftos.context.response.setMessage.
message = ftos.files.pdf.getPagesCount('Contract_f4340f5d-d639-4769-9a8e-5db40328d449.pdf');
ftos.context.response.setMessage('Your document has ' + message + ' pages.');