DynaPDF.SetOrientation
----------------------

Changes the orientation of the page.

| Component | Version | macOS | Windows | Linux | Server | iOS SDK |
|---|---|---|---|---|---|---|
| [DynaPDF](component_DynaPDF.md) | [3.5](newinversion35.md) | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |

MBS( "DynaPDF.SetOrientation"; PDF; Value ) 

**MBS**( **"DynaPDF.SetOrientation";** /\* Changes the orientation of the page. \*/  
**$PDF**; /\* The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). \*/   
**$Value**) /\* The new roatation value. From -360 to 360 in 90 degree steps.e.g. 90 \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| PDF | The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). | $pdf |
| Value | The new roatation value. From -360 to 360 in 90 degree steps. | 90 |

### Result

Returns OK or error message.

### Description

Changes the orientation of the page.  
The function sets the orientation of a page. The parameter Value must be a multiple of 90 or 0. Positive values rotate the page clockwise, negative counter counter clockwise.  
Note that the page will be rotated entirely incl. all objects. The width and height of the page are left unchanged, including the coordinates. Creating landscape paper formats require further such as changing the coordinate system. This can be done with [DynaPDF.SetOrientationEx](DynaPDFSetOrientationEx.md). Another way to create a landscape paper format is to change the bounding box of the page, see [DynaPDF.SetBBox](DynaPDFSetBBox.md).  
  
Default is 0.  
  
See also [DynaPDF.SetOrientationEx](DynaPDFSetOrientationEx.md).  
See also [SetOrientation](https://www.monkeybreadsoftware.com/DynaPDF-Manual/SetOrientation.shtml) function in DynaPDF manual.

### Examples

Create landscape picture with orientation:

 # Add page   
Set Variable \[ $r ; Value: MBS ("[DynaPDF.AppendPage](DynaPDFAppendPage.md)"; $pdf ) \]   
\# Rotate page 90°   
Set Variable \[ $r ; Value: MBS ("DynaPDF.SetOrientation"; $pdf ; 90) \]   
\# draw something...   
\#   
\# End page   
Set Variable \[ $r ; Value: MBS ("[DynaPDF.EndPage](DynaPDFEndPage.md)"; $pdf ) \]  
### See also

- [DynaPDF.AppendPage](DynaPDFAppendPage.md)
- [DynaPDF.EndPage](DynaPDFEndPage.md)
- [DynaPDF.GetFieldOrientation](DynaPDFGetFieldOrientation.md)
- [DynaPDF.GetOrientation](DynaPDFGetOrientation.md)
- [DynaPDF.New](DynaPDFNew.md)
- [DynaPDF.Parser.SelectionBBox](DynaPDFParserSelectionBBox.md)
- [DynaPDF.RotateCoords](DynaPDFRotateCoords.md)
- [DynaPDF.RotateTemplate](DynaPDFRotateTemplate.md)
- [DynaPDF.SetFieldOrientation](DynaPDFSetFieldOrientation.md)
- [DynaPDF.SetOrientationEx](DynaPDFSetOrientationEx.md)

### Blog Entries

- [MBS FileMaker Plugin 3.5 for OS X/Windows - More than 2100 Functions In One Plugin](https://www.mbsplugins.de/archive/2013-12-17/MBS_FileMaker_Plugin_35_for_OS/monkeybreadsoftware_blog_filemaker)

This function checks for a license.

Created 18th August 2014 , last changed 3th January 2021

  
[DynaPDF.SetOpacity](DynaPDFSetOpacity.md) - [DynaPDF.SetOrientationEx](DynaPDFSetOrientationEx.md)

[HTML Version](DynaPDFSetOrientation.shtml)