views:

249

answers:

2

I need to choose a good template engine to generate documents in our application. The requirements are:

  • Generate Microsoft Word and PDF at least
  • Good templating capabilities including support for simple replacable parameters, arrays/lists, and hierarchies if possible
  • Allow to include custom graphics
  • Ideally templates should be editable with Microsoft applications or other user-friendly equivalent

The task is to feed some data structure from the system and make a nice document from it. Examples include reports, business proposals, product visions and more. Ideas are welcome :)

One approach is to write one myself but maybe there is something out-of-the-box and not necessarily free. Technically best if it could be cross-platform but Windows-only is fine as well as a last resort.

+1  A: 

People are using docx4j to do that sort of thing. (Disclaimer: that's my project)

docx4j gives you the tools to create docx documents (as opposed to the old binary ones), and output to PDF (though ymmv).

For commercial document generation, look at the likes of Exari and Thunderhead.

plutext
See http://dev.plutext.org/svn/docx4j/trunk/docx4j/sample-docs/databinding/conventions.html for how to do this with Word's custom xml binding architecture.
plutext
A: 

You can use Aspose.Words for .NET. See the architecture image on the first page and you will see that all what you want is well covered.

romeok