Topics
All
MacOS
(Only)
Windows
(Only)
Linux
(Only, Not)
iOS
(Only, Not)
Components
Crossplatform Mac & Win
Server
Client
Old
Deprecated
Guides
Examples
Videos
New in version:
9.5
10.0
10.1
10.2
10.3
10.4
10.5
11.0
11.1
11.2
Statistic
FMM
Blog
The function skews the coordinate system and sets the coordinate origin to the point OriginX, OriginY.
Component | Version | macOS | Windows | Linux | Server | iOS SDK |
DynaPDF | 3.2 | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes | ✅ Yes |
Parameter | Description | Example | Flags |
---|---|---|---|
The PDF reference returned from DynaPDF.New. | |||
a | Angle alpha in degrees | 30 | |
x | Origin of the x-axis | $x | |
y | Origin of the y-axis | $y | |
RotateCoords | Whether to rotate coordinate system. This is now done by DynaPDF automatically, so for current version of the library, this must be zero. But older versions need the 1. |
0 | Optional |
Returns OK on success and error on failure.
See also RotateCoords function in DynaPDF manual.
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)]
Created 18th August 2014, last changed 4th December 2018
DynaPDF.RestoreGraphicState - DynaPDF.RotateTemplate
Feedback: Report problem or ask question.