DynaPDF.Print.SetDevMode
------------------------

Sets device mode.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [DynaPDF](component_DynaPDF.md) | [7.0](newinversion70.md) | ❌ No | ✅ Yes | ❌ No | ❌ No | ❌ No |

MBS( "DynaPDF.Print.SetDevMode"; DevMode ) 

**MBS**( **"DynaPDF.Print.SetDevMode";** /\* Sets device mode. \*/  
**$DevMode**) /\* The new device mode.  
Pass empty string to clear it. \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| DevMode | The new device mode.   Pass empty string to clear it. |  |

### Result

Returns OK or error.

### Description

Sets device mode.  
Sets the print settings for printing on Windows with [DynaPDF.Print](DynaPDFPrint.md) function.  
See also [Print](https://www.monkeybreadsoftware.com/DynaPDF-Manual/PrintPDFFile.shtml) function in DynaPDF manual.

### Examples

Print with options

 #Initialize DynaPDF if needed   
If \[MBS ("[DynaPDF.IsInitialized](DynaPDFIsInitialized.md)") ≠ 1\]  
 Perform Script \[“InitDynaPDF”\]  
End If  
\#New PDF session   
Set Variable \[$pdf ; Value:MBS ("[DynaPDF.New](DynaPDFNew.md)")\]  
\#Load PDF from container   
Set Variable \[$r ; Value:MBS ("[DynaPDF.OpenPDFFromContainer](DynaPDFOpenPDFFromContainer.md)"; $pdf ; Print PDFs::InputPDF )\]  
Set Variable \[$r ; Value:MBS ("[DynaPDF.ImportPDFFile](DynaPDFImportPDFFile.md)"; $pdf ; 1)\]  
\#Print   
Set Variable \[$flags ; Value:If ( Position ( Print PDFs::Options ; "ShrinkToPrintArea"; 1; 1)&gt;0; 16; 0) + If ( Position ( Print PDFs::Options ; "AutoRotateAndCenter"; 1; 1)&gt;0; 4; 0) + If ( Position ( Print PDFs::Options ; "Color"; 1; 1)&gt;0; 2; 0) + If ( …\]  
Set Variable \[$ShowDialog ; Value:Position ( Print PDFs::Options ; "ShowDialog"; 1; 1)&gt;0\]  
Set Variable \[$r ; Value:MBS ( "DynaPDF.Print.SetDevMode"; Print PDFs::Printer Device Mode)\]  
Set Variable \[$r ; Value:MBS ( "[DynaPDF.Print.SetDevNames](DynaPDFPrintSetDevNames.md)"; Print PDFs::Printer Device Names)\]  
Set Variable \[$r ; Value:MBS ("[DynaPDF.Print](DynaPDFPrint.md)"; $pdf ; Print PDFs::Printer Name; ""; ""; $flags ; ""; ""; ""; ""; $ShowDialog )\]  
Set Field \[Print PDFs::Printer Device Names; MBS ( "[DynaPDF.Print.GetDevNames](DynaPDFPrintGetDevNames.md)" )\]  
Set Field \[Print PDFs::Printer Device Mode; MBS ("[DynaPDF.Print.GetDevMode](DynaPDFPrintGetDevMode.md)")\]  
\#Cleanup   
Set Variable \[$r ; Value:MBS ("[DynaPDF.Release](DynaPDFRelease.md)"; $pdf )\]  
### See also

- [DynaPDF.ImportPDFFile](DynaPDFImportPDFFile.md)
- [DynaPDF.IsInitialized](DynaPDFIsInitialized.md)
- [DynaPDF.New](DynaPDFNew.md)
- [DynaPDF.OpenPDFFromContainer](DynaPDFOpenPDFFromContainer.md)
- [DynaPDF.Print](DynaPDFPrint.md)
- [DynaPDF.Print.GetDevMode](DynaPDFPrintGetDevMode.md)
- [DynaPDF.Print.GetSetting](DynaPDFPrintGetSetting.md)
- [DynaPDF.Print.SetDevNames](DynaPDFPrintSetDevNames.md)
- [DynaPDF.Print.SetSetting](DynaPDFPrintSetSetting.md)
- [DynaPDF.Release](DynaPDFRelease.md)

### Release notes

- **Version 8.4**
    - Improved [DynaPDF.Print](http://www.mbsplugins.eu/DynaPDFPrint.shtml) to use the device mode set with [DynaPDF.Print.SetDevMode](http://www.mbsplugins.eu/DynaPDFPrintSetDevMode.shtml) even if no dialog is used.
- **Version 7.0**
    - Added [DynaPDF.Print.GetDevMode](http://www.mbsplugins.eu/DynaPDFPrintGetDevMode.shtml), [DynaPDF.Print.GetDevNames](http://www.mbsplugins.eu/DynaPDFPrintGetDevNames.shtml), [DynaPDF.Print.SetDevMode](http://www.mbsplugins.eu/DynaPDFPrintSetDevMode.shtml) and [DynaPDF.Print.SetDevNames](http://www.mbsplugins.eu/DynaPDFPrintSetDevNames.shtml).

### Example Databases

- [DynaPDF/Print PDF](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Print%20PDF.shtml#5ScriptAnchor_)

### Blog Entries

- [MBS FileMaker Plugin, version 8.4pr2](https://www.mbsplugins.de/archive/2018-08-10/MBS_FileMaker_Plugin_version_8/monkeybreadsoftware_blog_filemaker)
- [MBS FileMaker Plugin, version 7.0pr4](https://www.mbsplugins.de/archive/2017-01-19/MBS_FileMaker_Plugin_version_7/monkeybreadsoftware_blog_filemaker)

### FileMaker Magazin

- [Ausgabe 6/2017, Seite 26](https://filemaker-magazin.de/neuigkeit/3967-Appetithappen-FMM_201706)

This function checks for a license.

Created 16th January 2017 , last changed 9th August 2021

  
[DynaPDF.Print.GetSetting](DynaPDFPrintGetSetting.md) - [DynaPDF.Print.SetDevNames](DynaPDFPrintSetDevNames.md)

[HTML Version](DynaPDFPrintSetDevMode.shtml)