loadHeaderAndFooter(doc, doc.args);
}
}
private void loadHeaderAndFooter(PDFDocument doc, Map<String, Object> args) throws TemplateNotFoundException {
Options options = doc.options;
if(options == null)
return;
if(!StringUtils.isEmpty(options.HEADER_TEMPLATE)){
Template template = TemplateLoader.load(options.HEADER_TEMPLATE);
options.HEADER = template.render(new HashMap<String, Object>(args));