This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes I/O and Streams and the fly likes Write word document Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » I/O and Streams
Bookmark "Write word document" Watch "Write word document" New topic
Author

Write word document

Priyank Joshi
Greenhorn

Joined: Aug 25, 2010
Posts: 1
I am searching API for writing word document.
The way iText provides extensive functionality for writing into PDF, same i need for writing into word.
But I am unable to find.
I hv gone throgh Apache POI site, but i dont think it will serve my purpose.

My requirement -> writing text, images, tables, image sizing, header/footer, font styling etc..

Please if some one can help...
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19656
    
  18

The MS Word format is not as open as the PDF format. That makes it hard for people to write APIs for reading / manipulating it. Most libraries, like POI, have been created using reverse engineering of existing Word documents.

You could try using OpenOffice.org in server mode. I haven't done anything like that myself so I can't help you with it though. JODConverter uses this technique for converting from and to Word documents.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Lester Burnham
Rancher

Joined: Oct 14, 2008
Posts: 1337
From my experience with POI it's unlikely that you will be able to create complex Word document with it - the DOC(X) part of it is way behind the XSL(X) part.

RTF is a much easier format to generate, though, is much better documented, and support everything you mention. Plus, every word processor can open it. Maybe that would be an alternative? iText 2.1 supports RTF as an output format.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Write word document
 
Similar Threads
Stroring Word Documents into MYSQL Database
Design document
Stroring Word Documents into MYSQL Database
How to scroll in a JEditorPane
java.io.IOException: Unable to read entire block; 493 bytes read before EOF; expected