当前位置: 首页 > news >正文

大连做网站优化公司网站流量的转换率一般是多少

大连做网站优化公司,网站流量的转换率一般是多少,权鸟拓客app,wordpress数据查询网站需求#xff1a;做个公文系统#xff0c;需要将正文文档在某个节点点击套红按钮#xff0c;实现文档套红 试了很多方法#xff0c;大多数网上能查到但是实际代码不能找到关键方法#xff0c;可能是跟包的版本有关系#xff0c;下面记录能用的这个。 一#xff1a;添加依…需求做个公文系统需要将正文文档在某个节点点击套红按钮实现文档套红 试了很多方法大多数网上能查到但是实际代码不能找到关键方法可能是跟包的版本有关系下面记录能用的这个。 一添加依赖 dependencygroupIdorg.apache.poi/groupIdartifactIdpoi/artifactIdversion4.1.2/version/dependencydependencygroupIdorg.apache.poi/groupIdartifactIdpoi-ooxml/artifactIdversion4.1.2/version/dependencydependencygroupIdorg.apache.poi/groupIdartifactIdpoi-ooxml-schemas/artifactIdversion4.1.2/version/dependencydependencygroupIdcom.deepoove/groupIdartifactIdpoi-tl/artifactIdversion1.9.1/versionexclusionsexclusionartifactIdslf4j-log4j12/artifactIdgroupIdorg.slf4j/groupId/exclusion/exclusions/dependencydependencygroupIde-iceblue/groupIdartifactIdspire.doc/artifactIdversion12.6.2/version/dependency二、文档 模板{{date}}是可以获取到的变量 文档 三、代码 public static void word2RedDocument(String content, MapString, Object data, String destDocx) throws Exception {//模板文件地址String model D:\\套红模板.docx;//模板文件 参数填写XWPFTemplate template XWPFTemplate.compile(model).render(data);//获取模板文件 公文NiceXWPFDocument main template.getXWPFDocument();//正文文档NiceXWPFDocument sub new NiceXWPFDocument(new FileInputStream(content));ListXWPFParagraph paragraphs main.getParagraphs();NiceXWPFDocument newDoc new NiceXWPFDocument();for (XWPFParagraph p:paragraphs) {if( null ! p p.getText().contains(正文)){//这里是要去掉正文两个字自己debug看了索引为了保险起见应该遍历run判断p.removeRun(0);XWPFRun run p.createRun();// 合并两个文档到指定位置newDoc main.merge(Arrays.asList(sub),run);break;}}// 设置页码--开始--没有需求可以删掉XWPFFooter footer newDoc.createFooter(HeaderFooterType.DEFAULT);//创建一个新的XWPFFooter对象XWPFParagraph paragraph footer.createParagraph();//创建新的XWPFParagraph对象paragraph.setAlignment(ParagraphAlignment.CENTER);//设置样式居中//设置段落对象XWPFRun runPre paragraph.createRun();//新的段落对象runPre.setText(- );XWPFRun run paragraph.createRun();//新的段落对象CTFldChar fldChar run.getCTR().addNewFldChar();//新的CTFldChar对象fldChar.setFldCharType(STFldCharType.Enum.forString(begin));CTText ctText run.getCTR().addNewInstrText();ctText.setStringValue(PAGE \\* MERGEFORMAT);ctText.setSpace(SpaceAttribute.Space.Enum.forString(preserve));fldChar run.getCTR().addNewFldChar();fldChar.setFldCharType(STFldCharType.Enum.forString(end));//设置段落对象XWPFRun runSuf paragraph.createRun();//新的段落对象runSuf.setText( -);// 将页脚添加到所有的页面XWPFHeaderFooterPolicy headerFooterPolicy new XWPFHeaderFooterPolicy(newDoc);headerFooterPolicy.createFooter(STHdrFtr.DEFAULT, new XWPFParagraph[]{paragraph}); // 设置页码--结束--没有需求可以删掉//可以是生成新文档也可以生成到原来的正文content D:\\新文档.docx;// 生成新文档FileOutputStream out new FileOutputStream(content);newDoc.write(out);newDoc.close();out.close();//doc转pdfdoc2Pdf(content); // ByteArrayOutputStream os new ByteArrayOutputStream(); // newDoc.write(os); // InputStream is new ByteArrayInputStream(os.toByteArray()); // os.close();}调用方法测试 public static void main(String[] args) throws Exception {String sourceFile D:\\模板.docx;String targetFile D:\\测试.docx;MapString, Object data new HashMap(2);ListString list Arrays.asList(技术, 测试, 评选结果, 测试, 评选结果, 测试, 评选结果);StringBuilder builder new StringBuilder();for (int i 0;ilist.size();i) {builder.append(list.get(i));if (i ! list.size() -1){builder.append( );}}data.put(num, 931);data.put(year, 2024);data.put(name, 销售中心销售中心销售中心销售中心销售中心销售中心销售中心销售中心销售中心销售中心销售中心销售中心销售中心销售中心销售中心销售中心销售中心);data.put(keyword,builder ); // data.put(keyword, Arrays.asList(技术,测试,评选结果,测试,评选结果,测试,评选结果)); // data.put(keyword, Arrays.asList(技术,测试));data.put(user, 李斯); // data.put(company, 股份有限公司技术股份有限公司);data.put(date, getChineseDate());word2RedDocument(targetFile,data,新文档.docx);} 转换时间的方法 public static String getChineseDate() {Calendar cal Calendar.getInstance();SimpleDateFormat sdf new SimpleDateFormat(yyyy年MM月dd日, Locale.CHINA);String date sdf.format(cal.getTime());// 将数字转换为汉字String[] chineseNumbers {〇, 一, 二, 三, 四, 五, 六, 七, 八, 九};StringBuilder chineseDate new StringBuilder();for (int i 0; i date.length(); i) {if(i4 || i7 || i10){chineseDate.append(date.charAt(i));} else {int number Character.getNumericValue(date.charAt(i));if(i5 || i8 ){if(number0){continue;}}chineseDate.append(chineseNumbers[number]);}}return chineseDate.toString();}执行方法 结果文档如下 XWPFDocument类相关
http://www.w-s-a.com/news/142811/

