DynaPDF.GetImportPageCount
--------------------------

Queries number of pages in the current opened import PDF.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [DynaPDF](component_DynaPDF.md) | [3.0](newinversion30.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "DynaPDF.GetImportPageCount"; PDF ) 

**MBS**( **"DynaPDF.GetImportPageCount";** /\* Queries number of pages in the current opened import PDF. \*/  
**$PDF**) /\* The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| PDF | The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). | $pdf |

### Result

Returns page number or error message.

### Description

Queries number of pages in the current opened import PDF.  
Please note that we have [DynaPDF.GetPageCount](DynaPDFGetPageCount.md) for the current working PDF and the DynaPDF.GetImportPageCount for the current open import PDF.  
See also [GetImportPageCount](https://www.monkeybreadsoftware.com/DynaPDF-Manual/GetInPageCount.shtml) function in DynaPDF manual.

### Examples

Load a PDF from container and query page count:

 $r = MBS ("[DynaPDF.OpenPDFFromContainer](DynaPDFOpenPDFFromContainer.md)"; $PDF ; Test::data )  
$pageCount = MBS ("DynaPDF.GetImportPageCount"; $PDF )  
Import selected pages from one PDF and write into a new one:

 # New PDF   
Set Variable \[$pdf ; Value:MBS ("[DynaPDF.New](DynaPDFNew.md)")\]  
  
\# Open existing PDF file (or use [DynaPDF.OpenPDFFromContainer](DynaPDFOpenPDFFromContainer.md) for container)   
Set Variable \[$r ; Value:MBS ("[DynaPDF.OpenPDFFromFile](DynaPDFOpenPDFFromFile.md)"; $pdf ; $path )\]  
  
\# Query page count   
Set Variable \[$pageCount ; Value:MBS ( "DynaPDF.GetImportPageCount"; $pdf )\]  
  
\# Import the pages you need   
Set Variable \[$r ; Value:MBS ("[DynaPDF.ImportPDFPage](DynaPDFImportPDFPage.md)"; $pdf ; 1)\]  
Set Variable \[$r ; Value:MBS ("[DynaPDF.ImportPDFPage](DynaPDFImportPDFPage.md)"; $pdf ; 2)\]  
Set Variable \[$r ; Value:MBS ("[DynaPDF.ImportPDFPage](DynaPDFImportPDFPage.md)"; $pdf ; 3)\]  
Set Variable \[$r ; Value:MBS ("[DynaPDF.ImportPDFPage](DynaPDFImportPDFPage.md)"; $pdf ; $pagecount - 1)\]  
Set Variable \[$r ; Value:MBS ("[DynaPDF.ImportPDFPage](DynaPDFImportPDFPage.md)"; $pdf ; $pagecount - 2)\]  
  
\# Set output to this file path   
\# MBS ( "[DynaPDF.OpenOutputFile](DynaPDFOpenOutputFile.md)"; $pdf ; "/Users/cs/Desktop/output.pdf" )   
  
\# Write PDF   
Set Variable \[$r ; Value:MBS ("[DynaPDF.Save](DynaPDFSave.md)"; $pdf )\]  
  
\# release memory   
Set Variable \[$r1 ; Value:MBS ("[DynaPDF.Release](DynaPDFRelease.md)"; $pdf )\]  
### See also

- [DynaPDF.GetColorSpaceCount](DynaPDFGetColorSpaceCount.md)
- [DynaPDF.GetImageFileCount](DynaPDFGetImageFileCount.md)
- [DynaPDF.GetImportOrientation](DynaPDFGetImportOrientation.md)
- [DynaPDF.GetImportPageBounds](DynaPDFGetImportPageBounds.md)
- [DynaPDF.GetPageCount](DynaPDFGetPageCount.md)
- [DynaPDF.OpenOutputFile](DynaPDFOpenOutputFile.md)
- [DynaPDF.OpenPDFFromContainer](DynaPDFOpenPDFFromContainer.md)
- [DynaPDF.OpenPDFFromFile](DynaPDFOpenPDFFromFile.md)
- [DynaPDF.Release](DynaPDFRelease.md)
- [DynaPDF.Save](DynaPDFSave.md)

### Example Databases

- [DynaPDF/Apply Letter Paper to PDF](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Apply%20Letter%20Paper%20to%20PDF.shtml#2ScriptAnchor_)
- [DynaPDF/Batch Preview](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Batch%20Preview.shtml#3ScriptAnchor_)
- [DynaPDF/Convert to 2 Pages](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Convert%20to%202%20Pages.shtml#2ScriptAnchor_)
- [DynaPDF/Generate Previews](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Generate%20Previews.shtml#3ScriptAnchor_)
- [DynaPDF/Invoice/Invoice](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Invoice/Invoice.shtml#3ScriptAnchor_)
- [DynaPDF/Merge PDFs](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Merge%20PDFs.shtml#2ScriptAnchor_)
- [DynaPDF/PDF Differences](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/PDF%20Differences.shtml#1ScriptAnchor_)
- [DynaPDF/Shrink PDF pages](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Shrink%20PDF%20pages.shtml#2ScriptAnchor_)
- [DynaPDF/Split PDF](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Split%20PDF.shtml#1ScriptAnchor_)
- [DynaPDF/Tables](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Tables.shtml#3ScriptAnchor_)

### Blog Entries

- [Make PDF certificates in calculation with DynaPDF](https://www.mbsplugins.de/archive/2026-05-18/Make_PDF_certificates_in_calcu/monkeybreadsoftware_blog_filemaker)
- [Merge documents with DynaPDF](https://www.mbsplugins.de/archive/2023-07-06/Merge_documents_with_DynaPDF/monkeybreadsoftware_blog_filemaker)
- [Things you can do with DynaPDF](https://www.mbsplugins.de/archive/2021-07-02/Things_you_can_do_with_DynaPDF/monkeybreadsoftware_blog_filemaker)
- [Merge PDF with table of contents](https://www.mbsplugins.de/archive/2020-02-25/Merge_PDF_with_table_of_conten/monkeybreadsoftware_blog_filemaker)
- [Create two page PDF document in FileMaker](https://www.mbsplugins.de/archive/2019-08-22/Create_two_page_PDF_document_i/monkeybreadsoftware_blog_filemaker)
- [Normalize PDF orientation with MBS Plugins and DynaPDF](https://www.mbsplugins.de/archive/2018-03-09/Normalize_PDF_orientation_with/monkeybreadsoftware_blog_filemaker)
- [Introducing DynaPDF to MBS Filemaker Plugin](https://www.mbsplugins.de/archive/2012-11-27/Introducing_DynaPDF_to_MBS_Fil/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 4/2022, Seite 33](https://filemaker-magazin.de/neuigkeit/4191-Appetithappen-FMM_202204)
- [Ausgabe 5/2021, Seite 26](https://filemaker-magazin.de/neuigkeit/4158-Appetithappen-FMM_202105)
- [Ausgabe 6/2016, Seite 24](https://filemaker-magazin.de/neuigkeit/3913-Appetithappen-FMM_201606)

This function checks for a license.

Created 18th August 2014 , last changed 4th August 2016

  
[DynaPDF.GetImportPageBounds](DynaPDFGetImportPageBounds.md) - [DynaPDF.GetInDocInfoCount](DynaPDFGetInDocInfoCount.md)

[HTML Version](DynaPDFGetImportPageCount.shtml)