tags:

views:

174

answers:

2

Hello, I've document and I want to change all template parameters like {name}, {address} to my own values. I tried to use POI HWPF Library, but I lost document formatting after saving. Even when I open my MS Word document with POI and save it (without any changes) document formatting is lost:) Formatting means centering, font size, etc (there are no any tables or pictures - just 'plain text').

What library I can use for this case? Maybe anyone have expirience with MS Word documents and java. Requirements: Open Source, Without using any Windows COM components (muliplatform), Not OOXML - Microsoft Word XP 2003.

There are similar question (about truncating document after saving) http://stackoverflow.com/questions/1108886/java-parsing-ms-word-document-using-poi-hwpf

+1  A: 

I can't tell from own experience, but have you tried the OOo Java API's? From what I've heard and seen is that they're very good and flexible. And that not only for MS Word documents.

Give it a try.

BalusC
it seems to OOo will work fine for my task, because oowriter fine opens and saves target document.
A: 

Aspose.Words for Java has the best support for Microsoft Word document formats among commercial libraries.

romeok