PDFKit.NewPDFDocument
---------------------

Creates a new empty PDF and returns a PDF Reference value.

| 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.NewPDFDocument" ) ### Parameters

none

### Result

Returns a number for the PDF. Use [PDFKit.Release](PDFKitRelease.md) later to free the memory.

### Description

Creates a new empty PDF and returns a PDF Reference value.   
This value can be used in other PDFKit calls to work on the same PDF.  
See also [PDFKit.Open](PDFKitOpen.md).  
PDF Document reference numbers are starting at 30000 and counting up for each new document.  
### Examples

Create PDF from images:

 # Start new document   
Set Variable \[$doc ; Value:MBS ("PDFKit.NewPDFDocument")\]  
\# Add image in full size as new page   
Set Variable \[$r ; Value:MBS ("[PDFKit.AddImagePage](PDFKitAddImagePage.md)"; $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](PDFKitAddImagePage.md)"; $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.AddImagePage](PDFKitAddImagePage.md)
- [PDFKit.AppendPages](PDFKitAppendPages.md)
- [PDFKit.GetPDFDocument](PDFKitGetPDFDocument.md)
- [PDFKit.Open](PDFKitOpen.md)
- [PDFKit.Release](PDFKitRelease.md)

### 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

- [Controlled printing for iOS in FileMaker](https://www.mbsplugins.de/archive/2024-04-15/Controlled_printing_for_iOS_in/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 16th February 2015

  
[PDFKit.List](PDFKitList.md) - [PDFKit.Open](PDFKitOpen.md)

[HTML Version](PDFKitNewPDFDocument.shtml)