Topics   All   Mac OS X (Only)   Windows (Only)   Linux (Only, Not)   iOS (Only, Not)  
Components   Crossplatform Mac & Win   Server (Not)   Client   Old   Guides
New in version: 5.4   6.0   6.1   6.2   6.3   6.4   6.5   7.0   7.1   7.2    Statistic  


The function skews the coordinate system and sets the coordinate origin to the point OriginX, OriginY.

Component: DynaPDF
Version: 3.2
Mac OS X: Yes
Windows: Yes
Server: Yes
FileMaker Cloud: Yes

MBS( "DynaPDF.RotateCoords"; PDF; a; x; y )


Parameter Description Example value
PDF The PDF reference returned from DynaPDF.New. $pdf
a Angle alpha in degrees 30
x Origin of the x-axis $x
y Origin of the y-axis $y


Returns OK on success and error on failure.


The function skews the coordinate system and sets the coordinate origin to the point OriginX, OriginY.
It is highly recommended to save the graphics state beforehand, otherwise it is very difficult or impossible to restore the coordinate system later.
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 skewed coordinate system.

To rotate a page you can use DynaPDF.SetOrientation or DynaPDF.SetOrientationEx.


Rotate and draw rectangle:

MBS( "DynaPDF.SaveGraphicState"; $PDF )
MBS( "DynaPDF.RotateCoords"; $PDF; 30; 150; 450)
MBS( "DynaPDF.Rectangle"; $PDF; 0; 0; 200; 100; "stroke" )
MBS( "DynaPDF.RestoreGraphicState"; $PDF )

Rotate graphics system 270° for whole page:

MBS("DynaPDF.TranslateCoords"; $pdf; MBS("DynaPDF.GetPageWidth";$pdf)/2; MBS( "DynaPDF.GetPageHeight";$pdf)/2)
MBS("DynaPDF.RotateCoords"; $pdf; 270; 0; 0)
MBS("DynaPDF.TranslateCoords"; $pdf; -MBS( "DynaPDF.GetPageHeight";$pdf)/2; -MBS("DynaPDF.GetPageWidth";$pdf)/2)

Draw text rotated:

# save
Set Variable [$r; Value: MBS("DynaPDF.SaveGraphicState"; $pdf)]
# get page size
Set Variable [$w; Value: MBS("DynaPDF.GetPageWidth"; $pdf)]
Set Variable [$h; Value: MBS("DynaPDF.GetPageHeight"; $pdf)]
# move center to middle of page
Set Variable [$r; Value: MBS("DynaPDF.TranslateCoords"; $PDF; $w/2; $h/2)]
# rotate here by 30 degree
Set Variable [$r; Value: MBS("DynaPDF.RotateCoords"; $PDF; 30; 0; 0)]
# move center back
Set Variable [$r; Value: MBS("DynaPDF.TranslateCoords"; $PDF; -$w/2; -$h/2)]
# now draw some text
Set Variable [$r; Value: MBS("DynaPDF.SetTextRect"; $pdf; 0; 500; MBS("DynaPDF.GetPageWidth"; $pdf); -1)]
Set Variable [$r; Value: MBS("DynaPDF.WriteFText"; $pdf; "center"; Watermark pages::WatermarkText )]
# restore
Set Variable [$r; Value: MBS("DynaPDF.RestoreGraphicState"; $pdf)]

See also

DynaPDF.RestoreGraphicState   -   DynaPDF.RotateTemplate

Feedback: Report problem or ask question.

MBS FileMaker Plugins - Pfarrgemeinde Ministranten Nickenich