Adding a vcard to a QR code

What is a QR Code?

A QR Code is a type of two dimensional barcode, like the one in the picture below. Many smartphones can scan these codes using their cameras and free apps. The codes can either contain URLs that will take you directly to a website, or else they can contain contact information that will go right into your phone's addressbook.

What is a vCard?

vCard stands for "Virtual Business Card." It is a data format that packages up addressbook information, like a person's name, title, organization, mailing address and telephone numbers. It
can be attached as a file to emails, or downloaded from a web page, or encoded into a QR code. It is an older standard than the QR code, but the two work very well together.

How are they used together for a scannable business card?

When a QR Code that contains vCard information is printed on a business card, a person can scan it with their smartphone, and it immediately becomes a contact in their addressbook. No manual typing is needed.

How can I do this with an eDocBuilder template?

Set up your master PDF as you normally would, with all the regular fields for displaying name, address, etc. Then add an additional, fairly large, square field to hold the QR code.

Important: for the QR code to work with the widest variety of smartphone apps, you should have separate first and last name fields.

We will assume you have named your fields this way:

phFirstname, phLastName, phCompanyName, phTitle, phAddressOne, phAddressTwo, phCity, phState, phZip,
phPhone, phTelephoneExt, phFax, phCell, phEmail, phWebsite, QRCode

In eDocBuilder, create your template and upload the master PDF. Format all the normal, visible fields as you ordinarily would. Then open the QRCode field. In the Field Type tab, select "Barcode" and "Static text or field scripting":

In the Format tab, select QR Code, and the color you want the code to be. The default is black:

In the Field Scripting tab, select "Html Markup", and enter this script. If there are fields you are not using, leave those lines out of the script:

FN;CHARSET=utf-8:@phFirstname@ @phLastName@
TEL:@phPhone@ {{x@phTelephoneExt@}}

If you would like to use a vCard with VB script, you will need to replace the line breaks with ChLF. For example:

"BEGIN:VCARD" & ChLF & "N;CHARSET=utf-8:" & phLastName & ";" & phFirstName & ChLF & "FN;CHARSET=utf-8:" & phFirstName & " " & phLastName & ChLF & "ORG;CHARSET=utf-8:" & phCompanyName & ChLF & "TITLE;CHARSET=utf-8:" & phTitle & ChLF & "TEL:" & phPhone & ifs(phTelephoneExt<>, "x" & phTelephoneExt, "") & ChLF & "TEL;CELL:" & phCell & ChLF & "TEL;FAX:" & phFax & ChLF & "EMAIL;INTERNET:" & phEmail & ChLF & "ADR;CHARSET=utf-8:" & phAddressOne & ";" & phAddressTwo & ";" & phCity & ";" & phState & ";" & phZip & ";USA" & ChLF & "URL:" & phWebsite & ChLF & "VERSION:2.1" & ChLF & "END:VCARD"

Note: Do not copy and paste this script directly from your web browser into eDocBuilder, as the formatting used to display it in your browser will also be copied and will make your script work incorrectly. Please first paste the script into a plain text editor (such as Notepad). Then copy the script from the plain text editor and paste it into the Field Scripting tab of your field in eDocBuilder.

Please make sure that supress blank lines is not checked in order for V-Card to work