Components All New MacOS Windows Linux iOS
Examples Mac & Win Server Client Guides Statistic FMM Blog Deprecated Old

DynaPDF.RotateTemplate

Rotates a template.

Component Version macOS Windows Linux Server iOS SDK
DynaPDF 7.0 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "DynaPDF.RotateTemplate"; PDF; Template; Rotation )   More

Parameters

Parameter Description Example
PDF The PDF reference returned from DynaPDF.New. $pdf
Template The handle to the template of a page. $template
Rotation The rotation angle.
Can be 0, 90, 180 or 270.
90

Result

Returns template handle or error.

Description

Rotates a template.
Returns a new template handle.
This is a convenience function which creates a new template and draws the existing template there with rotation.

Examples

Import, rotate and place:

#Create new PDF document
Set Variable [$pdf; Value:MBS("DynaPDF.New")]
#Load PDF from container
Set Variable [$r; Value:MBS("DynaPDF.OpenPDFFromContainer"; $pdf; DynaPDF PlaceTemplate::InputPDF)]
#Import first page as template
Set Variable [$template; Value:MBS("DynaPDF.ImportPageAsTemplate"; $pdf; 1)]
#Create 4 rotations:
Set Variable [$template0; Value:MBS("DynaPDF.RotateTemplate"; $pdf; $template; 0)]
Set Variable [$template90; Value:MBS("DynaPDF.RotateTemplate"; $pdf; $template; 90)]
Set Variable [$template180; Value:MBS("DynaPDF.RotateTemplate"; $pdf; $template; 180)]
Set Variable [$template270; Value:MBS("DynaPDF.RotateTemplate"; $pdf; $template; 270)]
#Make new page and place PDF there in original size (0/0) in position (0/0)
Set Variable [$r; Value:MBS("DynaPDF.AppendPage"; $pdf)]
Set Variable [$r; Value:MBS("DynaPDF.PlaceTemplate"; $pdf; $template; 100; 100; 200; 300)]
Set Variable [$r; Value:MBS("DynaPDF.SetStrokeColor"; $pdf; 255; 0; 0)]
Set Variable [$r; Value:MBS("DynaPDF.Rectangle"; $pdf; 100-1; 100-1; 200+2; 300+2; "Stroke")]
Set Variable [$r; Value:MBS("DynaPDF.EndPage"; $pdf)]
Set Variable [$r; Value:MBS("DynaPDF.AppendPage"; $pdf)]
Set Variable [$r; Value:MBS("DynaPDF.PlaceTemplate"; $pdf; $template0; 100; 100; 200; 300)]
Set Variable [$r; Value:MBS("DynaPDF.SetStrokeColor"; $pdf; 255; 0; 0)]
Set Variable [$r; Value:MBS("DynaPDF.Rectangle"; $pdf; 100-1; 100-1; 200+2; 300+2; "Stroke")]
Set Variable [$r; Value:MBS("DynaPDF.EndPage"; $pdf)]
Set Variable [$r; Value:MBS("DynaPDF.AppendPage"; $pdf)]
Set Variable [$r; Value:MBS("DynaPDF.PlaceTemplate"; $pdf; $template90; 100; 100; 300; 200)]
Set Variable [$r; Value:MBS("DynaPDF.SetStrokeColor"; $pdf; 255; 0; 0)]
Set Variable [$r; Value:MBS("DynaPDF.Rectangle"; $pdf; 100-1; 100-1; 300+2; 200+2; "Stroke")]
Set Variable [$r; Value:MBS("DynaPDF.EndPage"; $pdf)]
Set Variable [$r; Value:MBS("DynaPDF.AppendPage"; $pdf)]
Set Variable [$r; Value:MBS("DynaPDF.PlaceTemplate"; $pdf; $template180; 100; 100; 200; 300)]
Set Variable [$r; Value:MBS("DynaPDF.SetStrokeColor"; $pdf; 255; 0; 0)]
Set Variable [$r; Value:MBS("DynaPDF.Rectangle"; $pdf; 100-1; 100-1; 200+2; 300+2; "Stroke")]
Set Variable [$r; Value:MBS("DynaPDF.EndPage"; $pdf)]
Set Variable [$r; Value:MBS("DynaPDF.AppendPage"; $pdf)]
Set Variable [$r; Value:MBS("DynaPDF.PlaceTemplate"; $pdf; $template270; 100; 100; 300; 200)]
Set Variable [$r; Value:MBS("DynaPDF.SetStrokeColor"; $pdf; 255; 0; 0)]
Set Variable [$r; Value:MBS("DynaPDF.Rectangle"; $pdf; 100-1; 100-1; 300+2; 200+2; "Stroke")]
Set Variable [$r; Value:MBS("DynaPDF.EndPage"; $pdf)]
#done, save to container
Set Field [DynaPDF PlaceTemplate::OutputPDF; MBS("DynaPDF.Save"; $pdf; "Merged.pdf")]
#done, save to container
Set Variable [$r; Value:MBS("DynaPDF.Release"; $pdf)]

See also

Release notes

Example Databases

Blog Entries

This function checks for a license.

Created 7th January 2017, last changed 7th January 2017


DynaPDF.RotateCoords - DynaPDF.RoundRect