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

网站建设案例基本流程永久免费网站建设方案

网站建设案例基本流程,永久免费网站建设方案,公司变更登记申请表,上海建设网站一、免费方式 优点#xff1a;1、免费#xff1b;2、在众多免费中挑选出的转换效果相对较好#xff0c;并且不用像openOffice那样安装服务 缺点#xff1a;1、对字体支持没有很好#xff0c;需要安装字体库或者使用宋体#xff08;对宋体支持很好#xff09;2、对于使…一、免费方式 优点1、免费2、在众多免费中挑选出的转换效果相对较好并且不用像openOffice那样安装服务 缺点1、对字体支持没有很好需要安装字体库或者使用宋体对宋体支持很好2、对于使用freeMarker模板转化过来的doc无法读取转换 第一步 dependencygroupIdorg.apache.poi/groupIdartifactIdpoi-ooxml/artifactIdversion3.17/version/dependencydependencygroupIdfr.opensagres.xdocreport/groupIdartifactIdfr.opensagres.poi.xwpf.converter.pdf-gae/artifactIdversion2.0.1/version/dependency 第二步 public static void main(String[] args) throws Exception {FileInputStream fileInputStream new FileInputStream(D:\\test\\研判报告docx.docx);XWPFDocument xwpfDocument new XWPFDocument(fileInputStream); // 将word中字体转化为宋体防止其他字体无法正常显示setFontType(xwpfDocument);FileOutputStream fileOutputStream new FileOutputStream(D:\\test\\研判报告11.docx);PdfConverter.getInstance().convert(xwpfDocument,fileOutputStream,pdfOptions);fileInputStream.close();fileOutputStream.close();}/**** 将文档的文字设置为宋体 防止其他字体转pdf不显示* Description:* param xwpfDocument* return:*/private static void setFontType(XWPFDocument xwpfDocument) {//转换文档中文字字体ListXWPFParagraph paragraphs xwpfDocument.getParagraphs();if(paragraphs ! null paragraphs.size()0){for (XWPFParagraph paragraph : paragraphs) {ListXWPFRun runs paragraph.getRuns();if(runs !null runs.size()0){for (XWPFRun run : runs) {run.setFontFamily(宋体);}}}}//转换表格里的字体 我也不想俄罗斯套娃但是不套真不能设置字体ListXWPFTable tables xwpfDocument.getTables();for (XWPFTable table : tables) {ListXWPFTableRow rows table.getRows();for (XWPFTableRow row : rows) {ListXWPFTableCell tableCells row.getTableCells();for (XWPFTableCell tableCell : tableCells) {ListXWPFParagraph paragraphs1 tableCell.getParagraphs();for (XWPFParagraph xwpfParagraph : paragraphs1) {ListXWPFRun runs xwpfParagraph.getRuns();for (XWPFRun run : runs) {run.setFontFamily(宋体);}}}}}} 二、收费方式 除了收费没啥缺点 1、freemarker生成word模板 ①、自己新建一个word文档内容就按照需要的格式内容 ②、word文档另存为选择xml格式 ③、修改xml后缀为ftl放在如图位置 ④代码 public static void main(String[] args) throws Exception {//1.创建配置类Configuration configurationnew Configuration(Configuration.getVersion());//2.设置模板所在的目录configuration.setDirectoryForTemplateLoading(new File(.\\template));//3.设置字符集configuration.setDefaultEncoding(utf-8);//4.加载模板Template template configuration.getTemplate(研判报告docx.ftl);//5.创建数据模型Map mapnew HashMap();map.put(name,姓名姓名);map.put(idCard,身份证号码);map.put(age,36);map.put(sex,男);MapString, Object data1 new HashMap();data1.put(item,map);Writer out new FileWriter(new File(.\\template\\研判报告docx.docx));//7.输出template.process(data1, out);//8.关闭Writer对象out.close();} 2、word转pdf ①、新建asposeLicense.xml放到如图位置 asposeLicense.xml内容 LicenseDataProductsProductAspose.Total for Java/ProductProductAspose.Words for Java/Product/ProductsEditionTypeEnterprise/EditionTypeSubscriptionExpiry20991231/SubscriptionExpiryLicenseExpiry20991231/LicenseExpirySerialNumber8bfe198c-7f0c-4ef8-8ff0-acc3237bf0d7/SerialNumber/DataSignaturesNLLKGMUdF0r8O1kKilWAGdgfs2BvJb/2Xp8p5iuDVfZXmhppod0Ran1P9TKdjV4ABwAgKXxJ3jcQTqE/2IRfqwnPf8itN8aFZlV3TJPYeD3yWE7IT55Gz6EijUpC7aKeoohTb4w2fpox58wWoF3SNp6sK6jDfiAUGEHYJ9pjU/Signature /License ②、代码 public static void main(String[] args) {String docPath .\\template\\研判报告docx.docx;String savePath .\\template\\研判报告docx4.pdf;word2pdf(docPath, savePath);}public static void word2pdf(String docPath, String savePath) {try {ClassPathResource resource new ClassPathResource(asposeLicense.xml);InputStream inputStream resource.getInputStream();License license new License();license.setLicense(inputStream);com.aspose.words.Document document new com.aspose.words.Document(docPath);document.save(new FileOutputStream(new File(savePath)), SaveFormat.PDF);} catch (Exception e) {e.printStackTrace();}}
http://www.yutouwan.com/news/403467/

相关文章:

  • 投资担保网站建设将网页制作成app
  • 西安做网站公司xamokjwordpress vtrois
  • 个人网站备案能做什么内容科技与狠活是什么梗
  • 中国建设职业注册中心网站免费网站平台推荐
  • 上海网站建设网页制作怎么样周口网站建设 网站制作 网络推广
  • 南宁网站制作开发公司泰安千橙网站建设优化熊掌号
  • 做便宜网站珠海网站建设制作
  • 查询网站流量的网址微网站域名
  • 做外单网站有哪些建设银行啦卡信用网站
  • 和男人人做的网站深圳建网站三千
  • 思政网站建设管理自查报告学历提升快速拿证
  • 有没有专门做橱窗的案例网站网站制作 徐州
  • 设计网站的一般过程网站中链接怎么做
  • 如何建设社交网站wordpress安装主题后不够
  • 网站建设调研论文阿里云有了域名 网站建设
  • 商会网站设计网站策划ps
  • 班级网站网页设计做图表好看的网站
  • 怎样在网站上做免费的推广wordpress开发文档下载
  • 坪地网站制作网站手机网站制作
  • 什么网站可以免费做视频it运维培训
  • 国外设计文章的网站网站宣传册怎么做的
  • 辽宁注册公司网站企业网站建设应注意什么
  • 宁波建设协会网站关键词优化是什么意思
  • 公司做网站的费用怎么账务处理智通人才网东莞最新招聘信息官网
  • 安徽静安集团网站建设深圳网站建设公司 概况
  • 宁波网站建设哪家比较好怎么在网上卖东西视频
  • 网站建设十大公司临河网站建设
  • 大连网站制作团队高校网站建设说明书
  • 无锡个人网站建设世界十大著名室内设计师
  • 在线报名网站建设如何建立设计一个公司网站