Package words.document

Source Code of words.document.ApacheNewDocument

package words.document;

import java.io.FileOutputStream;

import org.apache.poi.xwpf.usermodel.XWPFDocument;
import org.apache.poi.xwpf.usermodel.XWPFParagraph;
import org.apache.poi.xwpf.usermodel.XWPFRun;

public class ApacheNewDocument
{
  public static void main(String[] args) throws Exception
  {
    XWPFDocument document = new XWPFDocument();
    XWPFParagraph tmpParagraph = document.createParagraph();
    XWPFRun tmpRun = tmpParagraph.createRun();
    tmpRun.setText("Apache Sample Content for Word file.");
    tmpRun.setFontSize(18);
   
    FileOutputStream fos = new FileOutputStream("data/Apache_newWordDoc.doc");
    document.write(fos);
    fos.close();
  }
}
TOP

Related Classes of words.document.ApacheNewDocument

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.