首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往
您找到你想要的搜索结果了吗?
是的
没有找到

word导出03

public static void exportWordImg(String wordpath,List<String> contentlist,String[] imglist) throws Exception{         exportQuestionWord t=new exportQuestionWord();         WordprocessingMLPackage wordMLPackage = t.createWordprocessingMLPackage();         MainDocumentPart mp = wordMLPackage.getMainDocumentPart();         ObjectFactory factory = Context.getWmlObjectFactory();         //图片页眉         //Relationship relationship =t.createHeaderPart(wordMLPackage, mp, factory);         //文字页眉         //Relationship relationship =t.createTextHeaderPart(wordMLPackage, mp, factory, "页眉", JcEnumeration.CENTER);         //t.createHeaderReference(wordMLPackage, mp, factory, relationship);         t.addParagraphTest(wordMLPackage, mp, factory,contentlist,imglist);         //t.addPageBreak(wordMLPackage, factory);         //t.createNormalTableTest(wordMLPackage, mp, factory);         //页脚         //relationship =t.createFooterPageNumPart(wordMLPackage, mp, factory);         //t.createFooterReference(wordMLPackage, mp, factory, relationship);         t.saveWordPackage(wordMLPackage, new File(wordpath));     }     public void addParagraphTest(WordprocessingMLPackage wordMLPackage,                                  MainDocumentPart t, ObjectFactory factory,List<String> contentlist,String[] imglist) throws Exception {         RPr titleRPr = getRPr(factory, "黑体", "000000", "30", STHint.EAST_ASIA,                 true, false, false, false);         RPr boldRPr = getRPr(factory, "宋体", "000000", "24", STHint.EAST_ASIA,                 true, false, false, false);         RPr fontRPr = getRPr(factory, "宋体", "000000", "22", STHint.EAST_ASIA,                 false, false, false, false);         P paragraph=factory.createP();         Text txt = null;         R run=null;         File file=null;         InputStream is=null;         if(contentlist!=null || contentlist.size()>0){         for (int i = 0; i < contentlist.size(); i++) {             if(contentlist.get(i).contains("22.发生肺水肿时的应急处理错误的是")){

01
领券