codebude / QRCoder

A pure C# Open Source QR Code implementation
MIT License
4.61k stars 1.1k forks source link

QRCode generates a plain Text not a url #137

Closed djlarabad closed 6 years ago

djlarabad commented 6 years ago

Hi, i use this library from nuget package. The generation of the QrCode works fine. But when i scan the generated code, the reader shows a plain text. not an url. How can i fix them? Here is my code:

string link = "https://test.qr.com/file.pdf"; Url generator = new Url(link); string payload = generator.ToString(); QRCodeGenerator qrGenerator = new QRCodeGenerator(); QRCodeData qrCodeData = qrGenerator.CreateQrCode(payload, QRCodeGenerator.ECCLevel.Q); Base64QRCode qrCode = new Base64QRCode(qrCodeData); return qrCode.GetGraphic(2); Thank you very much! Best Regards Niklas

Type of issue

[ ] Bug
[ ] Question (e.g. about handling/usage)
[ ] Request for new feature/improvement

Expected Behavior

Current Behavior

Possible Solution (optional)

Steps to Reproduce (for bugs)

Your Environment

Blackbaud-ChristiSchneider commented 6 years ago

You're probably using some other Url type - you want PayloadGenerator.Url generator = new PayloadGenerator.Url(url);

Ruffio commented 6 years ago

@djlarabad Can this issue be closed?

codebude commented 6 years ago

@Ruffio I think it can be closed. By the way the URL Payload generator just ensures that the link is valid formatted. In comparison to other Payload generators it does not that much magic. If a reader app just shows the URL, then it's the "fault" of the reader app. Reader apps that open links automatically do it, because they decided to do so. There is nothing like a special format for URLs in QR specification.