1. Code
<% @page import= "ERWEBMA. Addcode "%><% @page import=" Javax.imageio.ImageIO "%><% @page import=" Java.awt.image.BufferedImage "%> <% @page import= "Erwebma.client.j2se.MatrixToImageWriter"%><% @page import= " Com.google.zxing.common.BitMatrix "%><% @page import=" Com.google.zxing.MultiFormatWriter "%><% @page Import= "Com.google.zxing.BarcodeFormat"%><% @page import= "Com.google.zxing.EncodeHintType"%><% @page Import= "java.util.Hashtable"%><% @page contenttype= "text/html" pageencoding= "UTF-8"%><% String data = Request.getparameter ("Data"); if (data = null) {int width = 128; int height = 128; String format = "png"; Hashtable hints = new Hashtable (); Hints.put (Encodehinttype.character_set, "utf-8"); Bitmatrix Bitmatrix = new Multiformatwriter (). Encode (data, barcodeformat.qr_code, width, height, hints); BufferedImage Bufi = Matrixtoimagewriter.tobufferedimage (Bitmatrix); Response.reset (); Response.setcontenttype ("Image/png"); Imageio.write (Bufi, "PNG", Response.getoutputstream ()); Out.clear (); out = Pagecontext.pushbody (); }%>
2. Line break
Wrap, use "%0a".
3, two-dimensional code image
Two-dimensional code line-wrapping