@Override public void toTestDocument(OutputStream out) throws InvalidTemplateException, IOException { TemplateContext<E> context = contextFactory.createTemplateContext(this); prepareDocument(); document.updateDynamicContent(context); document.writeAsOpenXML(out); }
@Override public void toDocument(E data, OutputStream out) throws IOException, InvalidTemplateException { prepareDocument(); TemplateContext<E> context = contextFactory.createTemplateContext(this); context.bind(data); document.updateDynamicContent(context); document.writeAsOpenXML(out); }