Barcode4J由Java語言編寫而成,可以靈活的生成條形碼。它采用Apache License V2.0許可,這使得它很容易在商業(yè)中被使用。它可以讓您生成各種流行的一維和二維條碼,包括DataMatrix 和 PDF417。以各種格式輸出,包括SVG, EPS, bitmaps和Java2D,同樣也可根據(jù)您的需要添加自己的輸出格式。它為各種應(yīng)用提供了插件,包括最重要的Apache FOP(格式對象處理器)。
創(chuàng)新互聯(lián)公司主要從事網(wǎng)站制作、成都網(wǎng)站建設(shè)、網(wǎng)頁設(shè)計、企業(yè)做網(wǎng)站、公司建網(wǎng)站等業(yè)務(wù)。立足成都服務(wù)隴南,10年網(wǎng)站建設(shè)經(jīng)驗,價格優(yōu)惠、服務(wù)專業(yè),歡迎來電咨詢建站服務(wù):18982081108
localJBarcode.setPainter(WideRatioCodedPainter.getInstance()); 輸出條碼
localJBarcode.setTextPainter(BaseLineTextPainter.getInstance()); 輸出文本
引用spire.barcode.jar包
//創(chuàng)建BarcodeSettings對象
BarcodeSettings?settings?=?new?BarcodeSettings();
//設(shè)置條碼類型為
QR二維碼settings.setType(BarCodeType.QR_Code);???????
//設(shè)置二維碼數(shù)據(jù)
settings.setData("Hello?123456789");
//設(shè)置二維碼顯示數(shù)據(jù)
settings.setData2D("Hello?123456789");?????
//設(shè)置數(shù)據(jù)類型
settings.setQRCodeDataMode(QRCodeDataMode.Alpha_Number);
//設(shè)置二維碼模型寬度
settings.setX(1.0f);
//設(shè)置二維碼糾錯級別settings.setQRCodeECL(QRCodeECL.H);
//創(chuàng)建BarCodeGenerator實例
BarCodeGenerator?barCodeGenerator?=?new?BarCodeGenerator(settings);
//根據(jù)settings生成圖像數(shù)據(jù),保存至BufferedImage
BufferedImage?bufferedImage?=?barCodeGenerator.generateImage();
//將圖片數(shù)據(jù)保存為PNG格式
ImageIO.write(bufferedImage,?"png",?new?File("QRCode.png"));
分享名稱:用java代碼生成條形碼 html生成條形碼
瀏覽路徑:http://www.chinadenli.net/article0/doogdio.html
成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供微信公眾號、做網(wǎng)站、網(wǎng)站收錄、外貿(mào)建站、動態(tài)網(wǎng)站、域名注冊
聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)