Question

I already have a solution for this task:
I use the Word Interop classes, create n word instances and let them convert (save as) all my files. (Where n is the amount of threads which can be changed to reduce performance load or increase performance)

This works with the following speeds:
100 files -> 15,6 Sekunden
1.000 -> 156s = ~2 ½ Minuten
10.000 -> 1562s = 26 Minuten

As you can see it's rather slow...

What alternatives could I look into to speed up this process?
It can be in Java or C#.
It must have equal conversion accuracy compared to MS Word.

Was it helpful?

Solution

The faster approach I found for creating Word documents is using an XSLT stylesheet to transform the data from an XML source. I don't have time measurements, but it's much faster than COM Interop.

http://msdn.microsoft.com/en-us/library/ee872374(v=office.12).aspx

http://www.developer.com/xml/article.php/3798066/Take-the-Pain-out-of-Creating-Word-Documents-by-Using-C-and-XML.htm

Also, beware that using Office Automation is not a supported scenario for web sites or unattended applications.

http://support.microsoft.com/kb/257757

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top