背景:最近在做電子合同相關的項目。其中需要用到印章。這個印章需要客戶自己上傳。但是很快我們發現,有些客戶沒有合格的印章圖片(需要透明背景),需要我們替用戶制作。所以決定開發一個自助的印章生成頁面。開工之前,先去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.just4love.cn),專業的logo免費設計在線生成網站,全自動智能化logo設計,商標設計,logo在線生成!
歡迎使用logo設計網制作屬于您公司自己的logo,不僅專業而且經濟實惠,全方位滿足您公司品牌化、視覺化的需求。