Overview
RTFTemplate is RTF engine RTF to RTF, which is able to generate RTF by merging template RTF (model RTF source) with JAVA object (context). RTFTemplate use Velocity for merging template with JAVA object.
Steps to Merge RTF template and Java Context:
References:-
http://sourceforge.net/projects/rtftemplate/
http://rtftemplate.sourceforge.net/
Examples.
Address example.
Dependency example.
Steps to Merge RTF template and Java Context:
- Step Parse RTF model source (1) consist to load RTF model source into RTFDocument structure .RTFDocument contains the whole RTF model, which split RTF elements interpretated by RTFTemplate as fields (RTFField), bookmarks (RTFBookmark)...
- Step Transform RTF Document (2) consist to transform the RTFDocument structure, in other words:
- replace RTF code with specific macro swith template engine selected (ex : replace bookmark with#foreach macro when RTFTemplate is used with Velocity).
- remove some RTF code. For merge fields (MERGEFIELD), RTFTemplate remove the character " which include merge fields.
Steps for office Integration
- RTF template can be created with MS Word by, using MERGEFIELD, HYPERLINK and BOOKMARK (cf. RTF specification).
- This template will be merged with Java objects (can be from database, LDAP etc.) and RTF file will be generated at particular target.
- These files can be saved in RTF as well as PDF format.
- The generated files can be printed or send by email.
http://sourceforge.net/projects/rtftemplate/
http://rtftemplate.sourceforge.net/
Examples.
Address example.
Dependency example.