PDFKit.WriteToPath
------------------

Writes the PDF to the given file path.

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

MBS( "PDFKit.WriteToPath"; PDF; Path ) 

**MBS**( **"PDFKit.WriteToPath";** /\* Writes the PDF to the given file path. \*/  
**$PDF**; /\* A container value with the PDF content from a media field. Or a text with an URL. Or a PDF reference from [PDFKit.Open](PDFKitOpen.md). \*/   
**$Path**) /\* A valid native file path.e.g. "/Users/test/Desktop/test.pdf" \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| PDF | A container value with the PDF content from a media field. Or a text with an URL. Or a PDF reference from [PDFKit.Open](PDFKitOpen.md). |  |
| Path | A valid native file path. | "/Users/test/Desktop/test.pdf" |

### Result

Returns OK or error message.

### Description

Writes the PDF to the given file path.  
  
This function requires a native path. Use [Path.FileMakerPathToNativePath](PathFileMakerPathToNativePath.md) to convert a FileMaker path to a native path if required. If you like to have the user choose the path, you can use [FileDialog](component_FileDialog.md) functions.  
For Server be aware that server has limited permissions and may not be able to access all files on a computer.  
### Examples

Load PDF, Write PDF and release it.

 $h = MBS ("[PDFKit.OpenPath](PDFKitOpenPath.md)"; "/Users/cs/Desktop/test.pdf")  
$r = MBS ("PDFKit.WriteToPath"; $h ; "/Users/cs/Desktop/output.pdf")  
$r = MBS ("[PDFKit.Release](PDFKitRelease.md)"; $h )  
### See also

- [Path.FileMakerPathToNativePath](PathFileMakerPathToNativePath.md)
- [PDFKit.AddEmptyPage](PDFKitAddEmptyPage.md)
- [PDFKit.AddImagePage](PDFKitAddImagePage.md)
- [PDFKit.Open](PDFKitOpen.md)
- [PDFKit.OpenPath](PDFKitOpenPath.md)
- [PDFKit.Release](PDFKitRelease.md)
- [PDFKit.SetCurrentFilter](PDFKitSetCurrentFilter.md)
- [PDFKit.SetPDFAttribute](PDFKitSetPDFAttribute.md)
- [PDFKit.SetPDFPageRotation](PDFKitSetPDFPageRotation.md)
- [PDFKit.Watermark](PDFKitWatermark.md)

### Release notes

- **Version 8.0**
    - Changed [PDFKit.WriteToPath](http://www.mbsplugins.eu/PDFKitWriteToPath.shtml) to report errors better.
- **Version 7.4**
    - Changed [PDFKit.WriteToPath](http://www.mbsplugins.eu/PDFKitWriteToPath.shtml) to now also use quartz filter.

### Example Databases

- [Mac and iOS/PDFKit/Split](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20and%20iOS/PDFKit/Split.shtml#1ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 7.6pr2](https://www.mbsplugins.de/archive/2017-12-11/MBS_FileMaker_Plugin_version_7/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 7.4pr3](https://www.mbsplugins.de/archive/2017-08-22/MBS_FileMaker_Plugin_version_7/monkeybreadsoftware_blog_filemaker)
- [MBS Filemaker Plugin, version 3.2pr4](https://www.mbsplugins.de/archive/2013-03-18/MBS_Filemaker_Plugin_version_3/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 1/2026, Seite 30](https://filemaker-magazin.de/neuigkeit/4312-Die-neue-Ausgabe-FMM_202601-steht-online)
- [Ausgabe 1/2026, Seite 27](https://filemaker-magazin.de/neuigkeit/4312-Die-neue-Ausgabe-FMM_202601-steht-online)

This function checks for a license.

Created 18th August 2014 , last changed 5th September 2014

  
[PDFKit.Watermark](PDFKitWatermark.md) - [PDFKit.allowsCopying](PDFKitallowsCopying.md)

[HTML Version](PDFKitWriteToPath.shtml)