DynaPDF Manual - Page 490

Previous Page 489   Index   Next Page 491

Function Reference
Page 490 of 787
The function can be used in two ways, inside an open page or outside.
Calling the function inside of an open page
If the function is called inside an open page, the external page will be imported and scaled by using
the scaling factors ScaleX and ScaleY, if the import flag ifImportAsPage is not set (see
SetImportFlags() for further information). All bounding boxes of the page will be scaled too and the
orientation will be set to the value of the source page.
An external page can only be scaled to an arbitrary format if it is converted to a template. This
conversion is done if the import flag ifImportAsPage is not set (default).
However, if a page must not be scaled or used as a template on multiple pages the flag
ifImportAsPage should be set to avoid the conversion of pages to templates. In this case, the scaling
factors will be ignored and the page is imported as is.
If an imported page contains a crop box (see GetBBox()) the property UseVisibleCoords can be used
to move all coordinates into the visible area of the crop box. If the property is true, all functions
consider the coordinate origin of the crop box to calculate the position of an object.
Calling the function outside of an open page
If the function is called outside of an open page, no interactive objects are imported and the scaling
factors ScaleX and ScaleY are ignored. The page becomes converted to a template. The function
works then exactly like ImportPage(). The resulting template can be placed on one or more pages
with PlaceTemplate() or better PlaceTemplateEx(). The latter version is preferred because it
considers the coordinate origin of the template as well as a maybe existing crop box and it preserves
the original page orientation.
Remarks:
This function is available in an Ansi and Unicode compatible version.
Return values:
If the function succeeds and if the imported page was converted to a template, the return value is a
template handle, a value greater or equal zero.
If the imported page was not converted to a template and if the function succeeds, the return value
is zero. If the function fails the return value is a negative error code.
 

Previous topic: ImportPageEx

Next topic: ImportPDFFile

Start Chat