svg转换工具
package com.rubekid.springmvc.utils; import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.io.InputStream; import org.apache.batik.transcoder.TranscoderException;
import org.apache.batik.transcoder.TranscoderInput;
import org.apache.batik.transcoder.TranscoderOutput;
import org.apache.batik.transcoder.image.PNGTranscoder; /**
* svg工具
* @author rubekid
*
*/
public class SvgUtils { public static byte[] toPng(byte[] svgByteArray) throws TranscoderException, IOException{
return toPng(new ByteArrayInputStream(svgByteArray));
} public static byte[] toPng(InputStream inputStream) throws TranscoderException, IOException{
PNGTranscoder transcoder = new PNGTranscoder();
TranscoderInput input = new TranscoderInput(inputStream);
ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
TranscoderOutput output = new TranscoderOutput(outputStream);
transcoder.transcode(input, output);
outputStream.close();
return outputStream.toByteArray();
}
}
<dependency>
<groupId>batik</groupId>
<artifactId>batik-transcoder</artifactId>
<version>1.6-1</version>
</dependency>
svg转换工具的更多相关文章
- 推荐一个web字体转换工具TTF转SVG
推荐一个web字体转换工具:https://www.fontsquirrel.com/tools/webfont-generator
- web字体格式及几种在线格式转换工具介绍
原文地址:http://blog.csdn.net/xiaolongtotop/article/details/8316554 目前,文字信息仍是网站最主要的内容,随着CSS3技术的不断成熟,Web字 ...
- Unicode编码解码在线转换工具
// Unicode编码解码在线转换工具 Unicode 是基于通用字符集(Universal Character Set)的标准来发展,并且同时也以书本的形式(The Unicode Standar ...
- android px,dp,sp大小转换工具
package com.voole.playerlib.util; import android.content.Context; /** * Android大小单位转换工具类<br/> ...
- Json与javaBean之间的转换工具类
/** * Json与javaBean之间的转换工具类 * * {@code 现使用json-lib组件实现 * 需要 * json-lib-2.4-jdk15.jar * ...
- Rsa加解密Java、C#、php通用代码 密钥转换工具
之前发了一篇"TripleDes的加解密Java.C#.php通用代码",后面又有项目用到了Rsa加解密,还是在不同系统之间进行交互,Rsa在不同语言的密钥格式不一样,所以过程中主 ...
- ubuntu下编码转换工具
ubuntu打开windows下的txt或者代码文件,经常会出现乱码, ubuntu自带一种转换工具,是命令行的,下面提供一种最简单的方法进行转换 比如要转换的文件为1.txt,进入1.txt的目录 ...
- 日期转换工具类 CommUtil.java
package com.util; import java.text.ParseException; import java.text.SimpleDateFormat; import java.ut ...
- 视频转换工具 Transmageddon
点这里 Transmageddon 是一个采用 Python 语言开发的视频转换工具,支持输出几乎所有的视频格式,同时也可以生成指定平台下的视频格式. 软件界面如下图所示
随机推荐
- Freemarket学习笔记(一)
一.常用三个指令 1.if指令 a.<#if condition></#if> b.<#if condition><#else></#if> ...
- sql语句去除重复记录(多表连接的查询)
--处理表重复记录(查询和删除) /********************************************************************************** ...
- LeetCode Maximum Product Subarray(枚举)
LeetCode Maximum Product Subarray Description Given a sequence of integers S = {S1, S2, . . . , Sn}, ...
- 日志收集框架 Exceptionless
日志收集框架 Exceptionless 前言 从去年就答应过Eric(Exceptionless的作者之一),在中国会帮助给 Exceptionless 做推广,但是由于各种原因一直没有做这件事情, ...
- 转:Centos6.3添加解码器播放MP3和常见视频音频
原文来自于:http://blog.csdn.net/odaynot/article/details/8462273 参考地址: http://wiki.centos.org/AdditionalRe ...
- mvc vs iis默认页面
有时候,再iis里面设置了web的默认页面index.html 希望跳转到这个页面index.html默认页面 而 mvc则跳转到路由里面的设置页面 怎么忽略这个呢. 设置路由可能是个好办法,能实现 ...
- IIS principle
IIS Request | | | Application Pool Config | | | W3WP | | | Many Module | | | AppDomain:这才是.NET的入口 | ...
- EntityFramework 插件之EntityFramework.Extended (批量处理)
接手了一个用EF来做的项目,由于项目中使用的原生处理,导致很多update都是采用先select 后 update的方式来实现,同时无法批量执行逻辑如:根据订单类型统一更新状态等.所以在经过了N多查找 ...
- 7.4.1 Dumping Data in SQL Format with mysqldump
7.4 Using mysqldump for Backups 使用mysqldump 用于备份: 7.4.1 Dumping Data in SQL Format with mysqldump 7. ...
- jquery validate 自定义验证方法 日期验证
jquery validate有很多验证规则,但是更多的时候,需要根据特定的情况进行自定义验证规则. 这里就来聊一聊jquery validate的自定义验证. jquery validate有一个方 ...