简介:
基于java实现电子印章及二维码生成
项目简介:
基于java实现电子印章及二维码生成
项目技术:
servlet
运行环境:
jdk,eclipse
功能演示
public class Test { private static String basePath = "F:\\生成电子章\\"; public static void main(String[] args) { //生成电子签章 SealUtils.seal(basePath, "DEMO程序园"); //生成二维码网址,使用微信扫一扫可以直接跳转到网址 ZxingHandler.encode2("http://www.democxy.com", 300, 300, basePath+"democxy.png"); //生成一维码(条形码) ZxingHandler.encode("6923450657713", 300, 100, basePath+"onecode.png"); } }
(使用微信扫码二维码)
注意:二维码生成需要引入对应的jar包,maven项目pom文件如下:
<!-- 条形码、二维码生成 --> <dependency> <groupId>com.google.zxing</groupId> <artifactId>core</artifactId> <version>2.2</version> </dependency> <dependency> <groupId>com.google.zxing</groupId> <artifactId>javase</artifactId> <version>2.2</version> </dependency>
如需要实现扫码二维码跳转网页功能,传入的网址必须带http前缀,如http://www.democxy.com