RTFTemplateBuilder builder = RTFTemplateBuilder.newRTFTemplateBuilder();
/**
* 2. Get freemarker engine
*/
ITemplateEngine freemarkerEngine =
builder.newTemplateEngine(RTFTemplateBuilder.FREEMARKER_ENGINE);
/**
* 3. Set the template
*/
StringReader template = new StringReader("Today : ${date}");
freemarkerEngine.setTemplate(template);
/**
* 4. Put context
*/
freemarkerEngine.put("date", "12/02/2007");
/**
* 5. Merge context with template
*/
StringWriter writer = new StringWriter();
freemarkerEngine.merge(writer);
// => Result of merge
System.out.println(writer.getBuffer());
}
catch(Exception e) {