Word07Writer
Origin
Hutool encapsulates Word (mainly in docx format) to achieve simple Word file creation.
Introduction
Hutool encapsulates Word generation in POI as Word07Writer
, and achieves Word generation through segmented writing.
Usage Example
Word07Writer writer = new Word07Writer();
// Add paragraph (title)
writer.addText(new Font("FangZheng XiaoBiaoSong JianTi", Font.PLAIN, 22), "I am the first part", "I am the second part");
// Add paragraph (body text)
writer.addText(new Font("SongTi", Font.PLAIN, 22), "I am the first part of the body text", "I am the second part of the body text");
// Flush to file
writer.flush(FileUtil.file("e:/wordWrite.docx"));
// Close
writer.close();