QR code generator¶
In this example, let's look at generating QR codes in Engee using the Julia library QRCoders.jl
Introduction¶
A QR code (Quick Response) is a two-dimensional barcode that is read by image processing devices. It provides instant access to a large amount of information and is used in a wide range of industries, from industrial and retail to advertising. industries, from manufacturing and retail to advertising. It is generated according to well-defined rules that can be implemented on the Engee platform using the Julia language.
Getting started¶
Let's download and install the libraries needed for this example:
import Pkg; Pkg.add(["QRCoders", "Images", "ImageShow"]);
Connect the installed libraries:
using QRCoders, ImageShow, Images;
Generating a QR code link¶
The following link will be generated as a QR code:
текст = "https://start.engee.com/"
Next, let's generate and display the generated QR code in the results of the executed cell.
cd("$(@__DIR__)")
exportqrcode(текст);
load("$(@__DIR__)/qrcode.png")
You can check the correctness of the code execution by means of your smartphone.
QR code generation for vCard format¶
vCard (or VCF, Virtual Contact File) is a standard file format for storing and exchanging contact information. It is used to transfer contact data between devices, applications, and platforms. The vCard format is supported by most modern devices and programmes, including smartphones, email clients, and CRM systems.
It is also convenient to generate the vCard as a QR code for easy transmission. Let's define the contact information for the vCard:
Фамилия = "Сидоров"
Имя = "Максим"
Отчество = "Никитич"
Пол = "M"
День_рождения = ""
Организация = "ООО ЦИТМ Экспонента"
Отдел = "Департамент маркетинга"
Должность = ""
Страна = "Россия"
Почтовый_индекс = ""
Субъект = ""
Город = "Virtual"
Округ = ""
Улица = ""
Дом = ""
Офис = ""
Телефон = "+7 (495) 009-65-85"
Сайт = "https://julia.org/"
Почта = "info@engee.com"
Let's generate a variable formatted as vCard:
Карточка =
"""
BEGIN:VCARD
VERSION:3.0
FN:$Фамилия $Имя $Отчество
N:$Фамилия;$Имя;$Отчество
GENDER:$Пол
BDAY:$День_рождения
ORG:$Организация;$Отдел;$Должность
ADR;TYPE=home:;$Офис;$Дом $Улица;$Округ;$Город;$Субъект;$Почтовый_индекс;$Страна
TEL;TYPE=cell:$Телефон
URL:$Сайт
EMAIL;TYPE=INTERNET:$Почта
END:VCARD
"""
Generate a QR code with vCard:
cd("$(@__DIR__)")
exportqrcode(Карточка);
load("$(@__DIR__)/qrcode.png")
You can also check the correctness of the generation with your smartphone. If the vCard is generated correctly, the QR code decoder on your smartphone should offer to add the contact data from the vCard to your phonebook contacts.
Conclusion¶
In this example, we have learnt the capabilities of Engee and the QRCoders.jl
library for QR code generation tasks.