This utility class contains static methods to support printing.
Current methods support printing of multiple drawing surfaces via a print template. The print template is drawn using an editor. It should contain one or more item templates. These are rectangles, referenced by name, which indicate where on the page a drawing surface may be placed. Item templates may be embedded in the print template when it is loaded, or added at run-time using the 'addItemTemplate' method. In this way, items may be moved dynamically around the printed page.
Note that the layers are copied from the Drawing Surfaces specified in the TSLPrintItems to an internal one held within the Print Helper class. This means that any 'id' on the specified Drawing Surfaces will not be available during the print.
- Note
- : This class is not supported on non-Windows platforms.
static bool TSLPrintHelper::printUsingTemplate |
( |
TSLPrintContext & | context, |
|
|
int | numItems, |
|
|
const TSLPrintItem * | items, |
|
|
const TSLEntitySet * | printTemplate, |
|
|
int | numTextMappings, |
|
|
const char * | textMapping[][2], |
|
|
bool | newPage = false, |
|
|
bool | printTemplateFirst = true ) |
|
static |
This method allows printing of multiple drawingSurfaces using a page template to provide a frame.
Multiple items may be printed, for example a main map, with additional overlaid enlargements. Text mappings may be made which convert placeholder text in the framework template to new text. For example, a copyright message in the template may be kept up to date by adding some placeholder text in the template, say 'YEAR'. By supplying a text mapping of 'YEAR' to '2001', the copyright message may be modified dynamically without editing the framework
- Parameters
-
context | Print context to print to. HDC on Windows. |
numItems | This is the number of items to be printed within the template. |
items | This points to an array of the items required to be printed. |
printTemplate | This is the entity set containing the framework of the printed page. |
numTextMappings | Number of text mappings supplied. |
textMapping | Array of text mappings, with the framework text first, followed by the new text. |
newPage | If the flag is true, then startPage/endPage calls are made. |
printTemplateFirst | If the flag is true, then the template is printed before the items, otherwise it is printed afterwards. |
- Returns
- true if successful, false otherwise.
- Note
- Not supported on X11 targets.