Components | All | New | MacOS | Windows | Linux | iOS | ||||
Examples | Mac & Win | Server | Client | Guides | Statistic | FMM | Blog | Deprecated | Old |
DynaPDF.TranslateCoords
The function translates the coordinate system to the new origin OriginX, OriginY.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
DynaPDF | 3.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
MBS( "DynaPDF.TranslateCoords"; PDF; x; y ) More
Parameters
Parameter | Description | Example |
---|---|---|
The PDF reference returned from DynaPDF.New. | ||
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 and DynaPDF.RestoreGraphicState.
See also TranslateCoords function in DynaPDF manual.
Examples
Translate and draw rectangle:
MBS( "DynaPDF.SaveGraphicState"; $PDF )
MBS( "DynaPDF.TranslateCoords"; $PDF; 200;200)
MBS( "DynaPDF.Rectangle"; $PDF; 0; 0; 200; 100; "stroke" )
MBS( "DynaPDF.RestoreGraphicState"; $PDF )
See also
- DynaPDF.New
- DynaPDF.Rectangle
- DynaPDF.RestoreGraphicState
- DynaPDF.RotateCoords
- DynaPDF.Save
- DynaPDF.SaveGraphicState
Example Databases
This function checks for a license.
Created 18th August 2014, last changed 18th August 2014