i want the scan result like this:
zxing
66666
how can i realize this ?
i add %0A and \r\n , it doesn't work .
i tried %0A and \r\n in my code ,i debug and found the string newline,but after write to image and then scan by wechat or QQ ,just show a blank space ,not newline.
<code>
@RequestMapping(value = "/qrcode")
public void getRqCodeNoTime(HttpServletResponse response, String code) throws {
response.setContentType("image/jpeg");
response.setHeader("Pragma", "no-cache");
response.setHeader("Cache-Control", "no-cache");
response.setDateHeader("Expires", 0);
int width = 300;
int height = 300;
//String newLine = "\r\n";
String newLine = "%0A";
try {
Map<EncodeHintType, Object> hints = new HashMap<EncodeHintType, Object>();
hints.put(EncodeHintType.CHARACTER_SET, "UTF-8");
BitMatrix bitMatrix = new MultiFormatWriter().encode("zxing"+newLine+code, BarcodeFormat.QR_CODE, width, height, hints);
MatrixToImageWriter.writeToStream(bitMatrix, "jpg",
response.getOutputStream());
} catch (Exception e) {
logger.error(e);
}
}
</code>
requestUrl : http://xxxx.com/qrcode?code=something
html: <img src="requestUrl"/>
also i tried http://xxxx.com/qrcode?code=zxing%0Asomething, scan by wechat or qq , it doesn't work either