Introduction
The contents of a field can be output as a QR Code using InDesign’s QR Code functionality. EasyCatalog includes support for all of the QR Code types supported by InDesign, although some types require the use of a custom field to provide the content of the QR Code.
As of version 18, EasyCatalog includes support for QR Codes as a barcode type in Field Options; for version previous versions QR codes can be generated using LUA script attached to an image frame (see below).
URL/Hyperlink QR Codes
If one of your fields contains a URL, it can be output as a QR code:
- Edit the Field Options for the field (use the Field Options menu from the data panel’s pop-out menu)
- Click on “Format” on the left of the dialog
- Change the field’s type to be “Barcode”
- Change the type of barcode to be “QR Code”
- You can also specify the name of a swatch that will be used to generate the QR code.
The field can now be inserted into an image box, and the QR code will be generated.
Text QR Codes
If you need to output text as a QR Code, follow the instructions above for URL/Hyperlink QR Codes.
Email QR Codes
Email QR codes require three fields: email address, subject and email body. To generate an e-mail QR code, you must first create a custom field that takes these three fields and generates a string suitable for output as a QR code:
- Create a new custom field (right click in the panel and use the “New Custom Field” option, or use the “New Custom Field” option from the Field Options menu)
- Give the new field a name at the top of the dialog, e.g. “email QR Code”
- Use the QRCODEENCODEEMAIL custom field command – for example, if you have three fields in your data containing the email address, subject line and email contents you would use:
1 | QRCODEENCODEEMAIL(FIELDSTR(email), FIELDSTR(subject), FIELDSTR(email-body)) |
- Click on “Format” on the left of the dialog
- Change the field’s type to be “Barcode”
- Change the type of barcode to be “QR Code”
The field can now be inserted into an image box, and the QR code will be generated.
SMS QR Codes
SMS QR codes require two fields: telephone number and message body. To generate an SMS QR code, you must first create a custom field that takes these two fields and generates a string suitable for output as a QR code:
- Create a new custom field (right click in the panel and use the “New Custom Field” option, or use the “New Custom Field” option from the Field Options menu)
- Give the new field a name at the top of the dialog, e.g. “SMS QR Code”
- Use the QRCODEENCODESMS custom field command – for example, if you have two fields in your data containing telephone number and text message body you would use:
1 | QRCODEENCODESMS(FIELDSTR('telephone'),FIELDSTR('message')) |
- Click on “Format” on the left of the dialog
- Change the field’s type to be “Barcode”
- Change the type of barcode to be “QR Code”
The field can now be inserted into an image box, and the QR code will be generated.
VCard QR Codes
QR codes can also be generated that represent a virtual business card (VCard).
- Create a new custom field (right click in the panel and use the “New Custom Field” option, or use the “New Custom Field” option from the Field Options menu)
- Give the new field a name at the top of the dialog, e.g. “VCard QR Code”
- The QRCODEENCODEVCARD custom field command accepts the following parameters in this order, although only First and Last Name are mandatory:
- First name
- Last name
- Address
- City
- State
- Zip
- Country
- Telephone
- Cell phone
- Email,
- Website,
- Job title,
- Organization
Fields that are not required should be left empty. For example, if you have fields containing the first and last name, address, city and telephone you would use a command such as:
1 | QRCODEENCODEVCARD(FIELDSTR(first name),FIELDSTR(last name), FIELDSTR(address), FIELDSTR(city),'','','',FIELDSTR(telephone)) |
- Click on “Format” on the left of the dialog
- Change the field’s type to be “Barcode”
- Change the type of barcode to be “QR Code”
For EasyCatalog versions before version 18, QR codes can be generated by attaching a LUA script to an image frame.
To Generate Web Hyperlink QR Codes:
1 2 | frame:qrcodehyperlink(field('URL')); frame:fitcontent(); |
The first line generates the QR code; the second line resizes it to fit the frame.
To Generate Business Card QR Codes:
1 | frame:qrcodevcard("FirstName", "LastName", "JobTitle", "TelNo", "CellNo", "Email", "Website", "Org", "Street", "City", "State", "Zip", "Country"); |
To Generate Plain Text QR Codes:
1 2 | mytext = 'some text'; frame:qrcodetext(mytext); |
ย