aspose file tools*
The moose likes Other Open Source Projects and the fly likes poi problem with reading and writing in the same word file Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "poi problem with reading and writing in the same word file" Watch "poi problem with reading and writing in the same word file" New topic
Author

poi problem with reading and writing in the same word file

Raluca Stanculescu
Greenhorn

Joined: Mar 19, 2010
Posts: 3
Hello everybody,

I haven't been able to find a solution to this problem for a while now. You are my last hope.
I am trying to fill out a word document from java with text (it's a CV type thing) and tables.
Anyway it goes something like this



The problem is that while poi 3.6 doesn't keep the same fonts and format of the initial file, poi 3.2 (I read on a forum that it will work), does keep some of the formatting but it still is no good at all.

I find it unbelievable that something as important as this does not work.

Kind regards,

Raluca
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41884
    
  63
The DOC support of POI is rather basic, especially when it comes to changing existing documents. If you need to use DOC, consider using OpenOffice's Java API through OO's server mode. Or maybe use a format that's easier to work with, like RTF which is just text, and thus amenable to string search/replace operations.


Ping & DNS - my free Android networking tools app
Raluca Stanculescu
Greenhorn

Joined: Mar 19, 2010
Posts: 3
Thanks!
I have decided to go another way with this, by using this API.
http://rtftemplate.sourceforge.net/
Luckily it meets all my needs.


Hope this helps somebody.

Raluca
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: poi problem with reading and writing in the same word file