java开发,生成PDF417的二维条码
java开发,生成PDF417的二维条码(),如果条码中需要存放中文信息,代码需要怎样处理
我的代码(但是扫码,扫不出来信息)
public static String barCodeInformation ="密级:机密,期限:一年,申请人:保密员,单号:DZSR-2017-00394-1";
public static void createQRcode()throws IOException {
BarcodePDF417 pdf = new BarcodePDF417();
pdf.setYHeight(30);
pdf.setText(barCodeInformation .getBytes("utf-8"));
Image pdfImg = pdf.createAwtImage(Color.black, Color.white);
BufferedImage img = new BufferedImage((int)pdfImg.getWidth(null), (int)pdfImg.getHeight(null), BufferedImage.TYPE_INT _RGB);
Graphics g = img.getGraphics();
g.drawImage(pdfImg, 0, 0, Color.white, null);
OutputStream os = new BufferedOutputStream(new FileOutputStream("d:/pdf417.png"));
ImageIO.write(img, "PNG", os);
}