LabelComponentImpl title = createTitle();
LegendComponentImpl legend = new LegendComponentImpl();
legend.setTag(PrintTemplate.LEGEND);
map.addComponent(bar);
map.addComponent(legend);
map.addComponent(northarrow);
page.addComponent(map);
page.addComponent(title);
PrintTemplate template = new PrintTemplate(true);
template.setName("Default" + "-" + pageSize + "-" + (landscape ? "landscape" : "portrait"));