}
public PrintTemplate createDefaultTemplate(String pagesize, boolean landscape) throws PrintingException {
PrintTemplate template = createTemplate(pagesize, landscape);
// calculate the sizes (if not already calculated !)
SinglePageDocument document = new SinglePageDocument(template.getPage(), null);
try {
document.layout(Format.PDF);
} catch (PrintingException e) {
// should not happen !
log.warn("Unexpected problem while laying out default print template", e);
}
return template;