RTFTemplateBuilder builder = RTFTemplateBuilder.newRTFTemplateBuilder();
/**
* 2. Get RTF parser
*/
IRTFDocumentParser parser = builder.newRTFDocumentParser();
/**
* 3. Get RTF Document of the rtf source model
*/
String rtfSourceModel = "test.rtf";
InputStream inputStream = TestFreemarkerTransformer.class.getResourceAsStream(rtfSourceModel);
parser.parse(inputStream);
RTFDocument document = parser.getRTFDocument();
/**
* 4. Prepare RTF context fields
* => set the field which must be transformed
* In test.rtf, there is a mergefield called "date"