PrintDialog.SetPrintToPDF
-------------------------

Sets whether plugin will redirect print to PDF.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [PrintDialog](component_PrintDialog.md) | [3.5](newinversion35.md) | ✅ Yes | ❌ No | ❌ No | ❌ No | ❌ No |

MBS( "PrintDialog.SetPrintToPDF"; Flag ) 

**MBS**( **"PrintDialog.SetPrintToPDF";** /\* Sets whether plugin will redirect print to PDF. \*/  
**$Flag**) /\* The new setting. Can be 0 to disable PDF creation or 1 to enable it.e.g. 1 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| Flag | The new setting. Can be 0 to disable PDF creation or 1 to enable it. | 1 |

### Result

Returns OK or error.

### Description

Sets whether plugin will redirect print to PDF.  
Please also use [PrintDialog.SetDestinationPath](PrintDialogSetDestinationPath.md) to print to PDF.  
### Examples

Set print to PDF:

 Set Variable \[ $r ; Value: MBS ( "PrintDialog.SetPrintToPDF"; 1 ) \]   
Set Variable \[ $r ; Value: MBS ( "[PrintDialog.SetDestinationPath](PrintDialogSetDestinationPath.md)"; "/Users/cs/Desktop/test.pdf" ) \]  
Install and print to PDF:

 Set Variable \[$r ; MBS ( "[PrintDialog.Install](PrintDialogInstall.md)")\]  
Set Variable \[$r ; MBS ( "[PrintDialog.Enable](PrintDialogEnable.md)")\]  
Set Variable \[$r ; MBS ( "PrintDialog.SetPrintToPDF"; 1)\]  
Set Variable \[$r ; MBS ( "[PrintDialog.SetDestinationPath](PrintDialogSetDestinationPath.md)"; "/Users/cs/Desktop/test.pdf")\]  
Set Variable \[$r ; MBS ( "[PrintDialog.SetNoDialog](PrintDialogSetNoDialog.md)"; 1 )\]  
Print \[\]  
### See also

- [PrintDialog.Enable](PrintDialogEnable.md)
- [PrintDialog.GetPrinterName](PrintDialogGetPrinterName.md)
- [PrintDialog.GetPrintToPDF](PrintDialogGetPrintToPDF.md)
- [PrintDialog.GetPrintType](PrintDialogGetPrintType.md)
- [PrintDialog.Install](PrintDialogInstall.md)
- [PrintDialog.SetDestinationPath](PrintDialogSetDestinationPath.md)
- [PrintDialog.SetNoDialog](PrintDialogSetNoDialog.md)
- [PrintDialog.SetPrinterName](PrintDialogSetPrinterName.md)
- [PrintDialog.SetPrintType](PrintDialogSetPrintType.md)

### Example Databases

- [Mac only/Print/Printer Dialog on Mac](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Mac%20only/Print/Printer%20Dialog%20on%20Mac.shtml#4ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Advent calendar - Door 23 - Printing a PDF](https://www.mbsplugins.de/archive/2024-12-23/MBS_FileMaker_Advent_calendar_/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th August 2014 , last changed 13th May 2020

  
[PrintDialog.SetPaperWidth](PrintDialogSetPaperWidth.md) - [PrintDialog.SetPrintType](PrintDialogSetPrintType.md)

[HTML Version](PrintDialogSetPrintToPDF.shtml)