使用POI 读取 Excel 文件,读取手机号码 变成 科学计数 的解决办法 https://my.oschi…
不静之心

分类:专业工具
一步步完成FastDFS + Spring MVC上传下载整合示例
一步步完成FastDFS + Spring MVC上传下载整合示例 https://my.oschina.ne…
JAVA多媒体处理库-JAVE
JAVA多媒体处理库-JAVE http://baike.xsoftlab.net/view/746.html…
CentOS7 mini系统中安装VBoxLinuxAdditions增强功能
向VirtualBox中CentOS7 mini系统中安装VBoxLinuxAdditions增强功能 htt…
Aspose.Slides for Java 转成pdf和图片等
1 2 3 4 5 6 |
<dependency> <groupId>com.aspose</groupId> <artifactId>aspose-slides</artifactId> <version>16.7.0</version> <!--<version>17.5-jdk16</version>--> </dependency> |
[crayon-681559b…
Centos6下安装中文字体,centos6中文字体
先安装字体管理软件
1 |
[root@localhost ~]# yum install fontconfig |
将需要安装的字体放到/u…
用poi把ppt或pptx转为图片
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 |
public static java.util.List<String> convertPng(File file, File outputFolder, String newFileName) throws Exception { // TODO 校验输入文件是否存在 以及是否为PPT java.util.List<String> newFileList = Lists.newArrayList(); try { if (!outputFolder.exists()) { outputFolder.mkdirs(); } if (StringUtils.isBlank(newFileName)) { newFileName = UUID.randomUUID().toString().replace("-", "")+"_"; } String newFilePath = null; FileInputStream is = new FileInputStream(file); HSLFSlideShow ppt = new HSLFSlideShow(is); is.close(); Dimension pgsize = ppt.getPageSize(); int idx = 1; for (HSLFSlide slide : ppt.getSlides()) { //防止中文乱码 for(HSLFShape shape : slide.getShapes()){ if(shape instanceof HSLFTextShape) { HSLFTextShape tsh = (HSLFTextShape)shape; for(HSLFTextParagraph p : tsh){ for(HSLFTextRun r : p){ r.setFontFamily("宋体"); } } } } newFilePath = outputFolder.getAbsolutePath() + "/" + newFileName + idx + ".png"; File newFile = new File(newFilePath); if (newFile.exists()) { newFile.delete(); } System.out.println("正在处理PPT TO PNG, page=" + idx); BufferedImage img = new BufferedImage(pgsize.width, pgsize.height, BufferedImage.TYPE_INT_RGB); Graphics2D graphics = img.createGraphics(); // clear the drawing area graphics.setPaint(Color.white); graphics.fill(new Rectangle2D.Float(0, 0, pgsize.width, pgsize.height)); // render slide.draw(graphics); // save the output FileOutputStream out = new FileOutputStream(newFilePath); javax.imageio.ImageIO.write(img, "png", out); out.close(); System.out.println("处理完成PPT TO PNG, page=" + idx); newFileList.add(newFilePath); idx++; } } catch (FileNotFoundException e) { throw new RuntimeException("没有找到相应的文件"); } catch (IOException e) { throw new RuntimeException("系统出现IO异常,无法继续处理"); }catch (OfficeXmlFileException e){ throw new RuntimeException("请使用2003, 2007的格式PPT"); }catch (Exception e){ e.printStackTrace(); throw new RuntimeException("请使用2003, 2007的格式PPT"); } return newFileList; } |
chrome 远程调试
方式一: 远程调式手机的chrome浏览器 详解参考: http://blog.csdn.net/freshl…
HttpClient4.x 使用cookie保持会话
HttpClient4.x 使用cookie保持会话 https://my.oschina.net/yiqif…
UEditor应用 —— 图片上传
UEditor应用 —— 图片上传 https://my.oschina.net/u/3452433/blog…
使用POI、Spring MVC导出EXCEL
https://my.oschina.net/u/2930573/blog/796620 另外一个工具类也相当…
maven setting.xml配置详解
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 |
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <!--指定本地仓库存储路径。默认值为~/.m2/repository 即 ${user.home}/.m2/repository。 --> <localRepository>d:/.m2/repository</localRepository> <!--指定Maven是否需要和用户输入进行交互。true:需要与用户交互;false:使用一个合理的默认值。默认值为true。 --> <interactiveMode>true</interactiveMode> <!--指定是否使用plugin-registry.xml文件来管理插件版本。设为true表示使用。默认值为false。--> <usePluginRegistry>false</usePluginRegistry> <!--指定是否在离线模式下运行。设为true表示项目构建要在离线模式下运行,默认值为false。 --> <offline>false</offline> <!-- 指定插件groupId列表,用于搜索时插件的groupId没有明确规定。 --> <pluginGroups> <!-- 指定使用插件查找进一步的组标识符 --> <pluginGroup>com.micmiu.plugins</pluginGroup> </pluginGroups> <!-- 指定这台机器连接到网络的代理服务器的列表。除非另有规定(系统属性或命令行开关), 列表中配置的第一代理将被激活使用。--> <proxies> <!-- 配置代理服务器的相关参数 --> <proxy> <!-- 代理标识ID,默认值:default --> <id>micmiuProxy</id> <!-- 指定是否激活,默认值:true --> <active>true</active> <!-- 指定代理协议,默认值:http --> <protocol>http</protocol> <!-- 指定代理认证的用户名 --> <username>micmiu</username> <!-- 指定代理认证用户的密码 --> <password>mypwd</password> <!-- 指定代理服务器的主机名 --> <host>micmiu.com</host> <!-- 指定代理服务的端口 默认值:8080 --> <port>80</port> <!-- 指定不被代理的主机名列表。多个用|分隔。--> <nonProxyHosts>ctosun.com|ctosun.micmiu.com</nonProxyHosts> </proxy> </proxies> <!-- 这是一个认证配置的列表,系统内部根据配置的serverID使用。认证配置用于maven链接到远程服务--> <servers> <!-- 指定的身份认证信息用于连接到一个特定的服务器时,确定系统内的唯一的名称(简称下面的'id'属性)。--> <server> <!-- 这是server的id(注意不是用户登陆的id)。该id与distributionManagement中repository元素的id必须要匹配。--> <id>micmiu-releases</id> <!-- 服务器认证的用户名 --> <username>michael</username> <!-- 服务器认证的用户对应的密码 --> <password>mypwd</password> </server> <!-- 另一个示例 私钥/密码 --> <server> <id>micmiu-snapshots</id> <!-- 认证时使用的私钥文件。 --> <privateKey>/home/micmiu/.ssh/id_dsa</privateKey> <!-- 认证时使用的私钥密码,没有密码就设为空 --> <passphrase>mypwd</passphrase> <!-- 目录被创建时的权限设置。其值对应了unix文件系统的权限,如664,或者775 --> <directoryPermissions>775</directoryPermissions> <!-- 仓库文件创建时的权限设置。其值对应了unix文件系统的权限,如664,或者775。 --> <filePermissions>664</filePermissions> </server> </servers> <!-- 指定镜像列表,用于从远程仓库下载资源 --> <mirrors> <!-- 指定仓库的镜像站点,代替一个给定的库。该镜像藏库有一个ID相匹配的mirrorOf元素。 ID是用于继承和直接查找目的,必须是唯一的。--> <mirror> <!--该镜像的唯一标识符。id用来区分不同的mirror元素。 --> <id>mirrorId</id> <!--被镜像的服务器的id,比如:central,不能和id匹配。--> <mirrorOf>central</mirrorOf> <name>micmiu for dev.</name> <url>http://dev.micmiu.com/repo/maven2</url> </mirror> </mirrors> <!-- 这是一个可以在各种不同的方式激活的配置文件列表,并可以修改构建过程。在settings.xml中提供的信息, 旨在提供本地机器允许建立在本地环境中工作的具体路径和库位置。有多种方式可以激活配置属性:一种在settings.xml中<activeProfiles>指定; 另一种实质上依赖于系统属性,无论是匹配特定的属性值或只是测试到它的存在.配置文件也可以根据JDK版本的前缀进行激活,1.4 可以激活1.4.2_07 注:对于在settings.xml中定义的配置,你仅限于指定资源仓库、插件仓库和用于插件在POM中变量的自由形式属性的定义 --> <profiles> <!-- 指定生成过程的介绍,使用一个或多个上述机制被激活。对于继承而言,激活通过<activatedProfiles/>或命令行配置文件, 配置文件必须有一个唯一的ID。此配置文件的例子使用的JDK版本触发激活。--> <profile> <!--该配置的唯一标识符。 --> <id>jdk-1.4</id> <!--自动触发配置文件的逻辑定义。Activation的逻辑配置决定了是否开启该profile。activation元素并不是激活profile的唯一方式。 settings.xml文件中的activeProfile元素可指定需要激活的profile的id。 profile也可以通过在命令行,使用-P标记和逗号分隔的列表来显式的激活 --> <activation> <!--指定是否激活的标识 默认值为false--> <activeByDefault>false</activeByDefault> <!--当匹配的jdk被检测到,profile被激活。例如,1.4激活JDK1.4,1.4.0_2,而!1.4激活所有不是以1.4开头的JDK版本。--> <jdk>1.4</jdk> <!-- 当检测到匹配的操作系统属性时,指定该配置文件将被激活, --> <os> <!--激活profile的操作系统的名字 --> <name>windows 7</name> <!--激活profile的操作系统所属家族(如 'windows') --> <family>windows</family> <!--激活profile的操作系统体系结构 --> <arch>x86</arch> <!--激活profile的操作系统版本--> <version>6.1</version> </os> <!-- 检测系统对应的属性和值(该值可在POM中通过${属性名称}引用),配置就会被激活。 如果值字段是空的,那么存在属性名称字段就会激活 --> <property> <!-- 属性的名称 --> <name>mavenVersion</name> <!-- 属性的值 --> <value>3.0.4</value> </property> <!-- 通过检测该文件的是否存在来激活配置。missing检查文件是否存在,如果不存在则激活profile;exists则会检查文件是否存在,如果存在则激活。--> <file> <!--如果指定的文件存在,则激活profile。 --> <exists>/usr/local/micmiu/workspace/myfile</exists> <!--如果指定的文件不存在,则激活profile。--> <missing>/usr/local/micmiu/workspace/myfile</missing> </file> </activation> <!-- 对应profile的扩展属性列表。Maven属性和Ant中的属性一样,可以用来存放一些值。这些值可以在POM中的任何地方使用标记${X}来使用, 这里X是指属性的名称。属性有五种不同的形式,并且都能在settings.xml文件中访问。 1. env.X: 表示系统环境变量。例如,"env.PATH" 等同于 $path环境变量(在Windows上是%PATH%)。 2. project.x:表示 POM中对应的属性值。 3. settings.x: 表示 settings.xml中对应属性值。 4. Java系统属性: 所有可通过java.lang.System.getProperties()访问的属性都能在POM中使用该形式访问。 5. x: 在<properties/>元素中,或者外部文件中设置,以${someVar}的形式使用。 --> <properties> <user.blog>www.micmiu.com</user.blog> </properties> </profile> <!-- 这是另一个配置文件,根据系统属性来激活 --> <profile> <!--该配置的唯一标识符。 --> <id>env-dev</id> <activation> <property> <!-- 被用来激活配置文件的属性的名称 --> <name>target-env</name> <!-- 被用来激活配置文件的属性的值 --> <value>dev</value> </property> </activation> <!-- 指定配置文件的扩展配置 内容采取property.value的形式 --> <properties> <tomcatPath>/path/to/tomcat/instance</tomcatPath> </properties> </profile> <profile> <id>repo-dev</id> <!-- 配置远程仓库列表 --> <repositories> <!-- 远程仓库的配置信息 --> <repository> <!-- 远程仓库唯一标识--> <id>nexus</id> <!-- 远程仓库名称 --> <name>nexus for develop</name> <!-- 远程仓库URL --> <url>http://192.168.1.8:8080/nexus/content/groups/public/</url> <layout>default</layout> <releases> <!--是否使用这个资源库下载这种类型的构件 默认值:true--> <enabled>true</enabled> <!--指定下载更新的频率。这里的选项是:always(一直),daily(每日,默认值),interval:X(这里X是指分钟),或者never(从不)。 --> <updatePolicy>daily</updatePolicy> <!--当Maven验证构件校验文件失败时该怎么做fail(失败)或者warn(告警)。--> <checksumPolicy>warn</checksumPolicy> </releases> <snapshots> <!--是否使用这个资源库下载这种类型的构件 默认值:true--> <enabled>true</enabled> <!--指定下载更新的频率。这里的选项是:always(一直),daily(每日,默认值),interval:X(这里X是指分钟),或者never(从不)。 --> <updatePolicy>daily</updatePolicy> <!--当Maven验证构件校验文件失败时该怎么做fail(失败)或者warn(告警)。--> <checksumPolicy>warn</checksumPolicy> </snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>nexus</id> <name>local nexus</name> <url>http://192.168.1.8:8080/nexus/content/groups/public</url> <layout>default</layout> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </pluginRepository> </pluginRepositories> </profile> </profiles> <!-- 指定被激活的配置文件--> <activeProfiles> <activeProfile>repo-dev</activeProfile> </activeProfiles> </settings> |
如何禁止anonymous用户访问nexus
nexus在默认情况下是允许anonymous用户浏览仓库,并下载仓库中的jar包的,如果我们搭建的私服是有公…
shiro实现用户踢出功能
shiro实现用户踢出功能 https://my.oschina.net/qixiaobo025/blog/9…
Web服务器性能/压力测试工具http_load、webbench、ab、Siege使用教程
Web服务器性能/压力测试工具http_load、webbench、ab、Siege使用教程 https://…
如何使用google kaptcha生成验证码
1.首先,我们要引入kaptcha的jar包,或者在pom.xml中引入 [crayon-681559b773…
Shiro内置的FilterChain
Shiro内置的FilterChain https://my.oschina.net/pansy/blog/8…
动态 Web 校验码图片生成 XVcode
动态 Web 校验码图片生成 XVcode https://github.com/botaruibo/xvco…
Shiro大体框架
https://my.oschina.net/wdmiye/blog/887193 要想快速了解Shiro,…
JSP打入jar包
https://my.oschina.net/276172622/blog/886968 由于在Servlet…
怎么样配置druid将sql语句及参数记录到日志文件中去
慢SQL日志记录。 1.applicationContext.xml中增加如下配置: [cray…
shiro处理ajax请求session失效跳转
更详细看原文 https://my.oschina.net/u/729917/blog/885421 在aja…
用JAVA获取视频文件中的帧图片并等比缩放
用JAVA获取视频文件中的帧图片并等比缩放 http://blog.csdn.net/zhaowen25/ar…
基于Java的数据库MapDB的使用
MapDB的使用实战[基于Java的数据库] http://blog.csdn.net/qy20115549/…
全面了解 Nginx 主要应用场景
全面了解 Nginx 主要应用场景 https://my.oschina.net/u/3100313/blog…
HttpClient一个比较完整的配置实例
HttpClient一个比较完整的配置实例 https://my.oschina.net/u/2391658/…
分布式任务调度平台XXL-JOB
官方: https://github.com/xuxueli/xxl-job 简介 1.1 概述 XXL-JO…
使用maven profile实现多环境可移植构建
使用maven profile实现多环境可移植构建 http://blog.csdn.net/mhmyqn/a…
activiti-explorer5.2中文乱码解决方法
activiti-explorer5.2中文乱码解决方法 https://my.oschina.net/276…
Linux实现服务延迟启动
Linux实现服务延迟启动 http://www.cnblogs.com/jizha/p/linux_dela…
java转换ppt,ppt转成图片
java转换ppt,ppt转成图片,获取备注,获取文本 http://yijianfengvip.blog.1…
FFmpeg常用基本命令和中文文档
ffmpeg的中文文档 https://my.oschina.net/u/2367476/blog/90425…
直播信号搭建和使用
搭建nginx rtmp直播服务器,ffmpeg模拟推流 http://cxuef.github.io/lin…
Mybatis指定日志输出实现
Mybatis指定日志输出实现 https://my.oschina.net/elim1/blog/8451…
freemarker如何直接调用java类的某个方法
freemarker如何直接调用java类的某个方法 http://bbs.csdn.net/topics/2…