QR Code Generator

Marcelo Gil
 6 months 2 weeks ago #518 by Marcelo Gil
Marcelo Gil replied the code: QR Code Generator
Hello Bruce! I need your help please
I downloaded the QR code generator project and from the PB IDE it works fine generating the QR code. When I deploy the exe to the PC where the PB IDE is not installed, it fails to create the wrapper object that calls the ino_QrCoder.getQrAsBlob method Error: "Object instance does not exist"
On this PC I installed .net 6 runtime and .net framework 4.8 without solving the case. Also copy all the project dlls and the entire BIN folder. What could be wrong?

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

Bruce Armstrong
CODE AUTHOR
Posts: 55
 6 months 3 weeks ago #516 by Bruce Armstrong
Bruce Armstrong replied the code: QR Code Generator
Can this wrapper be imported

Yes

and does it work in version P2022 R3?

Yes

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

Marcelo Gil
 6 months 3 weeks ago #515 by Marcelo Gil
Marcelo Gil replied the code: QR Code Generator
Hello Bruce! Can this wrapper be imported and does it work in version P2022 R3?

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

Bruce Armstrong
CODE AUTHOR
Posts: 55
 7 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.