背景:最近在做电子合同相关的项目。其中需要用到印章。这个印章需要客户自己上传。但是很快我们发现,有些客户没有合格的印章图片(需要透明背景),需要我们替用户制作。所以决定开发一个自助的印章生成页面。开工之前,先去github找了一下,发现有人分享了一个工具类。已经可以满足我的需求。
呵呵,直接拿来用了。省下来的工时,干点啥不好。
资源地址:https://github.com/localhost02/SealUtil
印章生成工具:使用Java Graphics2D生成各类圆形/椭圆公章、私章图片
看一下生成的印章效果:
公章效果图圆形公章:




椭圆公章:







基于这个代码,我稍微改改,然后开发了一下前台页面,主要让用户可以自己配置文章/样式等等。简单的很,就不写了。
跟老板要了一周的工时,嘿嘿,差不过一天搞定。
这就是开源的力量
#pgc-card .pgc-card-href { text-decoration: none; outline: none; display: block; width: 100%; height: 100%; } #pgc-card .pgc-card-href:hover { text-decoration: none; } /*pc 样式*/ .pgc-card { box-sizing: border-box; height: 164px; border: 1px solid #e8e8e8; position: relative; padding: 20px 94px 12px 180px; overflow: hidden; } .pgc-card::after { content: " "; display: block; border-left: 1px solid #e8e8e8; height: 120px; position: absolute; right: 76px; top: 20px; } .pgc-cover { position: absolute; width: 162px; height: 162px; top: 0; left: 0; background-size: cover; } .pgc-content { overflow: hidden; position: relative; top: 50%; -webkit-transform: translateY(-50%); transform: translateY(-50%); } .pgc-content-title { font-size: 18px; color: #222; line-height: 1; font-weight: bold; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } .pgc-content-desc { font-size: 14px; color: #444; overflow: hidden; text-overflow: ellipsis; padding-top: 9px; overflow: hidden; line-height: 1.2em; display: -webkit-inline-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; } .pgc-content-price { font-size: 22px; color: #f85959; padding-top: 18px; line-height: 1em; } .pgc-card-buy { width: 75px; position: absolute; right: 0; top: 50px; color: #406599; font-size: 14px; text-align: center; } .pgc-buy-text { padding-top: 10px; } .pgc-icon-buy { height: 23px; width: 20px; display: inline-block; background: url(https://lf3-cdn-tos.bytescm.com/obj/cdn-static-resource/pgc/v2/pgc_tpl/static/image/commodity_buy_f2b4d1a.png); } 【当当】深入理解Java虚拟机:JVM高级特性与最佳实践(第2版) ¥64.19 购买logo设计网(www.shejilogo.com),专业的logo免费设计在线生成网站,全自动智能化logo设计,商标设计,logo在线生成!
欢迎使用logo设计网制作属于您公司自己的logo,不仅专业而且经济实惠,全方位满足您公司品牌化、视觉化的需求。