Posted:There may be a time when you want to generate new Word documents or modify an existing document using Java.
Make sure that this is absolutely necessary. In most cases, a nonproprietary file format such as PDF, RTF, or HTML is the better choice. There are free libraries available for all of these. In the cases of RTF and HTML, the standard JDK provides the javax.swing.text package to manipulate the file formats. A rule of thumb for creating Word documents is: Will the eventual recipients of these documents want to edit them? If not, the PDF or HTML format is a better choice. If they do wish to edit them, consider using RTF instead of the Word file format.