Commit 9bff1093 by shj

word说明生成完成,并提供下载

parent 66c7aed3
import org.apache.poi.xwpf.usermodel.*; import org.apache.poi.xwpf.usermodel.*;
import org.junit.Test; import org.junit.Test;
import org.openxmlformats.schemas.wordprocessingml.x2006.main.CTSectPr;
import java.io.FileNotFoundException; import java.io.FileNotFoundException;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.IOException; import java.io.IOException;
import java.math.BigInteger;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
...@@ -14,8 +16,11 @@ public class PoiTest { ...@@ -14,8 +16,11 @@ public class PoiTest {
FileOutputStream out = new FileOutputStream("F:/new.docx"); FileOutputStream out = new FileOutputStream("F:/new.docx");
XWPFParagraph paragraph = document.createParagraph(); XWPFParagraph paragraph = document.createParagraph();
paragraph.setSpacingBeforeLines(100);
XWPFRun run = paragraph.createRun(); XWPFRun run = paragraph.createRun();
run.setText("一、设备费"); run.setText("一、设备费");
run.setFontSize(18);
run.setBold(true);
paragraph=document.createParagraph(); paragraph=document.createParagraph();
run=paragraph.createRun(); run=paragraph.createRun();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment