要具体操作通过XWPFDocument 可以获得的docx中的各种对象,我们离不开一个对象为XWPFRun对象,API结构org.apache.poi.xwpf.usermodel.XWPFRun。其描述为:XWPFRun object defines a region of text with a common set of properties。通过描述我们不难理解其作用为设置文本对象的各种属性。
@Component("xWPRUNTest") public class XWPRUNTest {
//模板文件地址 private static String inputUrl = "C:\\Users\\zhihe\\Desktop\\demo\\001.docx"; public void runTest(){