ireport 生成一维码 和 二维码 小记

1、添加图片组件

图片组件


2、修改组建 属性 Image Experssion

设置图片生成

3、生成方式


  
   
   
  1. 一维码 ($F{WAYBILL_NO} 为条码数据)
  2. com.google.zxing.client.j2se.MatrixToImageWriter.toBufferedImage( new com.google.zxing.oned.Code128Writer().encode($F{WAYBILL_NO},com.google.zxing.BarcodeFormat.CODE_128, 188, 40))


  
   
   
  1. 二维码 ($F{WAYBILL_NO} 为条码数据)
  2. com.google.zxing.client.j2se.MatrixToImageWriter.toBufferedImage( new com.google.zxing.qrcode.QRCodeWriter().encode($F{WAYBILL_NO},com.google.zxing.BarcodeFormat.QR_CODE, 200, 180))

4、使用此方法,项目需添加 zxing 的jar包

如何打印成PDF可看本人博客

猜你喜欢

转载自blog.csdn.net/s_156/article/details/114135953
今日推荐