开发者

Looking for information about programming QR codes

I am looking for 2 pieces of information about building QR codes, but Google is failing me:

  1. (Most important) Information about the different message formats; li开发者_JAVA百科ke MEBKM, SMSTO, TEL, GEO, WIFI, etc. i.e. Others not listed and how they are formatted (e.g. "MEBKM:TITLE:{$title};URL:{$url};;").
  2. How to build them. Wikipedia has a little info, but not enough. (Currently I am using Google, but I want a little more power)

Thanks!


I don't know how useful this will be (or if you've already seen this and the resources it links to) but the zxing project has a page about contents of 2D barcodes


Phone

tel: {telephone number}

You can Barcode that contains a phone number in the format above

SMS

smsto: {telephone number}: {text}

Phone number in the format above, you can Barcode that contains the text (Example) smsto: 123456: test

WIFI

WIFI: S: {SSID}; P: {password}; T: {type}

SSID in the above format, password, you can Barcode that contains the type (WEP/WAP/OPEN) It becomes OPEN If you do not specify the type of (Example) WIFI: S: TenChars; P: 0123456789; T: WEP ;;

Geo-location

geo: {latitude}, {longitude}

Barcode can containing latitude and longitude in the form of the k geo:-20.33,132.3344

Contact information:

MECARD

MECARD: N: {name}; ORG: {belong}; TEL: {telephone number}; EMAIL: {email address}; ADR: {address}; NOTE: {memo}

In the above format, name, affiliation, phone number, e-mail address, address, you can Barcode that includes a note

vCard

BEGIN:VCARD VERSION:3.0 N: {name} ORG: {belong} TITLE: {title} TEL: {telephone number} URL:{URL} EMAIL: {email address} ADR: {Address} NOTE: {memo} END:VCARD NOTE:test memo

In the above format, name, affiliation, title, phone number, URL, e-mail address, address, you can Barcode that includes a note

Calendar event

VEVENT

BEGIN:VEVENT SUMMARY: {Overview} DTSTART: {Start Time} DTEND: {End Time} LOCATION: {location} DESCRIPTION: {Details} END:VEVENT

In the above format, summary, start time, end time, location, you can Barcode that contains the details

Usage: with "segno": https://segno.readthedocs.io/en/latest/

import segno

phone_number = '+99988666555'
qr= segno.make(f'tel:{phone_number}')
qr.save('QR_image.png')

or with "qrcode": https://pypi.org/project/qrcode/

import qrcode
    
phone_number = '+99988666555'
text = 'Some text'
qr= qrcode.make(f'smsto: {phone_number}: {text}')
qr.save('QR_image.png')
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