Jump to content

Help needed to produce QR Code for VCard with color


Recommended Posts

Hello,

 

I am trying to create a QR Code for the back of a business card that will create contact information for an iPhone or Android.

The built in rules do not carry enough information, leaving out title and department for example.  I can colorize a MeCard output, but I cannot customize the fields, so it will not produce the title and some other stuff the client wants.  When I try VCard, I cannot colorize the barcode, but I can get the fields I need.  

Here is my code...

// vCard format
// http://en.wikipedia.org/wiki/VCard
// Note that support for vCard may be more limited than for MECARD,
// and that vCard requires more data to be encoded, resulting in a denser barcode.

var foreColor = "Red"; // this is not working
var info = {
   N: Field("LastName") + ';' + Field("FirstName") + ';' + Field("MiddleName") + ';;',
   FN: Field("FirstName") + ' ' + Field("MiddleName") + ' ' + Field("LastName"),
   DEPT: Field("Dept"),
   ORG: Field("Company"),
   TITLE: Field("Title"),
   "EMAIL;type=INTERNET;type=WORK": Field("Email"),
   "TEL;type=CELL": Field("Cell"),
   "TEL;type=WORK": Field("Phone1"),
   "ADR;type=WORK": ";;" + Field("Address1") + ';' + Field("City") + ';' + Field("State") + ';'
                           + Field("ZIP"),
   "URL;type=WORK": Field("Website"),
}

var result = ["BEGIN:VCARD", "VERSION:3.0"];
for (var label in info)
{
   if (info[label])
       result.push(label + ":" + info[label]);
}
result.push("END:VCARD");

return MakeQRBarcodeGraphic(result.join(Chr(13) + Chr(10)), foreColor);
 

 

Can anyone help?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...