开发者

Convert RTF files to DOC

I generate a report in doc 开发者_如何学编程format using Jasper, Jasper uses JRRTFExporter to generate doc reports, but wen i try and compare doc reports using POI it throws exception stating some header issues. Is there any way to convert rtf to doc in jasper or any API available to convert rtf to doc? Please help!


There are some projects with handling rtf files, but all of them are third-party, so - not reliable, especially because rtf is not open format. Most reliable solution is to use word automation. Script which makes word to open rtf file and save it as .doc file will consist of tree strings of code in any language and can be easily googled :)


You could use Docmosis to do this if you want, or the OpenOffice UNO API directly since you don't need any other features of Docmosis. If it is an option, using Docmosis to generate the doc from scratch will give you less overhead, but you have to wear the cost of migrating.


Load the RTF in Microsoft.Office.Interop.Word application using a Document object. After reading from the RTF you can save the loaded document object as a Word format (*.doc). I guess this can be a solution. I did this using c# .Net 3.5

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