相关文章:

  • 九州建网站网页游戏平台代理
  • 培训课程网站网上下载的网站模板怎么用
  • 重庆山艺网站建设塘厦理工学校
  • 做网站的人叫什么软件玩具网站设计
  • 网站说服力营销型网站策划 pdf深圳有什么公司名称
  • 做物流的可以在那些网站找客户男生晚上正能量你懂我意思
  • 宁德市城乡住房建设厅网站教育机构logo
  • 做定制网站价格有网站了怎么做app
  • 做网站和制作网页的区别北京朝阳区最好的小区
  • 网站策划 ppt北京装修公司排名推荐
  • 郑州网站建设公司哪家专业好如何注册一家公司
  • 证券投资网站做哪些内容滨州论坛网站建设
  • 重庆网站建设公司模板广东佛山
  • 中展建设股份有限公司网站做网站备案是什么意思
  • 石家庄网站建设接单wordpress功能小工具
  • 有没有专门做网站的网站镜像上传到域名空间
  • 网站建设中 windows买域名自己做网站
  • 设计英语宁波seo做排名
  • 奉贤网站建设上海站霸深圳几个区
  • c#做网站自已建网站
  • 成都地区网站建设网站设计类型
  • 如何做网站结构优化北京响应式网站
  • 出售源码的网站威海住房建设局网站
  • 网站建设补充报价单网站建设 技术指标
  • 做网站费用分摊入什么科目做网络网站需要三证么
  • 房屋备案查询系统官网杭州排名优化软件
  • 网站地图html网络营销的流程和方法
  • 注册好网站以后怎么做wordpress 获取插件目录下
  • 南京做网站dmooo地方网站需要什么手续
  • 网站开发合同有效期omeka wordpress对比