WinPDF.PageCount
----------------

Gets the number of pages in the Portable Document Format (PDF) document.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [WinPDF](component_WinPDF.md) | [13.2](newinversion132.md) | ❌ No | ✅ Yes | ❌ No | ✅ Yes, on Windows | ❌ No |

MBS( "WinPDF.PageCount"; PDFRef ) 

**MBS**( **"WinPDF.PageCount";** /\* Gets the number of pages in the Portable Document Format (PDF) document. \*/  
**$PDFRef**) /\* The reference number for the PDF document.e.g. $PDF \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| PDFRef | The reference number for the PDF document. | $PDF |

### Result

Returns number or error.

### Description

Gets the number of pages in the Portable Document Format (PDF) document.  
### Examples

Query page count:

 Set Variable \[ $page ; Value: 0 \]   
Set Variable \[ $PageCount ; Value: MBS ( "WinPDF.PageCount"; $pdf ; $page ) \]  
### See also

- [WinPDF.PageBox](WinPDFPageBox.md)
- [WinPDF.Release](WinPDFRelease.md)

### Example Databases

- [Barcode/Barcodes from Invoices](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Barcode/Barcodes%20from%20Invoices.shtml#1ScriptAnchor_)
- [Win Only/WinPDF](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Win%20Only/WinPDF.shtml#2ScriptAnchor_)

### Blog Entries

- [New in MBS FileMaker Plugin 13.2](https://www.mbsplugins.de/archive/2023-05-17/New_in_MBS_FileMaker_Plugin_13/monkeybreadsoftware_blog_filemaker)
- [Windows PDF Functions](https://www.mbsplugins.de/archive/2023-04-11/Windows_PDF_Functions/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 8th March 2023 , last changed 16th April 2023

  
[WinPDF.PageBox](WinPDFPageBox.md) - [WinPDF.PageHeight](WinPDFPageHeight.md)

[HTML Version](WinPDFPageCount.shtml)