Mac OS X
Components Crossplatform Mac & Win Server Client Old Guides Examples
New in version: 7.1 7.2 7.3 7.4 7.5 8.0 8.1 8.2 8.3 8.4 Statistic
The function places a template on a page, another open template, or pattern.
|Component||Version||macOS||Windows||Server||FileMaker Cloud||FileMaker iOS SDK|
|The PDF reference returned from DynaPDF.New.|
|TemplateHandle||The handle value returned from DynaPDF.ImportPageAsTemplate function.||$template|
|X||The x coordinate.||$x|
|Y||The y coordinate. Please notice that PDF coordinates start at bottom of page except you change that with DynaPDF.SetPageCoords functions.||$y|
|W||The width of the destination rectangle.||$w|
|H||The height of the destination rectangle.||$h|
Returns OK or error message.
DescriptionThe function places a template on a page, another open template, or pattern.
The parameter TemplateHandle must be a valid template handle that was returned by DynaPDF.BeginTemplate, DynaPDF.ImportPageAsTemplate.
The function was specifically designed to work with templates which were created from imported pages. A PDF page is converted to a template if it was imported with DynaPDF.ImportPageAsTemplate outside of an open page.
The calculation of the width and height is the same as for images:
- If Width or Height is -1 the function uses the mirrored original width or height from the template.
- If Width or Height is 0, the missing value is calculated in relation to the given value of Height or Width to preserve the template's aspect ratio. The resulting output is a template with exact proportions relative to its original size.
- If Width and Height are 0, the original size is used (same effect as -1 but the template is not mirrored).
- A negative value of Width or Height mirrors the template on the x- or y-axis.
A template does not support a crop box or orientation angle. When placing a template on a page that was created from a PDF page, the coordinate origin must be adjusted according to the original media or crop box. In addition, the template must maybe be drawn into a clipping path (if the original page contained a crop box), and the template must maybe also be rotated so that the original orientation can be preserved.
All these considerations complicate the handling of imported templates. To make the usage of imported templates easier the function considers the coordinate origin, it draws the template automatically into a clipping rectangle if required, and it rotates the template according to the original page orientation.
The only thing that must be considered is that the original size of the template must be calculated from the crop box if present. In addition, the so computed width and height must be exchanged if the original page orientation was 90, -90, 270, or -270 degrees.
See also PlaceTemplateEx function in DynaPDF manual.
Created 18th August 2014, last changed 22nd April 2015
Feedback: Report problem or ask question.
MBS Xojo Plugins