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

做淘宝客建网站要多少费用做网站域名有什么用

做淘宝客建网站要多少费用,做网站域名有什么用,可以做彩页的网站,秘密入口3秒自动转接连接word、excel、pdf、image转换工具类 1.感谢2.包含的工具类3.lib文件说明3.1 使用的3.2 未使用的 4.核心代码4.1 WordToPdfUtil4.2 ExcelToPdfUtil4.3 PdfToImageUtil 6.问题处理6.1 Word中文无法转换6.2 Excel中文无法转换 7.总结 1.感谢 感谢小伙伴儿的分享#xff1a; ● 不… word、excel、pdf、image转换工具类 1.感谢2.包含的工具类3.lib文件说明3.1 使用的3.2 未使用的 4.核心代码4.1 WordToPdfUtil4.2 ExcelToPdfUtil4.3 PdfToImageUtil 6.问题处理6.1 Word中文无法转换6.2 Excel中文无法转换 7.总结 1.感谢 感谢小伙伴儿的分享 ● 不羁 ● 郭中天 整合调整后的工具类Gitee地址https://gitee.com/yuanzhengme/java_application_aspose_demo 2.包含的工具类 ● WordToPdfUtil用于将word文档转换为pdf格式的工具类 ● ExcelToPdfUtil用于将excel文档转换为pdf格式的工具类 ● PdfToImageUtil用于将pdf文档转换为image格式的工具类 3.lib文件说明 3.1 使用的 ● aspose-words-15.8.0-jdk16.jar 将word文档转换为pdf需要引入 ● aspose-cells-8.5.2.jar 将excel文档转换为pdf需要引入 ● aspose-cells-20.7.jar 将excel文档转换为pdf需要引入Linux端中文出现乱码时使用 3.2 未使用的 ● aspose-words-15.12.0-jdk16.jar 未测试 ● aspose-pdf-22.4.cracked.jar 将pdf转换为其他格式【破解版效果不佳】 ● aspose-pdf-22.4.jar 将pdf转换为其他格式【未破解效果依然不佳】 4.核心代码 4.1 WordToPdfUtil /*** word 转 pdf** param wordFilePath word文件路径* param pdfFilePath pdf文件路径*/public static void convert(String wordFilePath, String pdfFilePath) {FileOutputStream fileOutputStream null;try {pdfFilePath pdfFilePath null ? getPdfFilePath(wordFilePath) : pdfFilePath;setLicense();File file new File(pdfFilePath);fileOutputStream new FileOutputStream(file);Document doc new Document(wordFilePath);doc.save(fileOutputStream, SaveFormat.PDF);} catch (Exception e) {e.printStackTrace();} finally {try {assert fileOutputStream ! null;fileOutputStream.close();} catch (IOException e) {e.printStackTrace();}}}4.2 ExcelToPdfUtil /*** excel 转 pdf** param excelFilePath excel文件路径* param pdfFilePath pdf文件路径* param convertSheets 需要转换的sheet*/public static void convert(String excelFilePath, String pdfFilePath, int[] convertSheets) {FileOutputStream fileOutputStream null;try {pdfFilePath pdfFilePath null ? getPdfFilePath(excelFilePath) : pdfFilePath;// 设置LicensesetLicense();// 读取excel文件Workbook wb new Workbook(excelFilePath);fileOutputStream new FileOutputStream(pdfFilePath);// 设置pdf格式PdfSaveOptions pdfSaveOptions new PdfSaveOptions();pdfSaveOptions.setOnePagePerSheet(true);if (null ! convertSheets) {printSheetPage(wb, convertSheets);}wb.save(fileOutputStream, pdfSaveOptions);fileOutputStream.flush();} catch (Exception e) {e.printStackTrace();} finally {try {assert fileOutputStream ! null;fileOutputStream.close();} catch (IOException e) {e.printStackTrace();}}}4.3 PdfToImageUtil /*** 根据参数将全部的PDF转换为Image** param pdfFilePath PDF文件路径* param imageFileDir 图片存储目录* param imageFileName 图片存储文件没* param type 图片类型*/public static void convertAllPage(String pdfFilePath, String imageFileDir, String imageFileName, String type) {System.setProperty(sun.java2d.cmm, sun.java2d.cmm.kcms.KcmsServiceProvider);// 图片类型if (type null || .equals(type)) {type IMAGE_TYPE_JPG;}// 1.加载PDF文件File file new File(pdfFilePath);// 2.生成JPG图片的文件夹imageFileDir imageFileDir null ? getImageFileDir(pdfFilePath) : imageFileDir;imageFileName imageFileName null ? getImageFileName(pdfFilePath) : imageFileName;try {PDDocument pdDocument PDDocument.load(file);PDFRenderer renderer new PDFRenderer(pdDocument);int pageCount pdDocument.getNumberOfPages();for (int i 0; i pageCount; i) {BufferedImage image renderer.renderImageWithDPI(i, 144);ImageIO.write(image, type,new File(imageFileDir.concat(File.separator).concat(imageFileName).concat(_).concat(String.valueOf(i 1)).concat(.).concat(type)));}} catch (IOException e) {e.printStackTrace();}}6.问题处理 都需要将字体文件simsun.ttc上传到jarPath/font目录下。 6.1 Word中文无法转换 在Linux环境下如果转换后的pdf文件无中文在WordToPdfUtil转换方法里添加以下代码 // 设置字体 String realPath new ApplicationHome(WordToPdfUtil.class).getSource().getParentFile().toString(); FontSettings.setFontsFolder(realPath File.separatorChar font, false);6.2 Excel中文无法转换 使用aspose-cells-20.7.jar: dependencygroupIdcom.aspose.cells/groupIdartifactIdaspose-cells/artifactIdversion20.7/versionscopesystem/scopesystemPath${project.basedir}/lib/aspose-cells-20.7.jar/systemPath /dependency并在ExcelToPdfUtil转换方法里添加以下代码 // 设置字体 String realPath new ApplicationHome(WordToPdfUtil.class).getSource().getParentFile().toString(); String fontDir realPath File.separatorChar font; IndividualFontConfigs individualFontConfigs new IndividualFontConfigs(); individualFontConfigs.setFontFolder(fontDir, false); LoadOptions loadOptions new LoadOptions(); loadOptions.setFontConfigs(individualFontConfigs); // 读取excel文件 Workbook wb new Workbook(excelFilePath, loadOptions);7.总结 PDF转换为其他格式的方法效果不佳遇到好的方案会进行补充。主要用到aspose的jar包实际上是需要授权的否则会有水印是个隐患。
http://www.pierceye.com/news/127764/

