Page 1 of 1

QR code

Posted: Tue Mar 18, 2025 4:44 pm
by trags3
Is it possible to generate a QR code of a .txt file with LC?

Tom

Re: QR code

Posted: Tue Mar 18, 2025 5:06 pm
by Klaus
Hi Tom,

sorry, don't understand, what exactly has to go into the QR code?

Best

Klaus

Re: QR code

Posted: Tue Mar 18, 2025 5:39 pm
by trags3
I have a txt file or a text list that needs to be put into a QR Code.
I want to be able to have the QR code printed on a page that gets sent to a business. Usually on a form such as an invoice for instance and then have the receiver be able to have the data he needs from the invoice put into a file using another LC App that reads the data. Minimizing the need to Manually input data on the receiving end. There will be a lot of information on the invoice that I don't need to have on the receiving App.

I Hope this is clear.
Thanks,
Tom

Re: QR code

Posted: Tue Mar 18, 2025 6:04 pm
by Klaus
Hi Tom,

thanks, got it!
I'd say this depends on the maount of data you want to put into the code.
Unfortunately the dictionary does not tell us how much data a qr code can hold.

Found this on the net:
----------------------------------------------
A standard static QR Code can store up to three kilobytes (KB) of data, which translates to:
7,089 numeric characters. 4,296 alphanumeric characters (letters and numbers).
..............................................
Maybe that will fit your needs.


Best

Klaus

Re: QR code

Posted: Tue Mar 18, 2025 6:34 pm
by trags3
Hi Klaus,
The amount of data that I need in the QR Code is well below the maximum capacity of a QR Code.
Maybe 10 or 15 one to 3 word fields at most.
My question is how would I implement the generation of a QR code using Live Code if it is possible?

Thanks.
Tom

Re: QR code

Posted: Tue Mar 18, 2025 6:44 pm
by Klaus
Hi Tom,

look up "qrcreate" in the dictionary.
That comes with a lot of options e.g. to put the code into an existing image
in your stack or even into an image file on disk.


Best

Klaus

Re: QR code

Posted: Tue Mar 18, 2025 7:22 pm
by trags3
Thank You So much Klaus!
I feel embarrassed that I did not check the dictionary in the first place!

I think this will work for me.

Tom

Re: QR code

Posted: Wed Mar 19, 2025 8:12 pm
by Hutchboy
Hi,

Here is a quick start on a LC QR code generator. I notice the more data in the field the larger the image resizes. You can change the colors in the image to another color pair using qrSetColor.

-Mike

Re: QR code

Posted: Thu Mar 20, 2025 3:18 am
by bobcole
Hutchboy:
We must think the same way. I put together a sample stack with similar results.
My stack provides some additional error checking; look at the script of the button.
FYI,
Bob
QRCode 2.livecode.zip
(2.87 KiB) Downloaded 1346 times