The documents that we produce (invoices, confirmation letters etc.) are based on Microsoft Word documents. They are built using the standard Microsoft Word mail merge fields. We then merge in data from the database to generate the document.
This is great because our clients can produce their own templates in tools they are familiar with!
We use the .Net components from Aspose to generate these documents as it is not recommended to use Word as a server side component – and they do this very well indeed.
One of the things that we wanted to do was import HTML formatted text into the Word template. Now it turns out that this is not straightforward and initially Aspose did not support it. So we wrote our own.
Recently we contributed our code for the HTML import to help get the functionality into the core component. During the exchange Roman sent over some of the unit tests that they use to test their components.
A couple of them are reproduced (with permission) below for your benefit:
As you can see they have collected several HTML fragments that they use to feed the HTML to Word conversion classes, then they check that the text comes back out as expected. They have over 350 test for their Word component alone. No wonder we’ve never had any problems with them…