| Components | All | New | MacOS | Windows | Linux | iOS | ||||
| Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old | |
DynaPDF.ImportPDFPage
Imports a page from the import PDF and appends it to the current working PDF.
| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
| DynaPDF | 3.0 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
MBS( "DynaPDF.ImportPDFPage"; PDF { ; PageIndex; ScaleX; ScaleY } ) More
Parameters
| Parameter | Description | Example | Flags |
|---|---|---|---|
| The PDF reference returned from DynaPDF.New. | |||
| PageIndex | The source page number from 1 to DynaPDF.GetImportPageCount. | 1 | Optional |
| ScaleX | The scale factor for x coordinate. Default is 1.0. |
1.0 | Optional Added in version 13.0. |
| ScaleY | The scale factor for y coordinate. Default is 1.0. |
1.0 | Optional Added in version 13.0. |
Result
Returns OK or error message.
Description
Imports a page from the import PDF and appends it to the current working PDF.To open the import PDF, please use DynaPDF.OpenPDFFromFile or DynaPDF.OpenPDFFromContainer.
Requires a Lite license in DynaPDF 5. Used to be a Pro license for DynaPDF 4.
To import all pages, please use DynaPDF.ImportPDFFile function instead.
Use DynaPDF.SetImportFlags including AllPageObjects option to preserve links.
If you have an open page, we close it automatically for you before doing the import.
See also ImportPDFPage function in DynaPDF manual.
Examples
Import a single page:
Set Variable [$r; Value: MBS( "DynaPDF.SetImportFlags"; $pdf; "ImportAll¶ImportAsPage¶AllPageObjects" )]
Set Variable [$r; Value: MBS("DynaPDF.OpenPDFFromContainer"; $pdf; Invoice::PDF Template)]
Set Variable [$r; Value: MBS("DynaPDF.ImportPDFPage"; $pdf; 1)]
Set Variable [$r; Value: MBS("DynaPDF.OpenPDFFromContainer"; $pdf; Invoice::PDF Template)]
Set Variable [$r; Value: MBS("DynaPDF.ImportPDFPage"; $pdf; 1)]
Import selected pages from one PDF and write into a new one:
# New PDF
Set Variable [$pdf; Value:MBS("DynaPDF.New")]
# Open existing PDF file (or use DynaPDF.OpenPDFFromContainer for container)
Set Variable [$r; Value:MBS("DynaPDF.OpenPDFFromFile"; $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"; $pdf; 1)]
Set Variable [$r; Value:MBS("DynaPDF.ImportPDFPage"; $pdf; 2)]
Set Variable [$r; Value:MBS("DynaPDF.ImportPDFPage"; $pdf; 3)]
Set Variable [$r; Value:MBS("DynaPDF.ImportPDFPage"; $pdf; $pagecount - 1)]
Set Variable [$r; Value:MBS("DynaPDF.ImportPDFPage"; $pdf; $pagecount - 2)]
# Set output to this file path
# MBS( "DynaPDF.OpenOutputFile"; $pdf; "/Users/cs/Desktop/output.pdf" )
# Write PDF
Set Variable [$r; Value:MBS("DynaPDF.Save"; $pdf)]
# release memory
Set Variable [$r1; Value:MBS("DynaPDF.Release"; $pdf)]
Set Variable [$pdf; Value:MBS("DynaPDF.New")]
# Open existing PDF file (or use DynaPDF.OpenPDFFromContainer for container)
Set Variable [$r; Value:MBS("DynaPDF.OpenPDFFromFile"; $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"; $pdf; 1)]
Set Variable [$r; Value:MBS("DynaPDF.ImportPDFPage"; $pdf; 2)]
Set Variable [$r; Value:MBS("DynaPDF.ImportPDFPage"; $pdf; 3)]
Set Variable [$r; Value:MBS("DynaPDF.ImportPDFPage"; $pdf; $pagecount - 1)]
Set Variable [$r; Value:MBS("DynaPDF.ImportPDFPage"; $pdf; $pagecount - 2)]
# Set output to this file path
# MBS( "DynaPDF.OpenOutputFile"; $pdf; "/Users/cs/Desktop/output.pdf" )
# Write PDF
Set Variable [$r; Value:MBS("DynaPDF.Save"; $pdf)]
# release memory
Set Variable [$r1; Value:MBS("DynaPDF.Release"; $pdf)]
Split first page from a PDF:
# New PDF
Set Variable [$pdf; Value:MBS("DynaPDF.New")]
# Open existing PDF file (or use DynaPDF.OpenPDFFromContainer for container)
Set Variable [$r; Value:MBS("DynaPDF.OpenPDFFromFile"; $pdf; $path )]
# Import one page
Set Variable [$r; Value:MBS("DynaPDF.ImportPDFPage"; $pdf; 1)]
# Write PDF
Set Variable [$r; Value:MBS("DynaPDF.Save"; $pdf)]
# release memory
Set Variable [$r1; Value:MBS("DynaPDF.Release"; $pdf)]
Set Variable [$pdf; Value:MBS("DynaPDF.New")]
# Open existing PDF file (or use DynaPDF.OpenPDFFromContainer for container)
Set Variable [$r; Value:MBS("DynaPDF.OpenPDFFromFile"; $pdf; $path )]
# Import one page
Set Variable [$r; Value:MBS("DynaPDF.ImportPDFPage"; $pdf; 1)]
# Write PDF
Set Variable [$r; Value:MBS("DynaPDF.Save"; $pdf)]
# release memory
Set Variable [$r1; Value:MBS("DynaPDF.Release"; $pdf)]
See also
- DynaPDF.ImportPDFFile
- DynaPDF.OpenOutputFile
- DynaPDF.OpenPDFFromContainer
- DynaPDF.OpenPDFFromFile
- DynaPDF.Parser.Content
- DynaPDF.Print
- DynaPDF.Release
- DynaPDF.RenderPage
- DynaPDF.Save
- DynaPDF.SetImportFlags
Release notes
- Version 16.1
- Changed DynaPDF.ImportPDFPage to only require a Lite instead of a Pro license.
- Version 9.2
- Improved error handling for DynaPDF.ImportPDFPage function.
Example Databases
- Containers/Create Container Preview
- DynaPDF/Apply Letter Paper to PDF
- DynaPDF/Click Points
- DynaPDF/Find and Replace Text
- DynaPDF/PDF Differences
- DynaPDF/PDF Library
- DynaPDF/Render Page
- DynaPDF/Replace Text
- DynaPDF/Split PDF
- DynaPDF/Swiss QRCode
Blog Entries
- Make PDF certificates in calculation with DynaPDF
- MBS FileMaker Plugin 16.1 for Claris FileMaker - More than 7800 functions in one plugin
- MBS FileMaker Plugin, version 16.1pr3
- Retract text from a PDF with DynaPDF
- MBS Plugin Advent calendar: 15 - DynaPDF
- New in MBS FileMaker Plugin 13.0
- Things you can do with DynaPDF
- Swiss QR-Codes for invoices as vector graphics
- FileMaker with ZUGFeRD 2.0 and Factur-X
- Normalize PDF orientation with MBS Plugins and DynaPDF
FileMaker Magazin
This function checks for a license.
Created 18th August 2014, last changed 14th February 2026
MarkDown version: DynaPDFImportPDFPage.md