相关文章:

  • wordpress门户网站模板下载大专计算机专业主要学什么
  • 专业的微商城网站建设农产品网站建设计划书
  • 软件网站开发公司广告公司创意取名
  • 工业设计东莞网站建设个人网站备案网站名称
  • 网站只能用ip访问网站吗导航网站 win8风格
  • 用ps可以做网站吗制作一个网站流程
  • 做网站支付系统难度做灯笼手工简单做法
  • 合肥珍岛公司做网站推广怎么样用excel做网站
  • 大连网站建设开源广告制作行业
  • 安阳河南网站建设wordpress 建立导航
  • 电子商务网站建设 考卷wordpress替换头像
  • 石家庄的网站的公司手机wordpress加载图片慢
  • 建企业网站教程wordpress网站被黑
  • 饮料网站建设市场分析什么是seo网站优化
  • 滑动网站国家级示范建设网站
  • 做一门户网站价格个人网站制作模板图片
  • 做网站需要审核资质吗wordpress 防恶意注册
  • 怎么不花钱建网站无人售货机
  • 可以做空股票的网站thinkphp网站开发
  • 给别人做网站怎么赚钱吗专业网络推广软件
  • SOHO英文网站制作晋江网站制作
  • 启东住房和城乡建设局网站邢台网站制作报价多少钱
  • 佛山网站建设seo优化做英文的小说网站有哪些
  • 安顺建设局网站官网哪里有响应式网站企业
  • 唯品会一家做特卖的网站国家商标查询官方网站
  • 网站宝搭建网站环境做电商网站一般需要什么流程图
  • 南通网站建设团队wordpress广告产检
  • 做网站刷赞qq怎么赚钱邢台路桥建设总公司没有网站吗
  • 网站仿站教程常用外贸网站
  • 南昌市有帮做网站的吗纵横天下网站开发