I am using http://davidshimjs.github.io/qrcodejs/ to generate a QR Code for an event, but when I try to make code from a string shown below I get this error Error: code length overflow. (1716>1056). I found out that when I change correctLevel : QRCode.CorrectLevel.H
to the medium it works. It also works when I remove DESCRIPTION or some other part of the string.
Can you explain to me how the limits work, and how should I set so when the code is generated from the user's input (it can have really long description) it won't crash?
qrkod(){
this.qrCodeText = "BEGIN:VCALENDAR"+"%0D%0A"+
"VERSION:1.0"+"%0D%0A"+
"BEGIN:VEVENT"+"%0D%0A"+
"DTSTART:" + "19960401T090000" +"%0D%0A"+
"DTEND:" + "19960401T043000" +"%0D%0A"+
"SUMMARY:" + "Your Proposal Review"+"%0D%0A"+
"DESCRIPTION:" + "Steve and John to review newest proposal material"+"%0D%0A"+
"END:VEVENT"+"%0D%0A"+
"END:VCALENDAR"+"%0D%0A";
this.qrCodeText = decodeURIComponent(this.qrCodeText);
this.qrcode0 = new QRCode("qrcode", {
text: this.qrCodeText,
width: 363,
height: 385,
colorDark : "#000000",
colorLight : "#ffffff",
correctLevel : QRCode.CorrectLevel.H
});
}
You will only get this error when your using minified version of cdn try using other than minified one it will work here