Skip to main content

QR-Codes

Enums​

QRCodeType​

NameExplanationint
TEXTPure textcontent1
EMAILEmail-content using the mailto:-scheme2
HYPERLINKHyperlink3
SMSSMS-content using the smsto:-scheme4
VCARDVCard-content. See Wikipedia article for more information5
GEOGeo-Coordinates Latitude, Longitude (optionally altitude)6
WIFIWifi-connection-details (Type, SSID, PAssword, Hidden)7
VCALVCalender-content. See Wikipedia article for more information8

Methods​

create_qr_code_text(...)​

(frame, content = "", error_correction = "M", strict = True, include_text = False, color_qrcode = None, color_bg = None)​

Parameters:frame (comet.CFrame)
The frame in the document, in which the QR-code should be inserted to.
content (str)
Text-content for the QR-code. Can be a text prepared for specific QR-code-types (for example E-Mail with mailto:...).
error_correction (str)
One of the following Error Correction Levels:
L (low; 7% Loss recovery possible),
M (medium; 15% Loss recovery possible),
H (high; 20% Loss recovery possible),
Q (quality; 30% Loss recovery possible)
strict (bool)
Whether or not to abort, if Byte-length validation fails.
include_text (bool)
Should the QR-content be displayed as text below the QR-code?
color_qrcode (comet.CColor)
A color for the QR-code elements.
color_bg (comet.CColor)
A color for the background behind the QR-code.
Returns:Whether the QR-Code was created successfully.
Return Type:bool

create_qr_code(...)​

(frame, contents, qrcode_type = QRCodeType.TEXT, error_correction = "M", strict = True, include_text = False, color_qrcode = None, color_bg = None)​

Parameters:frame (comet.CFrame)
The frame in the document, in which the QR-code should be inserted to.
contents (dict[str,str])
Contents to be incorporated in the QR-Code. Depending on the qrcode_type, different values are expected in the dictionary Explanations for keys and values see below.
qrcode_type (QRCodeType)
One of the QR-Code-types defined in the Enum QRCodeType.
error_correction (str)
One of the following Error Correction Levels:
L (low; 7% Loss recovery possible),
M (medium; 15% Loss recovery possible),
H (high; 20% Loss recovery possible),
Q (quality; 30% Loss recovery possible)
strict (bool)
Whether or not to abort, if Byte-length validation fails.
include_text (bool)
Should the QR-content be displayed as text below the QR-code?
color_qrcode (comet.CColor)
A color for the QR-code elements.
color_bg (comet.CColor)
A color for the background behind the QR-code.
Returns:Whether the QR-Code was created successfully.
Return Type:bool


Options for Parameter contents:

TEXT
KeyDescription / Example
textHello World!
EMAIL
KeyDescription / Example
email_addressinfo@priint.com
email_ccOptional
info.cc@priint.com
email_bccOptional
info.bcc@priint.com
email_subjectOptional
Quarterly Numbers
email_bodyOptional
Hello,\nhere are the quarterly numbers: 42, 39, 87, 11.\nBest Regards
HYPERLINK
SMS
KeyDescription / Example
sms_phone_number+0 000 00000
sms_messageOptional
Hello World!
VCARD
KeyDescription / Example
vcard_honorprefixMr.
vcard_firstnameJohn
vcard_middlenameX.
vcard_lastnameSmith
vcard_honorsuffixJr.
vcard_postofficeP.O. Box 0000
vcard_extendedadress
vcard_street123 Main Street
vcard_localityAny Town
vcard_regionCA
vcard_postalcode91921-1234
vcard_countryU.S.A.
vcard_tel+0 000 00000
vcard_tel_pref+0 000 00000
vcard_tel_work+0 000 00000
vcard_tel_home+0 000 00000
vcard_tel_fax+0 000 00000
vcard_tel_msg+0 000 00000
vcard_tel_cell+0 000 00000
vcard_emailinfo@priint.com
vcard_bday19960415
--0415
vcard_categoriesTRAVEL AGENT
INTERNET,INDUSTRY,INFORMATION TECHNOLOGY
vcard_genderA single letter (optionally followed by ;{text}).
`` (empty)
M (male)
F (female)
O (other)
N (none / not applicable)
U (unknown)

For Example:
M;Fellow
F;grrrl
O;intersex
;it's complicated
vcard_langen
fr
vcard_noteThis fax number is operational 0800 to 1715 EST\, Mon-Fri.
vcard_orgPRIINT GROUP
vcard_titleChief Happiness Officer
vcard_roleCoffee & Nutrition Manager
vcard_timezoneRaleigh/North America
vcard_urlhttp://priint.com
GEO
KeyDescription / Example
geo_latitude51.44110352294343
geo_longitude6.773927670685315
geo_altitudeOptional
WIFI
KeyDescription / Example
wifi_network_typeWPA
WEP
nopass (open networks)
wifi_network_nameGuest Network
wifi_passwordpassword123
wifi_hiddenOptional
false (default)
true
VCAL
KeyDescription / Example
vcal_uidFrom Wikipedia:
"The UID field distributes updates when a scheduled event changes. When the event is first generated a globally unique identifier is created. If a later event is distributed with the same UID, it replaces the original one."
a678ds@priint.com
vcal_datestampDatestring in Format YYYYMMDDTHHMMSSZ
20250701T100000Z
vcal_datestartDatestring in Format YYYYMMDDTHHMMSSZ
20250704T171000Z
vcal_dateendDatestring in Format YYYYMMDDTHHMMSSZ
20250704T041800Z
vcal_summaryImportant meeting
vcal_locationMeeting Room 1
vcal_descriptionThis is an important meeting
vcal_organizer_nameJohn Smith
vcal_organizer_emailinfo@priint.com