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: 12.2   12.3   12.4   12.5   13.0   13.1   13.2   13.3   13.4   13.5    Statistic    FMM    Blog  

DynaPDF.PlaceTemplate

The function places a template on a page, another open template, or pattern.

Component Version macOS Windows Linux Server iOS SDK
DynaPDF 3.3 ✅ Yes ✅ Yes ✅ Yes ✅ Yes ✅ Yes
MBS( "DynaPDF.PlaceTemplate"; PDF; TemplateHandle; X; Y; W; H )   More

Parameters

Parameter Description Example
PDF The PDF reference returned from DynaPDF.New. $pdf
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

Result

Returns OK or error message.

Description

The 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 or DynaPDF.ImportPageAsTemplate.
Templates can be used multiple times on different pages or positions and with different sizes. Unlike images, a template can be scaled without losing quality as far as the template contains vector graphics and text objects only.
The calculation of the width and height is the same as for images:


Imported pages can contain non-normalized bounding boxes and the page can be rotated. The coordinate origin, crop box, and rotation angle of a page must be considered when placing a template on a page because templates do not support features like a crop box or individual orientation angles. The required calculations to find the correct coordinate origin and to de- rotate a template are relatively complex. Therefore, DynaPDF provides the function DynaPDF.PlaceTemplateEx which considers the, coordinate origin, orientation angle, and crop box automatically. DynaPDF.PlaceTemplateEx greatly simplifies the handling of templates. If possible, this function should be used when working with imported pages.

Remarks: A template is invisible as long it was not placed on a page, template, or pattern. Templates should not be used inside of patterns because this requires usually too much rendering time.

See also PlaceTemplate function in DynaPDF manual.

See also

Blog Entries

This function checks for a license.

Created 18th August 2014, last changed 26th May 2018


DynaPDF.PlaceSigFieldValidateIcon - DynaPDF.PlaceTemplateEx

💬 Ask a question or report a problem