QR Code Generator

More
3 years 2 months ago - 4 months 3 weeks ago #341 by Bruce Armstrong
Bruce Armstrong created the code: QR Code Generator
This code sample uses the open source QRCoder .net assembly ( github.com/codebude/QRCoder ). I created a wrapper assembly for that using SnapDevelop, and then a demo project in PowerBuilder 2019 R3 showing how it's used.

Update 07/04/2023: Updated to include sample built with PowerBuilder/SnapDevelop 2022

This message has attachments files.
Please log in or register to see it.

Last Edit: 4 months 3 weeks ago by Bruce Armstrong. Reason: Updated for PowerBuilder 2022

Please Log in or Create an account to join the conversation.

More
4 months 1 week ago #513 by Bruce Armstrong
Bruce Armstrong replied the code: QR Code Generator
>>But with yours it seems impossible to set the size (with & height), the margin,

For that what I was thinking you could do is put the image in picture in a datawindow. You could then adjust the margins around the picture and also resize the picture. The main issue is that the SetPicture method that I'm using for the PowerBuilder picture control isn't available for a picture object in a datawindow. What you would need to do is save the blob out to a temporary file and then point the picture control in the datawindow to that file.

>>the error level specific for QR code.

Right now I hard code the value for the error level. What you could do is make it a parameter for the method and pass in the value you want.

QRCodeData qRCodeData = qRCodeGenerator.CreateQrCode(qrText, QRCodeGenerator.ECCLevel.Q);

The valid values are L, M, Q or H. github.com/codebude/QRCoder/wiki/How-to-use-QRCoder

I put making those changes (or something similar) on my to do list. But you're likely to get to it yourself quicker than I will if you're comfortable making the changes.

Please Log in or Create an account to join the conversation.

More
4 months 1 week ago #512 by Fabrizio Viscardi
Fabrizio Viscardi replied the code: QR Code Generator
Hello Bruce,
thanks for your QR Code Generator. I have compiled, 64 bits, and it works fine, creating correct code also for € (eur) symbol, impossible to have in many other qr code generators.
But with yours it seems impossible to set the size (with & height), the margin, the error level specific for QR code.
Maybe is possible to change the margin? Is it possible to know the Error Level established in the .dll library ?
Thank you very much
Fabrizio Viscardi (Italy)

Please Log in or Create an account to join the conversation.

More
11 months 1 week ago #460 by Bruce Armstrong
Bruce Armstrong replied the code: QR Code Generator
Remove the second line in the open script. Apparently I am referencing a method there that existed at the time I wrote the demo, but no longer exists in more recent versions of PowerBuilder. In particular, the line you want to remove is:

inv_generator.of_seterrorhandler( this, 'assemblyerror')

Please Log in or Create an account to join the conversation.

More
2 years 6 months ago #386 by Bruce Armstrong
Bruce Armstrong replied the code: QR Code Generator
Hard to tell you what is wrong without a specific error message. For what it's worth though if you try to import a .Net Core library and you've selected .Net Framework as the Framework Type you'll get an error like the attached.

Please Log in or Create an account to join the conversation.

More
2 years 7 months ago #384 by alberto cardenas
alberto cardenas replied the code: QR Code Generator
Hi Bruce,
Thank you the code.


I download the code I try to run in PW 2019 and it marks an error in nvo_qrgenerator it tells me that dotnetobject is not there, I do not know if I am missing something to do, thank you very much in advance

Please Log in or Create an account to join the conversation.

Moderators: Appeon Administrator