Is it possible to generate a qr code in .net and when scanning it, it automatically downloads a pdf document instead of going to a url?
Example:
string myBase64Pdf = "base64code.....";
QRCodeGenerator _qrCode = new QRCodeGenerator();
QRCodeData _qrCodeData = _qrCode.CreateQrCode(myBase64Pdf,QRCodeGenerator.ECCLevel.Q); //error maximun length
QRCode qrCode = new QRCode(_qrCodeData);
Bitmap qrCodeImage = qrCode.GetGraphic(20);
var htmlcontent = await repository.getTemplateHtml();
htmlcontent = htmlcontent.Replace("||QRSection||", qrCodeImage); //error but qrCodeImage must be
string
//htmlcontent = htmlcontent.Replace("||QRSection||", qrCodeImage.ToString()); ???
var mybase64Pdf = util.ConvertHtmlToPDF(htmlcontent);
but in this line:
QRCodeData _qrCodeData = _qrCode.CreateQrCode(myBase64Pdf,QRCodeGenerator.ECCLevel.Q);
I've exception:
The given payload exceeds the maximum size of the QR code standard. The maximum size allowed for the choosen paramters (ECC level=Q, EncodingMode=Byte) is 1663 byte.