DynaPDF.TranslateCoords
-----------------------

The function translates the coordinate system to the new origin OriginX, OriginY.

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

MBS( "DynaPDF.TranslateCoords"; PDF; X; Y ) 

**MBS**( **"DynaPDF.TranslateCoords";** /\* The function translates the coordinate system to the new origin OriginX, OriginY. \*/  
**$PDF**; /\* The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). \*/   
**$X**; /\* New coordinate origin of the x-axis \*/   
**$Y**) /\* New coordinate origin of the y-axis \*/ 

### Parameters

| Parameter | Description | Example |
|---|---|---|
| PDF | The PDF reference returned from [DynaPDF.New](DynaPDFNew.md). | $pdf |
| X | New coordinate origin of the x-axis | $x |
| Y | New coordinate origin of the y-axis | $y |

### Result

Returns OK on success and error on failure.

### Description

The function translates the coordinate system to the new origin OriginX, OriginY.   
Save the graphics state beforehand and restore it when finish.  
After the coordinate system was changed by the function, bottom-up coordinates are active. It is not possible to use top-down coordinates with a transformed coordinate system.  
Please do not try to scale/skew/translate back later. use [DynaPDF.SaveGraphicState](DynaPDFSaveGraphicState.md) and [DynaPDF.RestoreGraphicState](DynaPDFRestoreGraphicState.md).  
See also [TranslateCoords](https://www.monkeybreadsoftware.com/DynaPDF-Manual/TranslateCoords.shtml) function in DynaPDF manual.

### Examples

Translate and draw rectangle:

 MBS ( "[DynaPDF.SaveGraphicState](DynaPDFSaveGraphicState.md)"; $PDF )  
MBS ( "DynaPDF.TranslateCoords"; $PDF ; 200;200)  
MBS ( "[DynaPDF.Rectangle](DynaPDFRectangle.md)"; $PDF ; 0; 0; 200; 100; "stroke" )  
MBS ( "[DynaPDF.RestoreGraphicState](DynaPDFRestoreGraphicState.md)"; $PDF )  
### See also

- [DynaPDF.New](DynaPDFNew.md)
- [DynaPDF.PlaceTemplate](DynaPDFPlaceTemplate.md)
- [DynaPDF.Rectangle](DynaPDFRectangle.md)
- [DynaPDF.RestoreGraphicState](DynaPDFRestoreGraphicState.md)
- [DynaPDF.RotateCoords](DynaPDFRotateCoords.md)
- [DynaPDF.Save](DynaPDFSave.md)
- [DynaPDF.SaveGraphicState](DynaPDFSaveGraphicState.md)

### Example Databases

- [Barcode/DynaPDF Barcode](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/Barcode/DynaPDF%20Barcode.shtml#2ScriptAnchor_)
- [DynaPDF/Coordinates](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Coordinates.shtml#5ScriptAnchor_)
- [DynaPDF/Place Template](https://www.mbsplugins.eu/MBS-FileMaker-Plugin-Examples/DynaPDF/Place%20Template.shtml#2ScriptAnchor_)

This function checks for a license.

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

  
[DynaPDF.TextAnnot](DynaPDFTextAnnot.md) - [DynaPDF.Triangle](DynaPDFTriangle.md)

[HTML Version](DynaPDFTranslateCoords.shtml)