PDFKit.AddImagePage
-------------------

Adds a new page to PDF document with given image.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [PDFKit](component_PDFKit.md) | [5.0](newinversion50.md) | ✅ Yes | ❌ No | ❌ No | ✅ Yes, on macOS | ✅ Yes |

MBS( "PDFKit.AddImagePage"; PDF; Image { ; Width; Height } ) 

**MBS**( **"PDFKit.AddImagePage";** /\* Adds a new page to PDF document with given image. \*/  
**$PDF**; /\* A PDF reference number from [PDFKit.Open](PDFKitOpen.md).e.g. $ref \*/   
**$Image**; /\* The image to use. Pass a container value with JPEG, TIFF, PNG or other image formats. \*/   
**$Width**; /\* Optional; The width for the new PDF page.e.g. 600 \*/   
**$Height**) /\* Optional; The height of the new PDF page.e.g. 800 \*/ 

### Parameters

| Parameter | Description | Example | Flags |
|---|---|---|---|
| PDF | A PDF reference number from [PDFKit.Open](PDFKitOpen.md). | $ref |  |
| Image | The image to use. Pass a container value with JPEG, TIFF, PNG or other image formats. | $image |  |
| Width | The width for the new PDF page. | 600 | Optional |
| Height | The height of the new PDF page. | 800 | Optional |

### Result

Returns OK or error.

### Description

Adds a new page to PDF document with given image.  
If you need more control about details, you may want to check [DynaPDF](component_DynaPDF.md) functions.  
Please use [PDFKit.AddImageFilePage](PDFKitAddImageFilePage.md) to add image file on disk.  
  
Your changes are only done in memory, so please remember to write modified pdf back to disk, e.g. by using [PDFKit.WriteToPath](PDFKitWriteToPath.md). Or use [PDFKit.GetPDFDocument](PDFKitGetPDFDocument.md) to get a PDF for storing in a container.  
### Examples

Create PDF from images:

 # Start new document   
Set Variable \[$doc ; Value:MBS ("[PDFKit.NewPDFDocument](PDFKitNewPDFDocument.md)")\]  
\# Add image in full size as new page   
Set Variable \[$r ; Value:MBS ("PDFKit.AddImagePage"; $doc ; test::image )\]  
\# Add empty page in default size   
Set Variable \[$r ; Value:MBS ("[PDFKit.AddEmptyPage](PDFKitAddEmptyPage.md)"; $doc )\]  
\# Add image in given size as new page:   
Set Variable \[$r ; Value:MBS ("PDFKit.AddImagePage"; $doc ; test::image ; 400; 300)\]  
\# get PDF document and store in container:   
Set Field \[test::test ; MBS ("[PDFKit.GetPDFDocument](PDFKitGetPDFDocument.md)"; $doc )\]  
\# release memory   
Set Variable \[$r ; Value:MBS ("[PDFKit.Release](PDFKitRelease.md)"; $doc )\]  
### See also

- [PDFKit.AddEmptyPage](PDFKitAddEmptyPage.md)
- [PDFKit.AddImageFilePage](PDFKitAddImageFilePage.md)
- [PDFKit.GetPDFDocument](PDFKitGetPDFDocument.md)
- [PDFKit.NewPDFDocument](PDFKitNewPDFDocument.md)
- [PDFKit.Open](PDFKitOpen.md)
- [PDFKit.Release](PDFKitRelease.md)
- [PDFKit.WriteToPath](PDFKitWriteToPath.md)

### Release notes

- **Version 7.2**
    - Reduced memory usage for [PDFKit.AddImageFilePage](http://www.mbsplugins.eu/PDFKitAddImageFilePage.shtml) and [PDFKit.AddImagePage](http://www.mbsplugins.eu/PDFKitAddImagePage.shtml).

### Example Databases

- [Mac and iOS/PDFKit/PDFKit Print Documents](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20and%20iOS/PDFKit/PDFKit%20Print%20Documents.shtml#1ScriptAnchor_)
- [Mac and iOS/PDFKit/Pictures to PDF](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20and%20iOS/PDFKit/Pictures%20to%20PDF.shtml#7ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 7.2pr6](https://www.mbsplugins.de/archive/2017-05-11/MBS_FileMaker_Plugin_version_7/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin for iOS Update](https://www.mbsplugins.de/archive/2017-05-11/MBS_FileMaker_Plugin_for_iOS_U/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 5.0pr12](https://www.mbsplugins.de/archive/2015-02-19/MBS_FileMaker_Plugin_version_5/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 1/2026, Seite 29](https://filemaker-magazin.de/neuigkeit/4312-Die-neue-Ausgabe-FMM_202601-steht-online)
- [Ausgabe 6/2022, Seite 14](https://filemaker-magazin.de/neuigkeit/4206-Appetithappen-FMM_202206)

This function checks for a license.

Created 16th February 2015 , last changed 9th May 2017

  
[PDFKit.AddImageFilePage](PDFKitAddImageFilePage.md) - [PDFKit.AppendPages](PDFKitAppendPages.md)

[HTML Version](PDFKitAddImagePage.shtml)